Last active
March 31, 2018 00:09
-
-
Save mixu/3daa41bd5b0fa4ded2b26811aa53b503 to your computer and use it in GitHub Desktop.
Facebook album downloader
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
var images = []; | |
function getPhoto() { | |
var img = document.querySelector('.spotlight'); | |
console.log(images.length, img.src); | |
var hasImage = images.indexOf(img.src) !== -1 | |
if (!hasImage) { | |
images.push(img.src); | |
var currentSrc = img.src; | |
document.querySelector('.snowliftPager.next').click(); | |
var interval = setInterval(function() { | |
var loading = document.querySelector('.spotlight'); | |
if (loading.src !== currentSrc && loading.complete) { | |
clearInterval(interval); | |
getPhoto(); | |
} | |
}, 100); | |
} else { | |
console.log('all done'); | |
window.wget = images.map(function(image) { | |
return 'wget --no-check-certificate "' + image + '"'; | |
}); | |
window.wget.map(function(line) {console.log(line); }); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment