This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Download images from a CSV/TSV file containing at least two columns: | |
- sample_id: unique identifier for each row | |
- image_link: HTTP(S) URL to the image | |
Images are saved using the sample_id as the filename. The script preserves the | |
file extension from the URL when possible, otherwise infers from the response's | |
Content-Type header and defaults to .jpg as a last resort. |