Skip to content

Download Shootproof photos bookmarklet

Posted on:October 21, 2022

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

  1. Navigate to your shootproof gallery. The url should be something like https://photographer.shootproof.com/gallery/12345678/home
  2. Click on the first photo in the gallery. The url should now be something like https://photographer.shootproof.com/gallery/12345678/photo/1234567890
  3. Copy the code at the bottom of this page.
  4. 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”.
  5. Name the bookmark whatever you want.
  6. Paste what you copied from step 3 into the url for the bookmark.
  7. Save the bookmark.
  8. 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();
})();