Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/woctezuma/add-free-licenses

Automatically add free licenses on Steam.
https://github.com/woctezuma/add-free-licenses

addlicense archisteamfarm asf asf-api asf-ipc free-games free-packages freegames license-activation steam steam-api steam-data steam-farm steam-games steam-store steam-tools steam-web steamctl steamdb steamdb-freegames

Last synced: 2 months ago
JSON representation

Automatically add free licenses on Steam.

Awesome Lists containing this project

README

        

> [!Note]
> Consider switching to the ASF plugin [**`FreePackages`**][asf-free-citrinate] developped by **Citrinate**!

# Add Free Licenses

This repository contains Python code to automatically [add free licenses][steamdb-free-packages] on Steam.

![Illustration cover][img-cover]

## Requirements

- Install the latest version of [Python 3.X][python-download-url].
- Install the required packages:

```bash
pip install -r requirements.txt
```

- Install [ArchiSteamFarm][github-ASF] (ASF).
- Make sure that [IPC][wiki-ASF-IPC] is toggled ON. This is the default value.

## Data

To retrieve a list of appIDs which are already tied to your account,
here are a few methods.

1. /dynamicstore/userdata

The variable `rgOwnedApps` in the JSON data returned by
the [`/dynamicstore/userdata`][steam-userdata-endpoint] endpoint is
a large yet non-exhaustive list of appIDs owned by your account.
More information can be found on [this unofficial wiki][steam-userdata-wiki].

**NB:** you have to be **authenticated** on Steam in your web-browser in order to use this method.

---

2. steamctl apps list

[`steamctl`][steamctl-github] is a Python package [available on PyPI][steamctl-pypi].

It allows to print to the terminal
the exhaustive list of appIDs owned by your account.

```bash
pip install pipx
pipx install steamctl
```

```bash
steamctl apps list
```

The output should be formatted as follows: `{appID} {appName}`.

```
[...]
1667640 Imagined Leviathans Demo
1667710 Gladihaters Demo
1667730 Forgotten Journey
1667770 Samurai Shampoo
1667810 Riding Seas Demo
[...]
```

**NB:** you have to be **authenticated** on Steam with `steamctl` in order to use this method.

---

3. /games/?tab=all

**Caveat:** I recommend **not** to use this procedure
because the list of appIDs is not **exhaustive** ,
e.g. demos are missing.

A procedure built into the script
at [`Luois45`][luois45-gpl-repository]
parses a list of appIDs from
the [`/games/?tab=all`][steam-tab-all] web-page.

**NB:** the "game details" part of your Steam profile have to be public in order to use this method.

---

4. /account/licenses/

**Caveat:** I recommend **not** to use this procedure
because this retrieves **subIDs** instead of appIDs.

[Instructions][steam-account-licenses-instructions]
at [`Luois45`][luois45-gpl-repository]
suggest to execute JavaScript code in your browser
on the [`/account/licenses/`][steam-account-licenses] web-page.

**NB:** you have to be **authenticated** on Steam in your web-browser in order to use this method.

---

Because it is the only method which returns an **exhaustive** list, the recommended method is:

```bash
pip install pipx
pipx install git+https://github.com/woctezuma/steamctl.git@67-fix-charmap
steamctl apps list > data/steamctl_output.txt
```

## Usage

```bash
python add_free_licenses.py
```

## References

- A [Github issue][luois45-appid-issue] which describes some attempts to retrieve owned appIDs,
- [`Luois45/claim-free-steam-packages`][luois45-gpl-repository]: a tracker of free licenses on Steam,
- [`woctezuma/steam-next-fest`][steam-next-fest]: a previous project of mine which makes use of ASF IPC,
- A [Steam guide][steam-guide-no-cost] listing all of the free licenses which increment the library count.

[steamdb-free-packages]:
[img-cover]:
[python-download-url]:
[github-ASF]:
[asf-free-citrinate]:
[wiki-ASF-IPC]:
[steam-userdata-endpoint]:
[steam-userdata-wiki]:
[steamctl-github]:
[steamctl-pypi]:
[steam-tab-all]:
[steam-account-licenses-instructions]:
[steam-account-licenses]:
[luois45-appid-issue]:
[luois45-gpl-repository]:
[steam-next-fest]:
[steam-guide-no-cost]: