You can use this bash
code for the actual URL you provided in your comment.
for i in $(for j in {1..8}; do
curl http://occipital.com/user/01ca-255/george-coghill/$j/;
done \
| sed -n 's,.*/viewer/\(......_flat\)_small\.jpg.*,http://occipital.com/images/viewer/\1.jpg,p'
); do
curl -L -o "${i##*/}" "$i";
done
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:
- Iterate over the 8 pages of your account gallery
- Extract the image names from the preview images
- Fetch all full-sized images using this list of names
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:
for i in $(
j=1;
while curl --max-redirs 0 -L -f \
http://occipital.com/user/01ca-255/george-coghill/$((j++))/; do
:;
done \
| sed -n 's,.*/viewer/\(......_flat\)_small\.jpg.*,http://occipital.com/images/viewer/\1.jpg,p'
); do
[[ -f "${i##*/}" ]] || curl -L -o "${i##*/}" "$i";
done
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 execute curl
only if the corresponding file does not exist yet.
curl
.