Python script to extract all Humble Bundle keys and redeem them on Steam automagically.

Overview

humble-steam-key-redeemer

Python script to extract all Humble keys and redeem them on Steam automagically.

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.

It will extract all keys available for Steam from Humble, and check if any of the keys are already owned by the logged-in Steam user. Of those that aren't, attempt to redeem them on Steam. This is done because Steam has some pretty harsh rate limiting on key redemption -- 50 keys/hr, or 10 failed keys/hr, whichever comes first.

Notes

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

Dependencies

Install the required dependencies with

pip install -r requirements.txt

If you want to install python-Levenshtein:

pip install python-Levenshtein

Tested with Python 3.7.9

Comments
  • Monthly Choices

    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?

    enhancement 
    opened by OpenSauce 14
  • Error while redeeming

    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'

    opened by upperdarkness 4
  • During redemption, program exits

    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.

    opened by codywarmbo 4
  • Potential better owned license finding

    Potential better owned license finding

    https://store.steampowered.com/account/licenses/

    This webpage is fairly trivial to scrape given its tabled format, and includes proper titles of package products added to the user's library via 'Retail keys'.

    This may be a useful additional string set to fuzzy string match Humble game titles against, as there are issues with getting package details out of Steam.

    opened by FailSpy 2
  • Gitignore update, getpass

    Gitignore update, getpass

    Last little updates from me, thanks for the useful script and allowing me to contribute!

    Just added the generated files to the .gitignore Used the getpass.getpass to get the input for the password

    Hope that's okay, cheers guys!

    opened by OpenSauce 2
  • Please clarify that the script is Windows-only

    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.

    opened by 07416 1
  • Improve compatibility with python 2 installed

    Improve compatibility with python 2 installed

    These changes to batch file should force script to run under Python3 even if python command itself would run python 2. This should make batch more failsafe under variety of environments

    opened by LofhJann 1
  • Added a clear screen function

    Added a clear screen function

    Added a clear screen function, helps just to keep the console a bit more tidy as you switch between the months/options etc.

    Maybe not to your liking, and could be fleshed out a bit if desired! Hope it's okay

    opened by OpenSauce 1
  • Program exits after asking about skipped.txt contents

    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

    opened by codywarmbo 1
  • Dealing with Repeats

    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.

    opened by FailSpy 1
  • Key Dump feature

    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).

    enhancement 
    opened by FailSpy 1
  • Suggest to loosen the dependency on fuzzywuzzy

    Suggest to loosen the dependency on fuzzywuzzy

    Hi, your project humble-steam-key-redeemer(commit id: 1d1de43e028de1608d32e7b0e77f85a3ae71574c) 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?

    opened by Agnes-U 0
  • crash after login info

    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)

    opened by soad6 1
  • Unable to get past login prompts

    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)
    
    opened by Milzstream 28
  • More key filtering issues...

    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.

    opened by MSDNAndi 0
  • add option to filter already owned games interactively.

    add option to filter already owned games interactively.

    I have a bunch of games to redeem, and a largish steam library. The fuzzy matching ends up with many false positives/negatives. I would like and option to see a list of the fuzzy matches, and answer y/n if I already own the game. If the match is exact, then it should auto accept that I own the game.

    This pull request implements this functionality. Open to feedback, I don't have alot of python experience.

    opened by mcclurej06 0
Owner
null
An simple python script for remove rockstar account for fivem, very useful for cheating or change account for unban from an server, remember change steam account.

This tool is used for be unbanned from servers, u need disconnect the discord, use other steam account and uninstall xbox for be unbanned 100%, it only work for unban in server, not global

MiguDEV 4 Oct 10, 2022
An async python wrapper to interact with the Steam API and its CMs

steam.py A modern, easy to use, and async ready package to interact with the Steam API. Heavily inspired by discord.py and borrowing functionality fro

James Hilton-Balfe 90 Dec 15, 2022
Discord bot to monitor collection of mods on the Steam Workshop and notify on update to selected discord server via Nextcordbot API.

