A lightweight, self-hosted Twitch stream recorder for Linux. Automatically monitors selected channels and records live streams using Streamlink, running continuously as a systemd service
- Go 95.9%
- Shell 4.1%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| cmd/twitch-recorder | ||
| docs | ||
| internal | ||
| .env.example | ||
| .gitignore | ||
| go.mod | ||
| LICENSE | ||
| README.md | ||
| setup.sh | ||
| twitch-recorder.conf | ||
| twitch-recorder.service | ||
| users.txt | ||
Twitch Recorder Service
A lightweight script that automatically records Twitch streams (using Streamlink) when users go live.
This script is intended to be a personal and easy-to-use alternative to more general recorders. It can simply be ran as a continous systemd service, and its minimalistic nature means you only need to maintain a simple userlist.
What does it do?
- Monitors a list of usernames
- Periodically polls live status via the API
- Starts recording with streamlink when a user goes live
- Stops automatically when the stream ends
Requirements
- Streamlink in
PATH - Twitch application credentials:
TWITCH_CLIENT_IDTWITCH_CLIENT_SECRET
- FFmpeg in
PATH(optional, only for post-processing) - Go (for building from source)
Create Twitch credentials at dev.twitch.tv/console. A dummy redirect URL such as http://localhost/ is fine for this use case.
Setup
Quick setup (recommended):
./setup.sh
# Or to run it with the recommended values set:
# ./setup.sh --dir /opt/twitch-recorder --env-file /etc/twitch-recorder.env --force
If you want to later update the script, simply pulling from source and running the setup script again (allowing a restart) should suffice.
For full setup details (including manual setup), see docs/SETUP.md.
Configuration
Configuration is read from twitch-recorder.conf.
- docs/CONFIG.md for options, including optional post-processing via
ffmpeg. - docs/TEMPLATES.md for supported template tokens.
- docs/WEBHOOK.md for webhook payloads, delivery behavior, and verification.
- docs/TEST.md for test and verification commands.
License
MIT License