You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, img2dataset does not support downloading files from URLs that require following HTTP redirects. For example, trying to download the file from the following URL fails due to multiple redirects in the process:
To ensure img2dataset works seamlessly with such URLs, it would be helpful to add a feature that enables automatic following of HTTP redirects.
Proposed Solution
Add an optional parameter (e.g., follow_redirects) that allows enabling auto-following of redirects during the download process. The default behavior could remain unchanged to preserve backward compatibility.
For example, the requests library already supports this functionality with its default behavior:
Currently, img2dataset does not support downloading files from URLs that require following HTTP redirects. For example, trying to download the file from the following URL fails due to multiple redirects in the process:
https://hors.easymerch.ru/analytics/photos/view/f-hors/6/70836/70840/239501.jpg
Below is an example of how wget handles the redirects:
To ensure img2dataset works seamlessly with such URLs, it would be helpful to add a feature that enables automatic following of HTTP redirects.
Proposed Solution
Add an optional parameter (e.g.,
follow_redirects
) that allows enabling auto-following of redirects during the download process. The default behavior could remain unchanged to preserve backward compatibility.For example, the requests library already supports this functionality with its default behavior:
Alternatively, this behavior could be activated with an additional CLI flag.
Benefits
Enables downloading resources from dynamically redirected URLs.
Improves usability for datasets hosted on platforms with redirect-based file access.
Example Use Case
Using img2dataset to download files from:
https://hors.easymerch.ru/analytics/photos/view/f-hors/6/70836/70840/239501.jpg
Without this feature, the download fails, but with redirect support, the process completes successfully.
List of files to test:
Command to run:
Try to download this images with using img2dataset and you will get an error:
The text was updated successfully, but these errors were encountered: