Coder Social home page Coder Social logo

humble-steam-key-redeemer's Introduction

Humble Steam Key Redeemer

Python utility script to extract Humble keys, and redeem them on Steam automagically by detecting when a game is already owned on Steam.

This is primarily designed to be a set-it-and-forget-it tool that maximizes successful entry of keys into Steam, assuring that no Steam game goes unredeemed.

This script will login to both Humble and Steam, automating the whole process. It's not perfect as I made this mostly for my own personal case and couldn't test all possibilities so YMMV. Feel free to send submit an issue if you do bump into issues.

Any revealing and redeeming the script does will output to spreadsheet files based on their actions for you to easily review what actions it took and whether it redeemed, skipped, or failed on specific keys.

Modes

Auto-Redeem Mode (Steam)

Find Steam games from Humble that are unowned by your Steam user, and ONLY of those that are unowned, redeem on Steam revealed keys (This EXCLUDES non-Steam keys and unclaimed Humble Choice games)

If you choose to reveal keys in this mode, it will only reveal keys that it goes to redeem (ignoring those that are detected as already owned)

Export Mode

Find all games from Humble, optionally revealing all unrevealed keys, and output them to a CSV (comes with an optional Steam ownership column).

This is great if you want a manual review of what games are in your keys list that you may have missed.

Humble Chooser Mode

For those subscribed to Humble Choice, this mode will find any Humble Monthly/Choice that has unclaimed choices, and will let you select, reveal, and optionally autoredeem on Steam the keys you select

Notes

To remove an already added account, delete the associated .(humble|steam)cookies file.

Dependencies

Requires Python version 3.6 or above

Install the required dependencies with

pip install -r requirements.txt

If you want to install python-Levenshtein:

pip install python-Levenshtein

humble-steam-key-redeemer's People

Contributors

failspy avatar jonathanharford avatar lofhjann avatar makupi avatar mcclurej06 avatar opensauce avatar positronic-brain avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

humble-steam-key-redeemer's Issues

Script silently fails when timed out on login API request when 403'd from Cloudflare

Script times out after hanging on login, after HB username and password have been entered. See log below

Traceback (most recent call last):
File "D:\git\steamredeem\humble-steam-key-redeemer\humblesteamkeysredeemer.py", line 907, in
humble_login(driver)
File "D:\git\steamredeem\humble-steam-key-redeemer\humblesteamkeysredeemer.py", line 276, in humble_login
auth,login_json = do_login(driver,payload)
^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\git\steamredeem\humble-steam-key-redeemer\humblesteamkeysredeemer.py", line 246, in do_login
auth,login_json = perform_post(driver,HUMBLE_LOGIN_API,payload)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\git\steamredeem\humble-steam-key-redeemer\humblesteamkeysredeemer.py", line 131, in perform_post
return driver.execute_async_script(fetch_cmd.format(formData=json_payload,url=url,csrf=csrf))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jwitt\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 423, in execute_async_script
return self.execute(command, {"script": script, "args": converted_args})["value"]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Jwitt\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\webdriver.py", line 344, in execute
self.error_handler.check_response(response)
File "C:\Users\Jwitt\AppData\Local\Programs\Python\Python311\Lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 229, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: script timeout
(Session info: chrome=118.0.5993.89)
Stacktrace:
GetHandleVerifier [0x00007FF7E0468EF2+54786]
(No symbol) [0x00007FF7E03D5612]
(No symbol) [0x00007FF7E028A4FD]
(No symbol) [0x00007FF7E0305A0A]
(No symbol) [0x00007FF7E02EBE6A]
(No symbol) [0x00007FF7E0304D02]
(No symbol) [0x00007FF7E02EBC43]
(No symbol) [0x00007FF7E02C0941]
(No symbol) [0x00007FF7E02C1B84]
GetHandleVerifier [0x00007FF7E07B7F52+3524194]
GetHandleVerifier [0x00007FF7E080D800+3874576]
GetHandleVerifier [0x00007FF7E0805D7F+3843215]
GetHandleVerifier [0x00007FF7E0505086+694166]
(No symbol) [0x00007FF7E03E0A88]
(No symbol) [0x00007FF7E03DCA94]
(No symbol) [0x00007FF7E03DCBC2]
(No symbol) [0x00007FF7E03CCC83]
BaseThreadInitThunk [0x00007FFDB171257D+29]
RtlUserThreadStart [0x00007FFDB208AA78+40]

program closes

when i try to redeem or select options 2 or 3 it closes.

Dealing with Repeats

Something that I hadn't thought of before is you may end up with 'Repeats' in your Humble Bundle orders which technically doesn't get filtered out in a single run. e.g. two keys for the same game, but the game is unowned by the Steam user -- would lead to 2 'unowned keys', first one successfully redeeming, second one triggering 'already owned'.

This should be relatively easy to filter out with an array though -- assuming Humble Bundle stays consistent with its data entry.
Each time a key is added, just add some property of that game to an array (say 'human_name' or 'steam_app_id'). On any further loops, just make sure the game you're attempting to activate hasn't appeared in that array.

Suggest to loosen the dependency on fuzzywuzzy

Hi, your project humble-steam-key-redeemer(commit id: 1d1de43) requires "fuzzywuzzy==0.18.0" in its dependency. After analyzing the source code, we found that the following versions of fuzzywuzzy can also be suitable, i.e., fuzzywuzzy 0.17.0, since all functions that you directly (2 APIs: fuzzywuzzy.fuzz.token_set_ratio, fuzzywuzzy.fuzz.token_sort_ratio) or indirectly (propagate to 17 fuzzywuzzy's internal APIs and 4 outsider APIs) used from the package have not been changed in these versions, thus not affecting your usage.

Therefore, we believe that it is quite safe to loose your dependency on fuzzywuzzy from "fuzzywuzzy==0.18.0" to "fuzzywuzzy>=0.17.0,<=0.18.0". This will improve the applicability of humble-steam-key-redeemer and reduce the possibility of any further dependency conflict with other projects.

May I pull a request to further loosen the dependency on fuzzywuzzy?

By the way, could you please tell us whether such an automatic tool for dependency analysis may be potentially helpful for maintaining dependencies easier during your development?

Please clarify that the script is Windows-only

'Batchfile' is mentioned under languages, but I still managed to clone to repository and install the requirements on Linux. Also step-by-step instructions would likely prevent similar cases.

More key filtering issues...

As said in the other issue the filter for key["gamekey"] simply filters to many keys as multiple different keys share the same gamekey.

That said, the line that I changed
steam_keys = [key for key in steam_keys if key["redeemed_key_val"] not in filtered_keys]
did not filter out some keys even though when looping through all "key" I clearly could find the value key["redeemed_key_val"] both in the keys and in the filtered_keys files and loaded lists.

There is an issue with "in" not finding all instances.

Key "None" in already_owned.csv

I end up with various entries in already_owned.csv that show "None" for the actual steam key even though there was a steam key. My expectation would have been to see the actual key it could be redeemed with on Steam.

(I removed the first code from the copy/paste)

,Victor Vran,None
,Shadowrun: Hong Kong - Extended Edition,None
,Stronghold Crusader 2,None
,Twilight Struggle,None
,Pandemic: The Board Game,None
,ENSLAVED™: Odyssey to the West™ Premium Edition,None
,GOD EATER 2: Rage Burst,None
,Yoku's Island Express,None

Key Dump feature

Some people just want a list of keys from Humble.

Ask user if they would like to dump all their keys (including non-Steam?) on Humble Bundle

Maybe as a CSV, letting them use spreadsheet software or something to filter those keys for themselves.
Can include an option to detect Steam ownership as a column (optional, as this requires a Steam login).

KeyError: 'transfer_parameters'

I'll start by aplogizing and this could just be a simple fix that I just dont know. I'm not very fimilar with python.

When try run the script I get this transfer parameters error once I enter the steam login info.

Traceback (most recent call last):
File "C:\Users\XXXi\Downloads\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 957, in
redeem_steam_keys(driver, steam_keys if try_already_revealed else unrevealed_keys)
File "C:\Users\XXX\Downloads\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 617, in redeem_steam_keys
session = steam_login()
^^^^^^^^^^^^^
File "C:\Users\XXX\Downloads\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 332, in steam_login
session = user.cli_login()
^^^^^^^^^^^^^^^^
File "C:\Users\XXX\AppData\Local\Programs\Python\Python312\Lib\site-packages\steam\webauth.py", line 266, in cli_login
return self.login(password, captcha, email_code, twofactor_code, language)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\XXX\AppData\Local\Programs\Python\Python312\Lib\site-packages\steam\webauth.py", line 209, in login
self._finalize_login(resp)
File "C:\Users\XXX\AppData\Local\Programs\Python\Python312\Lib\site-packages\steam\webauth.py", line 153, in _finalize_login
self.steam_id = SteamID(login_response['transfer_parameters']['steamid'])
~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
KeyError: 'transfer_parameters'

Any ideas?

Steam login error

Just a heads up, the WebAuth class from steam is not working, it is know ValvePython/steam#450

I solved it by editing the the webauth.py file and some small changes to this script but I would recommend waiting for an official steam update.

Monthly Choices

I know you had spoken about this on the Reddit thread, what's your thoughts for handling it? Maybe can do something simple for now and just print out how many choices you have left in the past?

No exit from 2FA prompt

...or maybe I'm wrong, but it seems like if for whatever reason I don't get the 2FA code from Humble or Steam, and I have nothing to enter... there's no way to exit the program? Even Ctrl+C doesn't save me here.

Fatal error when exporting keys

This occurs after choosing to export all keys and entering steam credentials to detect ownership:

Traceback (most recent call last):
File "/home/myuser/humble-steam-key-redeemer-main/humblesteamkeysredeemer.py", line 338, in redeem_humble_key
return respjson["key"]
~~~~~~~~^^^^^^^
KeyError: 'key'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/myuser/humble-steam-key-redeemer-main/humblesteamkeysredeemer.py", line 880, in
export_mode(driver,order_details)
File "/home/myuser/humble-steam-key-redeemer-main/humblesteamkeysredeemer.py", line 709, in export_mode
tpk["redeemed_key_val"] = redeem_humble_key(humble_session,tpk)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/myuser/humble-steam-key-redeemer-main/humblesteamkeysredeemer.py", line 340, in redeem_humble_key
return resp.text
^^^^
NameError: name 'resp' is not defined

.humblecookies not found

Hey, trying out the latest build here and the program exits silently, but outputs the following in error.log:

Traceback (most recent call last):
File "/home/myuser/humble-steam-key-redeemer-main/humblesteamkeysredeemer.py", line 868, in
humble_login(driver)
File "/home/myuser/humble-steam-key-redeemer-main/humblesteamkeysredeemer.py", line 236, in humble_login
if try_recover_cookies(".humblecookies", driver) and verify_logins_session(driver)[0]:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/myuser/humble-steam-key-redeemer-main/humblesteamkeysredeemer.py", line 199, in try_recover_cookies
raise e
File "/home/myuser/humble-steam-key-redeemer-main/humblesteamkeysredeemer.py", line 189, in try_recover_cookies
cookies = pickle.load(open(cookie_file,"rb"))
^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '.humblecookies'

Is this file .humblecookies required to run?

Error while redeeming

Traceback (most recent call last):
File "D:\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 780, in
redeem_steam_keys(humble_session, steam_keys if try_already_revealed else unrevealed_keys)
File "D:\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 480, in redeem_steam_keys
write_key(9,key)
File "D:\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 357, in write_key
output = "{gamekey},{human_name},{redeemed_key_val}\n".format(**key)
KeyError: 'redeemed_key_val'

Issue with key filtering and/or retrieval - possibly because gamekey is not unique

My already_owned.csv has 130 lines, the redeemed.csv has 970 lines. I renamed and moved the errored.csv to a different folder since I wanted to retry keys that did not work (typically because a dependent key got tried before the main key).
So, 1100 keys should have been filtered?
I got the following output that it filtered 1595 from previous runs.
Where from?
Also it never seems to do anything with the 1 revealed key it did not filter. I also actually have 3 unrevealed keys in my library it seems and one key where the HumbleBundle does not even offer a Reveal button (because the Beta has now ended).

I also see that the line
steam_keys = [key for key in steam_keys if key["gamekey"] not in filtered_keys]
does not actually look for the key things can be redeemed on steam with (redeemed_key_val).
The problem is value of "gamekey" is not unique it seems. I have various games that share that gamekey if they were part of the same bundle.
e.g. Frostpunk was in the February 2020 Humble Choice, so was NIght Call, they have distinct keys to be redeemed on Steam (redeemed_key_val) but share gamekey.

For some reason it does not seem to retry the errored-out codes from earlier runs. For the keys that offer "Reveal your steam key" those keys are currently exceeded btw.
image

=FailSpy's Humble Bundle Helper!=-

Filtered 1595 keys from previous runs
2 Steam keys total -- 1 revealed, 1 unrevealed
Would you like to redeem on Humble as-yet un-revealed Steam keys? (Revealing keys removes your ability to generate gift links for them) [y/n] n
Successfully signed in on Steam.
Getting your owned content to avoid attempting to register keys already owned...
Filtered out game keys that you already own on Steam; 0 keys unowned.
Press ENTER to close terminal

Now if I change the line
to
steam_keys = [key for key in steam_keys if key["redeemed_key_val"] not in filtered_keys]
I get something that makes more sense at least at first glance.

-=FailSpy's Humble Bundle Helper!=-

1597 Steam keys total -- 1592 revealed, 5 unrevealed
Would you like to redeem on Humble as-yet un-revealed Steam keys? (Revealing keys removes your ability to generate gift links for them) [y/n] n
Successfully signed in on Steam.
Getting your owned content to avoid attempting to register keys already owned...
Filtered out game keys that you already own on Steam; 114 keys unowned.
Inside skipped.txt is a list of 318 games that we think you already own, but aren't completely sure
Feel free to REMOVE from that list any games that you would like to try anyways, and when done press Enter to confirm.

Crash on start

Crash on start:
It looks like the dependencies install fine, but just a moment after the "Humble Email:" prompt appears, the log messages show up and freeze up the entire command prompt. Can't get it to respond again once this crashes.

-=FailSpy's Humble Bundle Helper!=-

Humble Email: [92460:110288:0729/141436.460:ERROR:device_event_log_impl.cc(222)] [14:14:36.460] USB: usb_service_win.cc:72 SetupDiGetDeviceProperty({{A45C254E-DF1C-4EFD-8020-67D146A850E0}, 30}) failed: Element not found. (0x490)
[92460:110288:0729/141436.463:ERROR:device_event_log_impl.cc(222)] [14:14:36.463] USB: usb_service_win.cc:415 Could not read device interface GUIDs: The system cannot find the file specified. (0x2)

Thanks!

Just wanted to say thanks for open sourcing this. 👍 😄

Script exits when Cloudflare blocks too many attempts

Script exits without recovering or retrying when Cloudflare blocks too many requests... see copy/paste of error below (I edit my IP address and the Cloudflare ID in the response).

There have been too many recent activation attempts from this account or Internet address. Please wait and try your product code again later.
Redeemed Yuppie Psycho to go away (takes an hour after first key insert)
Owlboy

<title>Access denied | www.humblebundle.com used Cloudflare to restrict access</title> <script defer src="https://api.radar.cloudflare.com/beacon.js"></script>

Error 1020

Ray ID: 5c53d3c3cc90f376 • 2021-12-31 13:24:16 UTC

Access denied

  <section class="w-240 lg:w-full mx-auto mb-8 lg:px-8">
      <div id="what-happened-section" class="w-1/2 md:w-full">
        <h2 class="text-3xl leading-tight font-normal mb-4 text-black-dark antialiased" data-translate="what_happened">What happened?</h2>
        <p>This website is using a security service to protect itself from online attacks.</p>

      </div>


  </section>

  <div class="cf-error-footer cf-wrapper w-240 lg:w-full py-10 sm:py-4 sm:px-8 mx-auto text-center sm:text-left border-solid border-0 border-t border-gray-300">

Cloudflare Ray ID: 6c63d3c3cc90f375 Your IP: 123.123.123.123 Performance & security by Cloudflare

</div><!-- /#cf-error-details -->
<script type="text/javascript"> window._cf_translation = {}; </script>

Press ENTER to close terminal

Stopped working recently

Maybe an issue with chromedriver, maybe humble updated their interface.

Error log:

Traceback (most recent call last):
  File "/home/jaromiru/Documents/wrk/humble-steam-key-redeemer/humblesteamkeysredeemer.py", line 907, in <module>
    humble_login(driver)
  File "/home/jaromiru/Documents/wrk/humble-steam-key-redeemer/humblesteamkeysredeemer.py", line 276, in humble_login
    auth,login_json = do_login(driver,payload)
  File "/home/jaromiru/Documents/wrk/humble-steam-key-redeemer/humblesteamkeysredeemer.py", line 246, in do_login
    auth,login_json = perform_post(driver,HUMBLE_LOGIN_API,payload)
  File "/home/jaromiru/Documents/wrk/humble-steam-key-redeemer/humblesteamkeysredeemer.py", line 131, in perform_post
    return driver.execute_async_script(fetch_cmd.format(formData=json_payload,url=url,csrf=csrf))
  File "/home/jaromiru/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 427, in execute_async_script
    return self.execute(command, {"script": script, "args": converted_args})["value"]
  File "/home/jaromiru/.local/lib/python3.10/site-packages/selenium/webdriver/remote/webdriver.py", line 348, in execute
    self.error_handler.check_response(response)
  File "/home/jaromiru/.local/lib/python3.10/site-packages/selenium/webdriver/remote/errorhandler.py", line 229, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.TimeoutException: Message: script timeout
  (Session info: chrome=120.0.6099.129)
Stacktrace:
#0 0x55e0a5fa9f83 <unknown>
#1 0x55e0a5c62b2b <unknown>
#2 0x55e0a5cfc508 <unknown>
#3 0x55e0a5cdc0b2 <unknown>
#4 0x55e0a5cfb006 <unknown>
#5 0x55e0a5cdbe53 <unknown>
#6 0x55e0a5ca3dd4 <unknown>
#7 0x55e0a5ca51de <unknown>
#8 0x55e0a5f6e531 <unknown>
#9 0x55e0a5f72455 <unknown>
#10 0x55e0a5f5af55 <unknown>
#11 0x55e0a5f730ef <unknown>
#12 0x55e0a5f3e99f <unknown>
#13 0x55e0a5f97008 <unknown>
#14 0x55e0a5f971d7 <unknown>
#15 0x55e0a5fa9124 <unknown>
#16 0x7f8b51894ac3 <unknown>

Unable to run python file on Mac OSX

I don't really do this sort of programming work, so sorry if I'm doing something wrong here,,,
I installed all the dependencies, made sure python was up to date, all that jazz.
But when I try to run the 'humblesteamkeysredeemer.py' file, it halts at the first line, saying there's no requests module to import.

Email addresses with modifier break script

I use a humble account with a '+' modifier, this breaks the script with the following error:

Traceback (most recent call last):
  File "E:\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 907, in <module>
    humble_login(driver)
  File "E:\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 263, in humble_login
    username = input("Humble Email: ")
               ^^^^^^^^^^^^^^^^^^^^^^^
EOFError: EOF when reading a line

Probably should sanitize the string

Additional information:

Traceback (most recent call last):
  File "E:\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 916, in <module>
    export_mode(driver,order_details)
  File "E:\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 752, in export_mode
    best_match = match_ownership(owned_app_details,tpk)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: match_ownership() missing 1 required positional argument: 'filter_live'

JSONDecodeError (possibly issue with lack of handling when receiving invalid response)

Script exits when encountering error JSONDecodeError. It is redeeming some keys but then errors out after a time. Possibly not interacting well with invalid responses (throttling/denial-of-service protection/firewall by HumbleBundle or Steam?)

Traceback (most recent call last):
File "D:\Dev\Python\Scripts\SteamActivator\humblesteamkeysredeemer.py", line 800, in
redeem_steam_keys(humble_session, revealed_keys)
File "D:\Dev\Python\Scripts\SteamActivator\humblesteamkeysredeemer.py", line 457, in redeem_steam_keys
owned_app_details = get_owned_apps(session)
File "D:\Dev\Python\Scripts\SteamActivator\humblesteamkeysredeemer.py", line 419, in get_owned_apps
owned_content = steam_session.get(STEAM_USERDATA_API).json()
File "C:\Users\andre\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\andre\AppData\Local\Programs\Python\Python39\lib\json_init_.py", line 335, in loads
raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)",
json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)
Traceback (most recent call last):
File "D:\Dev\Python\Scripts\SteamActivator\humblesteamkeysredeemer.py", line 800, in
redeem_steam_keys(humble_session, revealed_keys)
File "D:\Dev\Python\Scripts\SteamActivator\humblesteamkeysredeemer.py", line 511, in redeem_steam_keys
code = _redeem_steam(session, key["redeemed_key_val"])
File "D:\Dev\Python\Scripts\SteamActivator\humblesteamkeysredeemer.py", line 280, in redeem_steam
blob = r.json()
File "C:\Users\andre\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "C:\Users\andre\AppData\Local\Programs\Python\Python39\lib\json_init
.py", line 335, in loads
raise JSONDecodeError("Unexpected UTF-8 BOM (decode using utf-8-sig)",
json.decoder.JSONDecodeError: Unexpected UTF-8 BOM (decode using utf-8-sig): line 1 column 1 (char 0)

Question: Redeeming owned keys

The description says that the program pulls all keys from Humble, then checks to see what the user already owns on Steam.
Can it not check first before pulling codes that can't be activated?
I like to keep my duplicates in Humble for later, in case I find someone who wants a key. If they're all redeemed at once, that becomes difficult.
Thanks

During redemption, program exits

Traceback (most recent call last):
  File "C:\Users\Cody\Desktop\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 574, in <module>
    redeem_steam_keys(humble_session, revealed_keys)
  File "C:\Users\Cody\Desktop\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 396, in redeem_steam_keys
    write_key(9,key["human_name"])
  File "C:\Users\Cody\Desktop\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 274, in write_key
    key["human_name"] = key["human_name"].replace(",", ".")
TypeError: string indices must be integers

I'm back again! The program successfully added a few games to my Steam account but then produced this error and stopped running.

crash after login info

File "C:\Users\user\Desktop\New folder\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 759, in
humble_login(humble_session)
File "C:\Users\user\Desktop\New folder\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 158, in humble_login
login_json = r.json()
File "C:\Users\user\AppData\Roaming\Python\Python310\site-packages\httpx_models.py", line 1517, in json
return jsonlib.loads(self.text, **kwargs)
File "C:\Program Files\Python310\lib\json_init_.py", line 346, in loads
return _default_decoder.decode(s)
File "C:\Program Files\Python310\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "C:\Program Files\Python310\lib\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)

Program exits after asking about skipped.txt contents

Traceback (most recent call last):
  File "C:\Users\Cody\Desktop\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 571, in <module>
    redeem_steam_keys(humble_session, steam_keys if try_already_revealed else unrevealed_keys)
  File "C:\Users\Cody\Desktop\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 409, in redeem_steam_keys
    if not valid_steam_key(key["redeemed_key_val"]):
  File "C:\Users\Cody\Desktop\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 59, in valid_steam_key
    and all([len(part) == 5])
NameError: name 'part' is not defined

This happens when I'm asked about the contents of the skipped.txt file. I do not make changes to the file and hit enter, then the program exits.

Windows 10 20H2
Python 3.9.2

Redeemer steam issues

Been trying to use the redeemer and i got the humble part to work. I'm having issues with it checking my keys against steam data to see what i already have redeemed.

After i type in my steam password, at first it would ask me for my 2FA code and then "press enter to close console".

I tried a fix i saw posted and now it does not even ask for my 2FA code and goes to "press enter to close console"

Fatal error when redeeming keys

Now I'm getting this when trying to auto-redeem keys:

Traceback (most recent call last):
File "/home/metafarion/Downloads/humble-steam-key-redeemer-main/humblesteamkeysredeemer.py", line 925, in
redeem_steam_keys(humble_session, steam_keys if try_already_revealed else unrevealed_keys)
^^^^^^^^^^^^^^
NameError: name 'humble_session' is not defined

