0

I have used the following script which brings back about 90 albums with URLs. BUT, I then have to page down a few and repeat and this brings back a few more. With 800 odd albums this takes a long while. Does any know how to get back all the albums at once?

Executed on the page https://photos.google.com/albums, this script returns a string that can be copy-pasted to a Google Sheet, creating a table of names and URLs.

var links = document.getElementsByTagName('A');
var s = '';
for (var i = 0; i < links.length; i++) {
  let link = links[i];
  if (/\b\d+ items\b/.test(link.innerText)) {
    let divs = link.getElementsByTagName('DIV');
    for (var j = 0; j < divs.length; j++) {
      let div = divs[j];
      let text = div.innerText;
      if (text != "" && div.childElementCount == 0 && ! /\b\d+ items\b/.test(text)) {
        s = s + text + '\t' + link.href + '\n';
        break;
      }
    }
  }
}
s;

1 Answer 1

0

Two ways to do this.

  1. Google Takeout will generate an HTML inside the takeout archives which have the album URL.
  2. (Recommended) Use rclone's Google Photos wrapper to programmatically fetch this info. https://rclone.org/googlephotos/#albums

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.