Last active
October 6, 2016 10:41
-
-
Save alexgleason/299d659d19458da13d0e19aa8460586f to your computer and use it in GitHub Desktop.
Download Facebook albums
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
// To download a Facebook album. | |
// Run this script in the console on the album page. | |
// Save the output into a text file called urls.txt | |
// Then run the shell commands. | |
function getAlbumDownloadLinks() { | |
var pics = document.querySelectorAll('#fbTimelinePhotosContent a.uiMediaThumb') | |
var result = '' | |
for(var i=0; i<pics.length; i++) { | |
var link = pics[i].getAttribute('href') | |
link = link.substring(link.indexOf('fbid=')+5, link.length) | |
result = result+'https://www.facebook.com/photo/download/?fbid='+link+'\n' | |
} | |
return result | |
} |
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 | |
wget -i urls.txt --content-disposition --adjust-extension | |
for i in `find $1 -type f` | |
do | |
mv $i `echo $i | cut -d? -f1` | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://www.facebook.com/photo/download/?fbid=10154517926354238 (is no more working)