Skip to content

Instantly share code, notes, and snippets.

@roymacdonald
Last active August 12, 2020 04:49
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 roymacdonald/fc808144d46fc499d654d05209f2495a to your computer and use it in GitHub Desktop.
Save roymacdonald/fc808144d46fc499d654d05209f2495a to your computer and use it in GitHub Desktop.
call this script from terminal an pass to it the file with the URLs you want to download. One URL per line
#!/bin/bash
if [ $# -eq 0 ];then
echo "Usage:"
echo " downloadImgsFromJson.sh /path/to/json/file"
exit 1
fi
URLS=($(cat "$1" | grep -o "\"original\":.*$" | sed -E "s/\"original\": \"(.*)\"/\1/g" ))
for u in "${URLS[@]}"; do
curl -O "$u"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment