I was in the search for a twitch stream ripper that would monitor and save streams to my twitch synology folder to watch on plex while I'm unable to watch online.
I could not find an existing image that would respond exactly to my needs so I combined what I could find from few existing projects (see credits here below)
I decided to build it automatically on docker hub to access from my swarm nodes, when I saw many downloads, I decided to document a bit more the project, for my personnal experience and to encourage reusability
Questions, suggestions, requests, reach me out on
I'm also interested with new projects for automation of daily popular tasks, don't hesitate, I'm waiting for new ideas
Added support for optional OAuth token parameter to authenticate Twitch API requests.
Automatic build and deployment pipeline to both ghcr and docker hub. With tag versioning and latest tagging. Remove broken support for oauth twitch token, will soon migrate to new model
Introduced Twitch API integration for improved stream monitoring.
Added support for notification via Telegram, as requested in issue #1.
Refactored the notification system to support multiple platforms, including Slack and Telegram.
Major code refactor for better modularity and readability, including the use of classes for Twitch, Streamlink, and notification management.
Migration to ghcr.io, please adapt your links!
github actions automatic build with kaniko
Adapt for helm deployment
solved bug of env args being ignored #10 thanks to too-many-bees for raising it up.
solved bug of missing loop issue #6 thanks to too-many-bees for raising it up.
major refactoring and improvements to the code, respect standards and best practices
parse title stream and add to filename
added contribution from zerobell-lee to disable ads by authenticating as a twitch user
Move to python 3.11 Various improvements to project, cleanup and dependencies management
Full rework with support of OAuth2 token management Review of helix twitch operation and simplification of the flow
Upgrade python python:3.9.1-alpine3.12
Originally inspired from the work of the people here below. Thanks to those people.
https://github.com/Neolysion/Twitch-Recorder/blob/master/check.py
https://www.junian.net/2017/01/how-to-record-twitch-streams.html
I cleaned up and adapted following my requirements and added a slack integration
All rights are reserved to the original script owners, it has been now mostly reworked from scratch nevertheless will remove code if requested.
Quality is specified within the stream, any twitch quality specified existing for the stream can be defined
Keywords can always be used
Fill in twitch clientid to interact with twitch API and retrieve status of stream from stream list
timer=360
Fill in twitch clientid to interact with twitch API and retrieve status of stream from stream list
clientid=xxxxxxxx
Fill in twitch clientsecret to interact with twitch API and retrieve status of stream from stream list
clientsecret=xxxxxxxx
Fill in slack if you want recod start/stop notification
slackid=xxxxxxxxx
Fill in your OAuth token for Twitch API to authenticate requests. The procedure to collect the OAuth token is described here
oauthtoken=xxxxxxxx
In order to get the personal OAuth token from Twitch's website which identifies your account, open Twitch.tv in your web browser and after a successful login, open the developer tools by pressing F12 or CTRL+SHIFT+I. Then navigate to the "Console" tab or its equivalent of your web browser and execute the following JavaScript snippet, which reads the value of the auth-token cookie, if it exists:
document.cookie.split("; ").find(item=>item.startsWith("auth-token="))?.split("=")[1]
docker run -d --rm \
-v twitch:/download \
-e timer=360 \
-e user=heromarine \
-e quality=best \
-e clientid=XxX \
-e clientsecret=XxX \
-e slackid=XxX \
liofal/streamlink:latest
To run a test service
./docker-compose -f dockerimages/streamlink/docker-compose.yml up -d test
Specify the clientid.env file using the clientid.env.example delivered
you can specify the default for compose here
/download
Warning: The folder does not exist in the container and need te be created as a volume in order to be accessed from outside your container, you should map it if you want to access it