β οΈ Warning: Since Astats updated their robots.txt, the crawler should not be used anymore.
This bot crawls a third party analytics side for Steam called AStats and autonomously joins active steam game key giveaways for selected user profiles. Users get notified about successfully won giveaways within the interface. Already joined giveaway IDs get saved separately for each account for future runs in order to prevent unnecessary double checking of giveaways. The bot simulates human behaviour, including a randomized waiting period (minimum 2 sec) after every action on the website, preventing an increased server load.
The bot runs on Python 3.8 and needs the following modules installed:
β οΈ Warning: This crawler works, but represents a simple solution, which performs unverified HTTPS requests. Use at your own risk.
Before starting the bot for the first time, you have to insert personal identifiers in the config:
- Insert your 17 digit Steam64 ID in "steam_id" for each Steam account
- Insert the Astats cookie ID in "accounts_cookie" for the AStats account, which belongs to the corresponding Steam account
- Insert the Astats PHP session ID in "accounts_phpID" for the AStats account, which belogns to the corresponding Steam account
You can use the batch file(s) to start the bot using Windows Task Scheduler (default: 2 accounts named main/secondary).
- Open up your Steam client and choose
View
, then clickSettings
- Choose
Interface
and check the box that reads,Display Steam URL address when available
- Click OK
- Click on your Steam Profile Name on the top right corner and select
View Profile
Your Steam64 ID will be listed in the URL at the top left (it's the 17 digit number at the end). If you set a custom steam ID (text instead of the number), you can use a service like Steam ID Finder to obtain your Steam64 ID from this custom ID. Use at your own risk.
Firefox:
- Visit AStats in your browser and login to your account.
- Open the browser console: Press the F12 key or Ctrl + Shift + K (on Windows) / β + Option + K (on MacOS).
- Within the console, select
Network
at the top. - While the console is open, visit your AStats profile page (hover over your username at the top right corner and click on
profile
). - Scroll to the top of the middle list and search for a row with host
astats.astats.nl
and fileUser_Info.php?SteamID64=...
, click on it and selectCookies
on the right. - Now you see a list containing the entry
COOKIE_NAME
needed for "accounts_cookie" andPHPSESSID
needed for "accounts_phpID".
Chrome:
COOKIE_NAME
.
- Visit AStats in your browser and login to your account.
- Open the browser console: Press the F12 key or Shift + CTRL + J (on Windows/Linux) / β + Option + J (on MacOS).
- Within the console, select
Network
at the top. - While the console is open, visit your AStats profile page (hover over your username at the top right corner and click on
profile
). - Scroll to the top of the middle list and search for
User_Info.php?SteamID64=...
, click on it and selectCookies
on the right. - Now you see a table containing the row
COOKIE_NAME
needed for "accounts_cookie" andPHPSESSID
needed for "accounts_phpID".
- V1: basic bot (start ID arg, 2 profiles, stopping when last existing giveaway reached)
- V2: advanced bot (start ID by last run, 2 profiles selected by .bat, stopping and saving status in lastID.txt, logger added)
- V3: added Exception Handling (HTTP Status Code, missing internet connection), added session only counter for joined giveaways
- V4: added stats.txt management
- V5: finished debug-mode, added logger notification at the end, fixed bug with deleted giveaways and skipping dead IDs
- V6: fixed bug with GET request failing, added exception handling, added counters/thresholds for exceptions in POST and GET
- V7: fixed logging bugs, improved console display