This is after saying Yes redeem un-revealed keys and Yes attempt to redeem already-revealed keys.

Game depends on base game to be installed

One issue that I've ran into a few times, and could affect the redeeming, is that it tries to redeem (a number of) product codes without doing the base code first and I assume creates a lot of failed attempts. I can give some more information later but would be nice to handle this gracefully.

Wrong steam app ID from HumbleBundle

I noticed that sometimes the order data gathered from HumbleBundle has the wrong steam_app_id. I don't think it's a problem with the script but rather with the data they have at HumbleBundle.
It's not a big issue only that sometimes a new key is seen as already owned and will not be redeemed.

Here are some examples.

steam_app_id	human_name
518060		The Swords of Ditto: Mormo's Curse
518060		Chess Ultra
629090		WARSAW
629090		Horace
978520		Legend of Keepers
978520		Banners of Ruin
1004490		Tools Up!
1004490		Orwell: Ignorance is Strength
1104660		Niche - a genetics survival game
1104660		MO:Astray

Maybe we can add a check for duplicates and see if the names match or something similar to how it's done when the ID is missing.
Thought I just throw that up here maybe someone has a better solution.

Unable to get past login prompts

After installing the requirements and running the .bat I am prompted to enter my email/pass and then told to press enter to close the terminal window. Below is what is in the error log.

Note I am running this on windows and I have python 3.9.0.

Traceback (most recent call last):
  File "C:\Users\ellio\Desktop\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 738, in <module>
    humble_login(humble_session)
  File "C:\Users\ellio\Desktop\humble-steam-key-redeemer-main\humblesteamkeysredeemer.py", line 146, in humble_login
    login_json = r.json()
  File "C:\Python39\lib\site-packages\requests\models.py", line 900, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\Python39\lib\json\__init__.py", line 346, in loads
    return _default_decoder.decode(s)
  File "C:\Python39\lib\json\decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Python39\lib\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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.