Downloads all pdfs, epubs, or mobis from a purchased Humble Bundle. I realized one day that I had a lot of bundles purchased from Humble Bundle and that I hadn't saved them to my local hard drive/OneDrive. I wanted to save them all in multiple formats (PDF and epub), but the save feature on the Humble Bundle website isn't the best and it was taking forever to download every book from every bundle in two different formats. I realized that the direct links to download each of the books in the bundles were in the HTML for each bundle, so I decided to scrape a locally downloaded page for links to then download.
Please let me know if this ends up helping you, and I welcome any pull requests/issues to make it a bit better.
-
Most importantly, purchase book bundles from Humble Bundle
-
Ensure to save as a complete web page (which will give you some extra files, but the resulting lone .html file will have the correct links). Saving this to the same directory where downloader.py lives is recommended
Run downloader.py while providing the .html or .htm file(s) downloaded in the pre-steps.
Options include:
-f, --files
to provide a space delimited list of html files from which to download-t, --types
to provide a space delimited list of file types to download. Options are: pdf (default), epub, and/or mobi--force
to re-download files of the same file type and name even if they already exist. Default is False, set the flag for True-r, --remove
to delete the html and other webpage files downloaded in the pre-steps. Default is False, set the flag for True-v
to set the logging level to DEBUG
Examples
python downloader.py -f bundle1.html bundle2.html --remove
python downloader.py -f bundle3.html --types pdf epub -v