Last active
September 24, 2017 09:28
-
-
Save dardo82/82825c9d85c7b3a1686009ea81b99705 to your computer and use it in GitHub Desktop.
FaceBook photo DL
This file contains hidden or 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
#!/bin/bash | |
shopt -s expand_aliases; fb=https://m.facebook.com; open $fb/$1/photos; sleep 10 | |
function safari-cli { eval osascript -e \'tell application \"Safari\" to $1\'; } | |
alias sst='safari-cli "get source of current tab of front window"' | |
alias sct='safari-cli "close current tab of front window"' | |
sst | tr \" \\n | grep ^/.*42$ | cut -d\& -f1 | xargs -I {} open $fb{}; sleep 10 | |
mkdir $1; cd $1; for page in {01..40}; do URL=$(sst | tr \" \\n | grep -B1 Size\ | |
| sed -E "s/amp;|\\\//g;q"); curl -v -o $(basename ${URL%\?*}) "$URL"; sct; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment