Skip to content

Instantly share code, notes, and snippets.

@mawalu
Created January 3, 2018 16:10
Show Gist options
  • Save mawalu/46f86b6ea641b5fb8aa4f2fa3d9f5151 to your computer and use it in GitHub Desktop.
Save mawalu/46f86b6ea641b5fb8aa4f2fa3d9f5151 to your computer and use it in GitHub Desktop.
Download Humble Bundle books / videos
// Enter into your console while on the download page
// idea from: https://gist.github.com/graymouser/a33fbb75f94f08af7e36
let b = []
$('a').each(function(i){
if ($.trim($(this).text()) == 'PDF') { // change to MOBI, Download, EPUB depending on the button text
b.push(this.href)
}
});
console.log(JSON.stringify(b))
// copy the output into your clipboard
# Execute in your download folder
# --content-disposition should fix the filenames of the downloaded files
echo 'STRING_FROM_BROWSER_CONSOLE' | jq ".[]" | xargs -n1 wget --content-disposition
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment