Last active
December 14, 2023 08:14
-
-
Save robwalkerco/81ea04284ad713888a077825e4bc1479 to your computer and use it in GitHub Desktop.
Zenfolio photo 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 paths = [] | |
var count = 1 | |
// Before running this script, you will need to scroll | |
// to the bottom of the zenfolio page to ensure all the | |
// images in the dom | |
function openAllPhotos() { | |
// Collect the paths for each photo | |
$('.pv-inner img:first-child').each((index, image) => { | |
paths.push(image.style.backgroundImage.split('"')[1]) | |
}) | |
// We set an increasing timeout for each photo so we | |
// dont hammer the servers too hard! | |
paths.forEach((path, index) => { | |
setTimeout(() => { | |
var element = document.createElement('a'); | |
element.setAttribute('href', path.replace(/-\d.jpg/, '-6.jpg')); | |
element.setAttribute('target', '_blank'); | |
element.style.display = 'none'; | |
document.body.appendChild(element); | |
element.click(); | |
document.body.removeChild(element); | |
}, count * 500) | |
count = count + 1 | |
}) | |
} | |
// Run the script! | |
openAllPhotos() |
Thanks for the original! I adapted it so it actually downloads the images again: https://gist.github.com/balbuf/83eede995eb4e07226a20e36a36c9c6f
it's very low resolution
Thanks for the original! I adapted it so it actually downloads the images again: https://gist.github.com/balbuf/83eede995eb4e07226a20e36a36c9c6f
it's very low resolution
I had to modify the regular expression from (/-\d.jpg/, '-6.jpg') to (/-\d+.jpg/, '-6.jpg') because my images had two digits (-11.jpg) in their file names. After the change, the correct images with the 1440px resolution were downloaded
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks for the original! I adapted it so it actually downloads the images again: https://gist.github.com/balbuf/83eede995eb4e07226a20e36a36c9c6f