Is there a way to use curl to download non-sequential images with a wildcard? I want to download all the panoramas I upload to my account at 360 Panorama to a local folder so I don't have to do this manually each time.
The images files follow the pattern of: http://occipital.com/images/viewer/XYZ_flat.jpg with the XYZ being random. It also seems from that URL that I need to be logged in or seen as logged in to the site.
Best Answer
You can use this
bash
code for the actual URL you provided in your comment.Feel free to write this command as one line; all line breaks were only added to increase legibility. You may copy or remove them, whatever you like.
What this code does:
If you want to only download files which don't exist, and don't know the number of gallery pages up front, you can adjust the code to this:
The first code now increments the page number until a redirect or error occurs. The server will redirect you to the last existing page if you try to visit a page after the existing ones. The
[[ -f … ]] ||
part will executecurl
only if the corresponding file does not exist yet.