Download all files from a purchased Humble Bundle

These two snippets can be used to download all books or videos from a purchased Humble Bundle without manually saveing every file.

// 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

Save the files

# 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