Skip to content

Instantly share code, notes, and snippets.

@robwalkerco
Last active December 14, 2023 08:14
Show Gist options
  • Save robwalkerco/81ea04284ad713888a077825e4bc1479 to your computer and use it in GitHub Desktop.
Save robwalkerco/81ea04284ad713888a077825e4bc1479 to your computer and use it in GitHub Desktop.
Zenfolio photo downloader
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()
@robwalkerco
Copy link
Author

Copy the above script to the developer console in Chrome and run to download all the photos 😄

@robwalkerco
Copy link
Author

This script has been uploaded, as it was no longer working.
The script will now open a new tab for each photo, displaying the best quality photo possible. You can then go through each tab and save as necessary.

(p.s. Please respect copyright etc)

@balbuf
Copy link

balbuf commented Dec 20, 2021

Thanks for the original! I adapted it so it actually downloads the images again: https://gist.github.com/balbuf/83eede995eb4e07226a20e36a36c9c6f

@mavennumber1
Copy link

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

@pwanning
Copy link

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