Steam-Workshop-Monitor Discord bot to monitor collection of mods on the Steam Workshop and notify on update to selected Discord channel via Nextcordbo

null 7 Nov 3, 2022
A Discord bot to combat phishing links for Steam trades and Discord gifts.

delink-bot A Discord bot to combat phishing links for Steam trades and Discord gifts. Requirement python3 -m pip install -U discord.py python3 -m pip

hugonun 15 Dec 9, 2022
Zaid Vc Player Allows u to steam Songs/music on vc chat

ᴢᴀɪᴅ ᴠᴄ ᴘʟᴀʏᴇʀ ?? SORRY FOR OUR PROJECTS DELETED BY GITHUB FLAGGED ᴢᴀɪᴅ ᴠᴄ ᴘʟᴀᴇʀ ɪꜱ ᴀ ᴛᴇʟᴇɢʀᴀᴍ ᴘʀᴏᴊᴇᴄᴛ ʙᴀꜱᴇᴅ ᴏɴ ᴘʏʀᴏɢʀᴀᴍ ꜰᴏʀ ᴘʟᴀʏ ᴍᴜꜱɪᴄꜱ ɪɴ ᴠᴄ ᴄʜᴀᴛꜱ..

Zaid 117 Dec 29, 2022
Roaster - this gui app + program bundle roasts.

Roaster - this gui app + program bundle roasts.

Harsh ADV) 1 Jan 4, 2022
A python script fetches all your starred repositories from your GitHub account and clones them to your server so you will never lose important resources

A python script fetches all your starred repositories from your GitHub account and clones them to your server so you will never lose important resources

Ringo Hoffmann 27 Oct 1, 2022
❄️ Don't waste your money paying for new tokens, once you have used your tokens, clean them up and resell them!

TokenCleaner Don't waste your money paying for new tokens, once you have used your tokens, clean them up and resell them! If you have a very large qua

0xVichy 59 Nov 14, 2022
Automation for grabbing keys from a Linux host. Useful during red team exercises to quickly help assess what access to a Linux host can lead to.

keygrabber Automation for grabbing keys from a Linux host. This can be helpful during red team exercises when you gain access to a Linux host and want

Cedric Owens 14 Sep 27, 2022
🐍 Mnemonic code for generating deterministic keys, BIP39

python-mnemonic ?? Mnemonic code for generating deterministic keys, BIP39 Installation To install this library and its dependencies use: pip install m

null 9 Dec 22, 2022
Cedric Owens 16 Sep 27, 2022
Python script that extract data via YouTube Api and manipulates it.

UNLIMITED README for the Unlimited game [Mining game] Explore the docs » View Demo · Report Bug · Request Feature Table of Contents About The Project

Serban Chisca 1 Dec 12, 2021
Simple script to extract useful informations from the combo BloodHound + Neo4j

bloodhound-quickwin Simple script to extract useful informations from the combo BloodHound + Neo4j. Can help to choose a target. Prerequisites python3

null 140 Dec 21, 2022
A simple python script for rclone. Use multiple Google Service Accounts and cycle through them.

About GSAclone GSAclone is a simple python script for rclone, written with the purpose of using multiple Google service accounts on Google Drive and "

Shiro39 6 Feb 25, 2022
SimpleTelegramScraper - A python script scrapes accounts from public groups via Telegram API and saves them in a CSV file

SimpleTelegramScraper - the best scraper on GitHub This simple python script scr

Deniz Shabani 12 Oct 6, 2022
VaccineAlarm is a simple python script that allows user to get notified when their desired vaccine doses are available at vaccine centers near them.

Introduction VaccineAlarm is a simple python script that allows user to get notified when their desired vaccine doses are available at vaccine centers

Ankit Tripathi 5 Nov 26, 2021
Script for downloading Coursera.org videos and naming them.

Coursera Downloader Coursera Downloader Introduction Features Disclaimer Installation instructions Recommended installation method for all Operating S

Coursera Downloader 9k Jan 2, 2023