-
-
Save WynterFoxx/bcd030a811d408d74981f3a0f2e0e19e to your computer and use it in GitHub Desktop.
Download the whole of the humble trove (if you have subscribed to the humble trove)
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
let buttons = document.getElementsByClassName("js-download-button"); | |
let i = 0; | |
let interval = setInterval(() => { | |
if(i > buttons.length) | |
{ | |
clearInterval(interval); | |
} | |
else{ | |
buttons[i].click(); | |
console.log(++i) | |
console.log('Downloading: '+buttons[i - 1].parentNode.parentNode.parentNode.children[0].children[0].children[0].innerHTML); | |
} | |
}, 1000); |
Additional quick edit, switched if/else statements, moved console.log(i++) and replaced i++ with ++i.
Console now returns the value of i before the Downloading message, and starts at 1.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script has only been tested in Firefox
Script now stops after opening every download link, instead of looping infinitely, creating a repetitive TypeError.
If downloads are started while the browser's maximum number of concurrent connections is already met, they will instantly fail, making this script un-recommended to be used. (It is possible to increase the maximum amount of connections allowed by Windows and your browser, however I also don't recommend doing this, because the website may block (and punish) such attempts, and it could affect the connections of other visitor's)