Created
January 23, 2020 18:10
-
-
Save albertfdp/3a27d202db8fe60008be0494bec31c53 to your computer and use it in GitHub Desktop.
Download files from Amazon
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
const chunk = (arr, size) => | |
Array.from({ length: Math.ceil(arr.length / size) }, (v, i) => | |
arr.slice(i * size, i * size + size) | |
); | |
chunk([...document.querySelectorAll(".file-list-node.selectable")], 10).forEach( | |
(files, i) => { | |
console.log("downloading chunk", i); | |
files.forEach(node => node.click()); | |
document.querySelector("button.download").click(); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment