Skip to content

Instantly share code, notes, and snippets.

@chpwssn
Last active February 17, 2020 23:07
Show Gist options
  • Save chpwssn/856bc2e2fbc52e85aa79078fd0d977df to your computer and use it in GitHub Desktop.
Save chpwssn/856bc2e2fbc52e85aa79078fd0d977df to your computer and use it in GitHub Desktop.
Humble Book Bundle Download

Open the humblebook bundle download page and get the list of download URLs via the inspector's console with

Array.from(document.getElementsByClassName("a")).map(element => element.getAttribute('href')).filter(value => value && value.indexOf('dl.humble') != -1).join('\n')

Touch a files.txt and fill it with the contents from the oneliner above. Then wget the files with wget -i files.txt

Rename the PDF, epub, and mobi files with

for i in *.epub?*; do mv $i ${i/\?*/}; done
for i in *.pdf?*; do mv $i ${i/\?*/}; done
for i in *.mobi?*; do mv $i ${i/\?*/}; done
for i in *.zip?*; do mv $i ${i/\?*/}; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment