2

I need a solution for downloading multiple images at once. It must work in GNU/Linux and it must only involve free/libre software. I would prefer a stand-alone program (command-line or GUI), but a browser extension is fine, too.

The image URLs have a number in the query component, from 1 to n:

http://example.com/path?query&id=1&foo=bar
http://example.com/path?query&id=2&foo=bar
http://example.com/path?query&id=3&foo=bar

There is no page where all images are embedded/linked.

The user should

  1. paste the first image URL,
  2. mark where the ID in the query is (or how the parameter is called),
  3. and enter how many images there are.

The program should

  1. download all images,
  2. and ideally include the ID in the file name (e.g., 1.png, 2.png, …).

1 Answer 1

5

Good old wget was pretty much made for this. (curl works, too.)

You just need to use a shell loop to invoke wget for each image. In Bash:

for N in {1..5} ; do wget "http://example.com/path?query&id=$N&foo=bar" -O $N.png ; done

Edit the range and the URL to taste. If there's an error trying to retrieve a given image, you'll see an error message and an empty file will be saved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.