Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I try to pull all the jpegs off of this website (http://www.zodiackillerfacts.com/gallery/) using wget:

wget -A jpg,jpeg -r http://www.zodiackillerfacts.com/gallery/

it only downloads the thumbnails. How would I be able to download the full size jpegs by using wget instead of going through all 1000 pictures one by one and clicking all of them? These pictures are all in different "albums" on the site.

share|improve this question
add comment

1 Answer

You are going to need a script which parses the gallery pages and then uses wget. For this particular site the script can be pretty straight forward, something like this:

#!/bin/bash

wget -qO - "http://www.zodiackillerfacts.com/gallery/" | \
 egrep -o 'thumbnails\.php\?album=[0-9]+' | \
  sort -u | \
    while read gallery
    do
      wget -O "/tmp/$$" "http://www.zodiackillerfacts.com/gallery/$gallery"
      album=$(egrep -m1 -o '<title>[^<]+' /tmp/$$ | \
               sed -e 's/^<title>//' -e 's/[^a-zA-Z0-9 :-()]//g')
      mkdir "$album" || continue
      cd "$album"
      egrep -o 'src="albums/[^"]*' "/tmp/$$" | \
       sed -e 's/thumb_//' \
           -e 's!^src="!http://www.zodiackillerfacts.com/gallery/!' | \
        wget -i -
      cd ..
      rm "/tmp/$$"
    done

Here, we fetch the HTML of the first page, parse out the gallery links, fetch the HTML for each gallery, make a directory for it and fetch all the images. Not very pretty or robust, but it seems to do the job.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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