Skip to content

Instantly share code, notes, and snippets.

@codfish
Last active March 11, 2016 03:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codfish/aae9710da385d0e276b9 to your computer and use it in GitHub Desktop.
Save codfish/aae9710da385d0e276b9 to your computer and use it in GitHub Desktop.
Download wedding photos. Photographer put all of our photos for us and family to buy, but wasn't going to give us a digital copy. So...
#!/usr/bin/env bash
# need to set env variable for the public base url for the photos
if [[ -z "$WEDDING_URL_PREFIX" ]]; then
printf '\nError: WEDDING_URL_PREFIX needs to be set in your environment!\n'
exit 1
fi
# image filenames had two different prefixes
IMG_TOTAL=2405
S41A_TOTAL=1000
# download all the photos using curl's ability to dload a sequential range of urls
curl $WEDDING_URL_PREFIX/IMG_[0001-$IMG_TOTAL].jpg -O -s -f &> /dev/null &
curl $WEDDING_URL_PREFIX/S41A_[0001-$S41A_TOTAL].jpg -O -s -f &> /dev/null &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment