talonius / hb-downloader Goto Github PK
View Code? Open in Web Editor NEWAn automated utility to download your Humble Bundle purchases with support for the Authy token.
License: MIT License
An automated utility to download your Humble Bundle purchases with support for the Authy token.
License: MIT License
I'm getting an error trying to list or download a humblebundle. My guess is that the api has changed since part of the full output is html, but the short stack trace is this:
Traceback (most recent call last):
File "/home/shmoopy/virtualenvs/general-env/lib/python3.10/site-packages/requests/models.py", line 910, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib/python3.10/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.10/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
This still worked fine two months ago, leading me to believe it was a recent change.
If I try to login, I always get an exception, due to humblebundle return Error 405
<Response [405]>
Traceback (most recent call last):
File "hb-downloader.py", line 41, in
hapi.login(ConfigData.username, ConfigData.password, ConfigData.authy_token)
File "/home/peter/BOOKS/hb-downloader/humble_api/humble_api.py", line 121, in login
data = self.__parse_data(response)
File "/home/peter/BOOKS/hb-downloader/humble_api/humble_api.py", line 262, in __parse_data
raise HumbleParseException("Invalid JSON: %s", str(e), request=response.request, response=response)
humble_api.exceptions.humble_parse_exception.HumbleParseException: [Errno Invalid JSON: %s] Extra data: line 1 column 5 - line 5 column 2 (char 4 - 77)
Also I did not manage to login using the cookie.txt file from the wiki with my updated session.
Any ideas?
Right now a general exception is thrown which is full of technobabble. Catch the incorrect auth exception and pretty print a message to the user.
C:\Users\Mark\Desktop\hb-downloader-0.40-beta>hb-downloader.py list
File "C:\Users\Mark\Desktop\hb-downloader-0.40-beta\hb-downloader.py", line 16
print "The Clown's Humble Bundle Downloader v%.2f" % ConfigData.VERSION
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("The Clown's Humble Bundle Downloader v%.2f" % ConfigData.VERSION)?
C:\Users\Mark\Desktop\hb-downloader-0.40-beta>
I apologize that I'm probably wording this poorly.
I just downloaded the latest version of this to try out and noticed a difference between the last version I had used from 2019. (P.S. I'm using the same settings file, just copied over to the new installation if that matters)
The one from 2019, when downloading items seemed to be using the 'item name''item type''filename' naming scheme for downloads.
The current one is appending the bundle name to the front i.e. 'bundle name''item name''item type''filename'.
For instance \cyberforce\ebook\*
became \sexandscience_bookbundle\cyberforce\ebook\*
This is causing the newer version to attempt to redownload my entire library. And to be honest, while I could probably 'fix' that by running the program in steps and moving folders around, I prefer the original naming scheme because over time I've purchased enough bundles that have overlapping products and have noticed that in those cases they normally use the same files which saves me duplication in downloading.
I've attempted to poke around in the code to determine if there is a new setting I'm missing or something that can change it back to the way it was but honestly ATM can't grok the code itself well enough to be able to tell.
Is this an intentional change or is there some way to revert it to the previous setup?
When attempting to log in, I now get (after entering my Authy token)
Traceback (most recent call last):
File "./hb-downloader.py", line 41, in <module>
hapi.login(ConfigData.username, ConfigData.password, ConfigData.authy_token)
File "/home/steve/Debian/hb-downloader-git/humble_api/humble_api.py", line 133, in login
error_msg, request=request, response=response, authy_required=authy_required)
humble_api.exceptions.humble_captcha_exception.HumbleCaptchaException: Please answer the CAPTCHA
I'm simply using this tool to get information about my Humble library. However, it seems it can only list downloads. It would be very helpful if there was a way to generate a list of games that have unredeemed keys (not the keys themselves). I have been following HumbleBundle from day 1 and it is becoming increasingly difficult to keep track of the games I own in one form or another.
There are several Javascript projects on Github that allow generating such a list, but they require being run in a browser. I am working on a bash script to automate some things and am trying to find a CLI tool that can list keys.
python hb-downloader.py
The Clown's Humble Bundle Downloader v0.41
This downloader includes MIT licensed code from Joel Pedraza.
https://github.com/saik0/humblebundle-python
[2017/09/03 08:47:52] [ Config] write_md5=True
[2017/09/03 08:47:52] [ Config] read_md5=True
[2017/09/03 08:47:52] [ Config] force_md5=False
[2017/09/03 08:47:52] [ Config] ignore_md5=False
[2017/09/03 08:47:52] [ Config] debug=True
[2017/09/03 08:47:52] [ Config] download_location=/Volumes/AFP-thearchive/thevault/Unsorted/Humble Bundle/
[2017/09/03 08:47:52] [ Config] cookie_filename=/Applications/hb-downloader/cookies.txt
[2017/09/03 08:47:52] [ Config] chunksize=8192000
[2017/09/03 08:47:52] [ Config] resume_downloads=True
[2017/09/03 08:47:52] [ Config] Platform asmjs=False
[2017/09/03 08:47:52] [ Config] Platform mac=True
[2017/09/03 08:47:52] [ Config] Platform audio=True
[2017/09/03 08:47:52] [ Config] Platform linux=True
[2017/09/03 08:47:52] [ Config] Platform windows=True
[2017/09/03 08:47:52] [ Config] Platform android=True
[2017/09/03 08:47:52] [ Config] Platform ebook=True
Enter your Authy token:
Traceback (most recent call last):
File "hb-downloader.py", line 41, in
hapi.login(ConfigData.username, ConfigData.password, ConfigData.authy_token)
File "/Applications/hb-downloader/humble_api/humble_api.py", line 115, in login
data = self.__parse_data(response)
File "/Applications/hb-downloader/humble_api/humble_api.py", line 255, in __parse_data
raise HumbleParseException("Invalid JSON: %s", str(e), request=response.request, response=response)
humble_api.exceptions.humble_parse_exception.HumbleParseException: [Errno Invalid JSON: %s] Extra data: line 1 column 5 - line 5 column 2 (char 4 - 77)
The system only works with Authy generated tokens; it doesn't work with emailed tokens generated by HumbleBundle.com. This should be rectified.
I get the following errors
Traceback (most recent call last):
File "hb-downloader.py", line 41, in <module>
hapi.login(ConfigData.username, ConfigData.password, ConfigData.authy_token)
File "/home/fangfufu/src/hb-downloader/humble_api/humble_api.py", line 115, in login
data = self.__parse_data(response)
File "/home/fangfufu/src/hb-downloader/humble_api/humble_api.py", line 255, in __parse_data
raise HumbleParseException("Invalid JSON: %s", str(e), request=response.request, response=response)
humble_api.exceptions.humble_parse_exception.HumbleParseException: [Errno Invalid JSON: %s] Extra data: line 1 column 5 - line 5 column 2 (char 4 - 77)
I have tried using the cookies.txt
As it stands every time the script is run it will start checksumming all the files, depending on how many files that it is can take 10's of minutes. Furthermore, if a download it then interrupted it will begin again from the beginning check the checksums of all the files.
Can some sort of flag be made to either skip checksumming all the files or to start from a particular bundle/purchase number?
Thanks.
I was able to find the configuration file location by reading the source and PKGBUILD on the AUR but it'd help if this was mentioned in the README, and also if it looked for a configuration file on a per-user basis, in the appropriate configuration file directories, say ~/.config/hb-downloader
.
And yes, I'm aware it looks for a configuration file in the pwd, but it's kind of awkward to first have to navigate to the correct directory before calling the executable.
I may work on a pull request that implements these things at some point but I won't be able to for a while
Make the progress indications more graphical, ala wget/curl.
First of all: Thank you for your work! It makes downloading my stuff from HumbleBundle a charm.
There is one feature I'd like to see in the future: Let me define a list of prefered formats for my Ebooks and only download the first matched file type. I have a lot of comics in my purchases and most of them come in three different formats (cbz, epub, pdf). It would be nice to define a list of formats like this:
ebook_format: cbz epub pdf *
The downloader needs to accept a password from the command line which will override the one specified in the config file. Need to be aware of the possible use of special symbols and characters in the password.
The downloader needs to accept an username from the command line which will override the one specified in the config file.
I sometimes just want to download a single product (as in "Humble Book Bundle: Something something") or a single subproduct from that bundle (as in "How to Cook your Cat[epub pdf mobi]").
Currently I took a stab at implementing the product filter. But in case you find this useful, maybe it would be worth adding it as a feature?
I have tried changing the options for the platforms in both the hb-downloader-settings.yaml as well as config_data.py. Even with some of the platforms marked as "False" the script appears to be downloading every platform. The output does show that it is skipping flacs, but that appears to be hard coded into humble_download.py.
I've tried putting my session cookie in cookes.txt in multiple different formats. I've also tried both enabling and disabling authy. Every time I try to run the script on Ubuntu 16.04, 17.10, and Windows 10 I get this error:
Traceback (most recent call last):
File "./hb-downloader.py", line 41, in <module>
hapi.login(ConfigData.username, ConfigData.password, ConfigData.authy_token)
File "/home/hb/hb-downloader-old/humble_api/humble_api.py", line 133, in login
error_msg, request=request, response=response, authy_required=authy_required)
humble_api.exceptions.humble_captcha_exception.HumbleCaptchaException: Are you sure you're not a robot? Please try again.
My cookies.txt looks like this:
#LWP-Cookies-2.0
Set-Cookie3: _simpleauth_sess=""<edited out string>""; path="/"; domain="www.humblebundle.com"; path_spec; secure; expires="1578381372.963161"; HttpOnly=None; version=0
I've done the /login to /processlogin fix and tried the python3 MayeulC fork but I get the same issue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.