Skip to content

Instantly share code, notes, and snippets.

@albertfdp
Created January 23, 2020 18:10
Show Gist options
  • Save albertfdp/3a27d202db8fe60008be0494bec31c53 to your computer and use it in GitHub Desktop.
Save albertfdp/3a27d202db8fe60008be0494bec31c53 to your computer and use it in GitHub Desktop.
Download files from Amazon
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