Skip to content

Instantly share code, notes, and snippets.

@ethiapath
Last active December 17, 2021 00:18
Show Gist options
  • Save ethiapath/a375968c4faf15cf7f02a4a84a75552b to your computer and use it in GitHub Desktop.
Save ethiapath/a375968c4faf15cf7f02a4a84a75552b to your computer and use it in GitHub Desktop.
Download multiple bandcamp albums on a timer (automation)
// Good for downloading discographies
// Bandcamp rate limits you if you download too many albums too quickly.
// This spaces out the downloads so you don't have to click on every single link!
(function nextDownload (n) {
const links = Array.from(document.getElementsByClassName('download-title')).map(e => e.firstElementChild)
console.log(links[n]);
links[n].click()
console.log( n++ );
// Downloads next album after 60 seconds.
if (n <= links.length) setTimeout( nextDownload, 60000, n ); // Redo if n <= num albums
} (0)); // Initialize. n is 0. Adjust if downloads fail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment