Skip to main content

Build status codecov PyPI PyPI - Python Version Code style: black

twitch-game-notify

This is a Twitch notifier which notifies you when your favourite steamers stream your favourite categories. Any flavour of unix that supports GTK3 should work with this.

With normal settings, this will send notifications to your existing notification handler when a streamer is streaming categories you've specified. There's also a tray icon so you can easily quit the application.

Installation

There are a few dependencies needed for this. I'll write commands to install the dependencies for Ubuntu; however, these packages are common, so translating this to whatever package manager you use should be fairly easy.

To get the dependencies needed for D-Bus notifications and for displaying an icon in the system tray, run

sudo apt install libdbus-1-dev libdbus-glib-1-dev \
                 libcairo2-dev libgirepository1.0-dev

If you want to install twitch-game-notify globally on your machine (you could also run this from the from source code directly from run_twitchgamenotify.py), install it using pip with or without root as in

sudo pip3 install twitch-game-notify

Running the above command with root isn't strictly necessary, but it'll put twitch-game-notify in your $PATH, which is nice.

Configuration

Configuration files something look like the following:

# Twitch API authorization - see https://dev.twitch.tv/docs/api/
twitch-api-client-id: "p0gch4mp101fy451do9uod1s1x9i4a"
twitch-api-client-secret: "itqb0thqi5cek18ae6ekm7pbqvh63k"

streamers:
  "distortion2":
    include:
      - "Dark Souls" # notify me only when Distortion2 plays Dark Souls
  "outerheaven":
    include:
      - "*"        # notify me when OuterHeaven streams any category
    exclude:
      - "Metal Gear Solid V: The Phantom Pain"    # except for when he's playing MGSV
  "otzdarva":
    include:
      - "*"        # notify me when Otzdarva streams any category
    exclude:
      - "21779"    # except for League of Legends

Here you need to put in your authentication credentials, and specify what streamers you care about and what categories they stream that you care about (or don't care about). Note that you can specify categories using either their names as they appear on Twitch or by their internal IDs—either is fine. (Note that internal category IDs can be found by querying Twitch's API.)

Setting up a configuration file

twitch-game-notify looks for a configuration file at two paths:

  1. $PROJECT_ROOT/config.yaml
  2. $XDG_CONFIG_HOME/twitch-game-notify/config.yaml

where $PROJECT_ROOT is the base of the twitch-game-notify project (which you generally only want to use if you're running from source), and $XDG_CONFIG_HOME defaults to $HOME/.config, if you don't have it defined.

To get started, either copy the example configuration file config.yaml.example to one of the above locations (making sure to rename it to config.yaml) or run

twitch-game-notify --print-config

which prints the example config file to the terminal, which you can redirect to a file.

Getting a Twitch API client ID and client secret

To get a Twitch client ID and client secret, you need to either create or link an existing Twitch account with Twitch's dev portal. Up to date instructions for obtaining a client ID and client secret can be found at dev.twitch.tv/docs/authentication.

Usage

Run twitch-game-notify with

twitch-game-notify

or directly with run_twitchgamenotify.py:

./run_twitchgamenotify.py

For a list of everything you can do with twitch-game-notify, run

twitch-game-notify --help

Metadata

Release files for twitch-game-notify 0.3.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for twitch-game-notify 0.3.4
File Size Uploaded Provenance
twitch-game-notify-0.3.4.tar.gz 12.7 kB Without provenance Details

Release files / twitch-game-notify-0.3.4.tar.gz

Download URL twitch-game-notify-0.3.4.tar.gz
Size 12.7 kB
Tags Source
SHA-256 checksum
How to use checksums
20cf5233068b702aac77b38a06b89916fbcf3715acebf3dd0c4ef8008b664919
BLAKE2b-256 checksum
How to use checksums
03557f4e3d5470d0fbd1c33ae242aef7b4ed73df58815814232dcf62ee8a42d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.0.1 pkginfo/1.4.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.7

Security for twitch-game-notify 0.3.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page