Skip to main content

Automatically claim free games from itch.io

Project description

Automatically claim free games from itch.io

Install

pip install ItchClaim

Usage

itchclaim --login <username> claim

This command logs in the user (asks for password if it's ran for the first time), refreshes the list of currently free games, and start claiming the unowned ones.

Docker

docker run --rm -v "<path-to-user-session-directory>:/data" ghcr.io/smart123s/itchclaim --login <username> claim

Advanced Usage

Logging in (via flags)

If you don't have access to an interactive shell, you can provide you password via flags too.

itchclaim --login <username> --password <password> --totp <2FA code or secret>

Refresh Library

itchclaim --login <username> refresh_library

Allows you to refresh the locally stored list of owned games. Useful if you have claimed/purchased games since you have started using the script.

Refresh sale cache

Download cached sales from CI (recommended)

itchclaim refresh_from_remote_cache [--url <url>]

ItchClaim collects new sales from itch.io every 6 hours and publishes them on GitHub. Using this method, sales don't need to be scraped by every user, greatly reducing the load on itch.io generated by the script. Also removes expired sales from disk. This command is automatically executed by the claim command.

Download links

itchclaim [--login <username>] download_urls <game_url>

Generate a list of uploaded files and their download URLs for a game. These links have an expiration date. If the game doesn't require claiming, this command can be run without logging in.

CI Commands

Note: These commands were created for use on the CI, and are not recommended for general users.

Manually collect sales from itch.io

itchclaim refresh_sale_cache --dir web/data/

Request details about every single itch.io, and save the $0 ones to the disk. The initial run can take 12+ hours.

Parameters

  • dir: Output directory

Generate static website

itchclaim generate_web --dir web/data/ --web_dir web/

Generates a static HTML file containing a table of all the sales cached on the disk. This command was created for use on the CI, and is not recommended for general users.

Parameters

  • dir: Location of the data collected about games, as generated by the refresh_sale_cache command
  • web_dir: The output directory

FAQ

Is this legal?

This tools is not affiliated with itch.io. Using it may not be allowed, and may result in your account getting suspended or banned. Use at your own risk.

Can itch.io detect that I'm using this tool?

Yes. We explicitly let itch.io know that use the the requests were sent by this tool, using the user-agent header. Itch.io doesn't block using non-browser user agents (like some big corporations do), so I think that they deserve to know how their services are being used. If they want to block ItchClaim, blocking this user-agent makes it simple for them. This way, they won't have to implement additional anti-bot technologies, which would make both our and itch.io's life worse.

Why sales are not downloaded directly from itch.io?

The initial plan was to parse https://itch.io/games/on-sale on each run (it was even implemented in here), however, it turns out that only a handful of sales are listed there. Luckily for us, details about every sale are published at https://itch.io/s/<id>, where id is a sequentially incremented number. However, downloading data about every single sale published on itch.io generates a lot of load on their servers. To easen the load generated on itch.io by this tool, I've decide to do this scraping only once, on a remote server, and make the data publicly available.

Can ItchClaim developers see who has access the sale data?

No, every file on the website is hosted by GitHub via their Pages service, and no data is made available to the developers.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ItchClaim-1.3.4.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ItchClaim-1.3.4-py3-none-any.whl (21.7 kB view details)

Uploaded Python 3

File details

Details for the file ItchClaim-1.3.4.tar.gz.

File metadata

  • Download URL: ItchClaim-1.3.4.tar.gz
  • Upload date:
  • Size: 15.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for ItchClaim-1.3.4.tar.gz
Algorithm Hash digest
SHA256 36bfce7e9d91633d162626915adeaf8117d4c8e3161ddbecc2cd37f4de6d857c
MD5 76169f7e71dbd2993ec3254113fac93e
BLAKE2b-256 40102c01b072f15b9c7e74ca0239ac46e64b948b5ed09c8046ab4e36db3bf45d

See more details on using hashes here.

File details

Details for the file ItchClaim-1.3.4-py3-none-any.whl.

File metadata

  • Download URL: ItchClaim-1.3.4-py3-none-any.whl
  • Upload date:
  • Size: 21.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.0

File hashes

Hashes for ItchClaim-1.3.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9677acdbe1c26d505e4a8ef25b9bf47d41f98fc62d816cf8793111b1086bb831
MD5 c130df06e54f0a3adbbe3f8ecbd2ff8a
BLAKE2b-256 d4baf09715d4f2a12049310561709f8da052b068a86059b80b8b33c0325b9f3d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page