Last active
March 11, 2016 03:32
-
-
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...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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