reeln-cli plugin for Google platform integration (YouTube livestreams, uploads, playlists)
Project description
reeln-plugin-google
A reeln-cli plugin for Google platform integration — YouTube livestreams, uploads, playlists, and comments.
Install
pip install reeln-plugin-google
Or for development:
git clone https://github.com/StreamnDad/reeln-plugin-google
cd reeln-plugin-google
make dev-install
Google Cloud Setup
Before using this plugin, you need a Google Cloud project with OAuth credentials. Follow these steps exactly.
1. Create a GCP Project
- Go to Google Cloud Console
- Click the project dropdown (top-left) → New Project
- Name it (e.g.,
reeln-livestream) and click Create - Select the new project from the dropdown
2. Enable the YouTube Data API v3
- Go to APIs & Services → Library
- Search for YouTube Data API v3
- Click it and press Enable
3. Configure the OAuth Consent Screen
- Go to APIs & Services → OAuth consent screen
- Select External user type → Create
- Fill in:
- App name — anything (e.g.,
reeln) - User support email — your Gmail
- Developer contact email — your Gmail
- App name — anything (e.g.,
- Click Save and Continue
- On the Scopes page, click Add or Remove Scopes and add:
https://www.googleapis.com/auth/youtubehttps://www.googleapis.com/auth/youtube.uploadhttps://www.googleapis.com/auth/youtube.force-ssl
- Click Update → Save and Continue
- On the Test users page, click Add Users and enter your Google email address
- Click Save and Continue → Back to Dashboard
Testing vs Production mode: Your app starts in "Testing" mode with these limitations:
- Only the test users you added can authorize
- OAuth tokens expire every 7 days (you'll need to re-authorize)
- Maximum 100 test users
Once your setup is stable, you can publish to "Production" mode to remove token expiry and the user cap. Production apps requesting sensitive scopes require Google verification, but apps for personal use with limited users typically pass quickly.
4. Create OAuth 2.0 Client ID
- Go to APIs & Services → Credentials
- Click Create Credentials → OAuth client ID
- Application type: Desktop app
- Name it (e.g.,
reeln-desktop) and click Create - Click Download JSON (the download icon)
5. Protect the Secrets File
The downloaded client_secrets.json contains your OAuth client ID and client secret. Treat it like a password.
# Move it somewhere safe outside your repo
mv ~/Downloads/client_secret_*.json ~/.config/reeln/client_secrets.json
# Restrict permissions (macOS/Linux)
chmod 600 ~/.config/reeln/client_secrets.json
Never commit this file to git. It allows anyone to impersonate your application and request access to YouTube accounts.
Plugin Configuration
Add the Google plugin to your reeln config. All capabilities are off by default — enable only what you need:
{
"plugins": {
"enabled": ["google"],
"settings": {
"google": {
"client_secrets_file": "~/.config/reeln/client_secrets.json",
"create_livestream": true,
"manage_playlists": true,
"upload_highlights": true,
"upload_shorts": false,
"privacy_status": "unlisted"
}
}
}
}
Feature Flags
Every capability must be explicitly enabled. Nothing runs unless you set the flag to true.
| Flag | Default | What it does |
|---|---|---|
create_livestream |
false |
Create a YouTube broadcast on reeln game init and write the URL to shared context |
manage_playlists |
false |
Create a per-game playlist on reeln game init; auto-add uploads when combined with upload_highlights |
upload_highlights |
false |
Upload the merged highlights video after reeln highlights merge |
upload_shorts |
false |
Upload Shorts after reeln render short (detected via filter_complex) |
Other Options
| Key | Required | Default | Description |
|---|---|---|---|
client_secrets_file |
Yes | — | Path to GCP OAuth client secrets JSON |
credentials_cache |
No | <data_dir>/google/oauth.json |
OAuth credentials cache path |
privacy_status |
No | unlisted |
Video/livestream privacy: public, unlisted, or private |
category_id |
No | 20 |
YouTube category ID (20 = Gaming) |
tags |
No | [] |
Default video tags |
scopes |
No | [youtube, youtube.upload, youtube.force-ssl] |
OAuth scopes |
First Run
On the first reeln game init, the plugin opens a browser for OAuth consent:
- Sign in with the Google account you added as a test user
- Click Continue (past the "unverified app" warning)
- Grant the requested YouTube permissions
- The browser shows "The authentication flow has completed" — you can close it
Credentials are cached at ~/Library/Application Support/reeln/data/google/oauth.json (macOS) or ~/.local/share/reeln/data/google/oauth.json (Linux). The file is automatically chmod 600'd. Tokens auto-refresh on subsequent runs — you won't see the browser again unless tokens expire or you re-authenticate.
Troubleshooting
"Access blocked" or "Error 403: access_denied" You didn't add your Google email as a test user. Go to OAuth consent screen → Test users and add it.
"Quota exceeded" The YouTube Data API has a daily quota (default 10,000 units). Creating a livestream costs ~1,600 units. If you're hitting limits, check your quota dashboard.
Token expired after 7 days This happens in Testing mode. Either re-run to trigger the browser flow again, or publish your OAuth consent screen to Production mode (see Testing vs Production above).
"redirect_uri_mismatch" Your OAuth client type isn't set to Desktop app. Delete the credential and create a new one with the correct type.
How It Works
The plugin hooks into reeln-cli lifecycle events. Here's the typical game-day flow:
reeln game init
└─ ON_GAME_INIT
├─ create_livestream → YouTube broadcast bound to your OBS stream key
└─ manage_playlists → per-game playlist (livestream auto-added if both enabled)
reeln highlights merge
└─ ON_HIGHLIGHTS_MERGED
└─ upload_highlights → upload merged video; auto-add to playlist if enabled
reeln render short
└─ POST_RENDER (for each short)
└─ upload_shorts → upload as YouTube Short (#Shorts appended to title)
reeln game finish
└─ ON_GAME_FINISH → reset cached state for next game
Shared Context
The plugin writes results to context.shared so sibling plugins (e.g., a Discord notifier) can consume them:
| Key | Value |
|---|---|
shared["livestreams"]["google"] |
Livestream URL (https://youtube.com/live/...) |
shared["playlists"]["google"] |
Playlist ID |
shared["uploads"]["google"]["video_id"] |
Uploaded highlights video ID |
shared["uploads"]["google"]["url"] |
Uploaded highlights URL |
shared["uploads"]["google"]["shorts"] |
List of {"video_id", "url"} for each Short |
LLM Metadata
If an LLM plugin writes metadata to shared["uploads"]["google"] before the upload hooks fire, the plugin uses it instead of auto-generating from game info:
| Key | Used by |
|---|---|
title |
Highlights upload |
description |
Highlights upload |
tags |
Highlights and Shorts upload |
short_title |
Shorts upload |
short_description |
Shorts upload |
Development
make dev-install # uv venv + editable install with dev deps
make test # pytest with 100% coverage
make lint # ruff check
make format # ruff format
make check # lint + mypy + test
License
AGPL-3.0-only
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file reeln_plugin_google-0.6.0.tar.gz.
File metadata
- Download URL: reeln_plugin_google-0.6.0.tar.gz
- Upload date:
- Size: 77.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d51eeb2a7d7ed5aa02a138c6882dc1171c5ce4ce35ad03fa55444b88cda866c
|
|
| MD5 |
afd8c21b85796e4b594ea2b101a21b9a
|
|
| BLAKE2b-256 |
17d11fc0c246a77b3f547d313ca9b8e537f174622ac4b4be4170877b7f2ff21b
|
Provenance
The following attestation bundles were made for reeln_plugin_google-0.6.0.tar.gz:
Publisher:
release.yml on StreamnDad/reeln-plugin-google
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reeln_plugin_google-0.6.0.tar.gz -
Subject digest:
0d51eeb2a7d7ed5aa02a138c6882dc1171c5ce4ce35ad03fa55444b88cda866c - Sigstore transparency entry: 1053979314
- Sigstore integration time:
-
Permalink:
StreamnDad/reeln-plugin-google@1c972ca4b8883a6150efa4b865e02f20d2128241 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/StreamnDad
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1c972ca4b8883a6150efa4b865e02f20d2128241 -
Trigger Event:
push
-
Statement type:
File details
Details for the file reeln_plugin_google-0.6.0-py3-none-any.whl.
File metadata
- Download URL: reeln_plugin_google-0.6.0-py3-none-any.whl
- Upload date:
- Size: 14.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f1c8c81a7e349d6dec826d1a4fdaea35551fc04210b89c96b35f7a15db42715
|
|
| MD5 |
6431588f029260b76b806ed4c32fa4c9
|
|
| BLAKE2b-256 |
870c23c87411692d0d51618cb7e85c308a1ebc695f92a94cd48770b159f39aea
|
Provenance
The following attestation bundles were made for reeln_plugin_google-0.6.0-py3-none-any.whl:
Publisher:
release.yml on StreamnDad/reeln-plugin-google
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
reeln_plugin_google-0.6.0-py3-none-any.whl -
Subject digest:
4f1c8c81a7e349d6dec826d1a4fdaea35551fc04210b89c96b35f7a15db42715 - Sigstore transparency entry: 1053979317
- Sigstore integration time:
-
Permalink:
StreamnDad/reeln-plugin-google@1c972ca4b8883a6150efa4b865e02f20d2128241 -
Branch / Tag:
refs/tags/v0.6.0 - Owner: https://github.com/StreamnDad
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@1c972ca4b8883a6150efa4b865e02f20d2128241 -
Trigger Event:
push
-
Statement type: