This bookmarklet is to download all of the photos from a Shootproof gallery. It’ll go through each photo one by one and download the high quality image.
Instructions
- Navigate to your shootproof gallery. The url should be something like https://photographer.shootproof.com/gallery/12345678/home
- Click on the first photo in the gallery. The url should now be something like https://photographer.shootproof.com/gallery/12345678/photo/1234567890
- Copy the code at the bottom of this page.
- Add a new bookmark to your bookmarks bar. This is usually done by right clicking somewhere on the bookmarks bar and then clicking “Add Bookmark”.
- Name the bookmark whatever you want.
- Paste what you copied from step 3 into the url for the bookmark.
- Save the bookmark.
- Click on the bookmark to run the script.
Code
javascript: (function () {
const NEXT_BTN_SELECTOR = `.photo-navigation-link-next`;
const DOWNLOAD_BTN_SELECTOR = `[aria-label="Download"]`;
function sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
function getAllButtons() {
return Array.from(document.querySelectorAll("button"));
}
function getDownloadButton() {
let button = document.querySelector(DOWNLOAD_BTN_SELECTOR);
if (!button) {
button = getAllButtons().find(x => x.textContent.toLowerCase() === "download");
}
return button;
}
function isElClickable(selector) {
const button = document.querySelector(selector);
return !button.classList.contains(`disabled`);
}
async function run() {
try {
while (true) {
getDownloadButton().click();
await sleep(3500);
if (!isElClickable(NEXT_BTN_SELECTOR)) {
break;
}
document.querySelector(NEXT_BTN_SELECTOR).click();
await sleep(1000);
}
} catch (err) {
alert(`Something went wrong.\n\n${err}`);
throw err;
}
}
run();
})();