Last active
December 17, 2021 00:18
-
-
Save ethiapath/a375968c4faf15cf7f02a4a84a75552b to your computer and use it in GitHub Desktop.
Download multiple bandcamp albums on a timer (automation)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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