-
-
Save qwo/d733e71b6b278724422f5c575dffea2e to your computer and use it in GitHub Desktop.
Humble bundle book bundles - download all books at once
This file contains hidden or 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
/* | |
After purchasing a humble book bundle, go to your download page for that bundle. | |
Open a console window for the page and paste in the below javascript | |
Updated: Credit @jmerle | |
*/ | |
const commands = []; | |
document.querySelectorAll('.row').forEach(row => { | |
const bookTitle = row.dataset.humanName; | |
[...row.querySelectorAll('.downloads .flexbtn a')].forEach(el => { | |
const downloadLink = el.href; | |
const fileName = /\.com\/([^?]+)/.exec(downloadLink)[1]; | |
commands.push(`curl --create-dirs -o "${bookTitle}/${fileName}" "${downloadLink}"`); | |
}); | |
}); | |
console.log(commands.join('; ')); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment