- Python 99.1%
- Dockerfile 0.9%
| .dockerignore | ||
| .gitignore | ||
| clips.py | ||
| common_web.py | ||
| Dockerfile | ||
| eprint.py | ||
| main.py | ||
| README.md | ||
| requirements.txt | ||
| settings.py | ||
| videos.py | ||
| vods.py | ||
This is scuffed, and doesn't follow best security practices. Private use only.
I have no plans to publish this to Dockerhub at this time. The repository must be cloned and a Docker image built
An example docker-compose.yml file looks like this
services:
streamer_name_twitchvods:
image: twitchvods:latest # replace with your actual image tag
container_name: streamer_name_twitchvods
restart: unless-stopped
volumes:
- ./streamer_name/data/:/app/data
- ./streamer_name/videos:/app/videos
The initial startup of the container WILL fail. Fields will need to be populated in the settings.toml file within the ./streamer_name/data/ directory
A blank settings.toml will look something like this
[settings]
streamer = "streamer_name"
db_file = "past_videos.db"
gather_clips = true
gather_vods = true
[settings.advanced]
concurrent_vod_fragments = 10
concurrent_clip_fragments = 1
process_vod_sleep_time = 5
process_clip_sleep_time = 3600
clip_scan_period = 1
[credentials]
client_id = "[CLIENT ID HERE]"
authorization = "Bearer [OAuth TOKEN HERE]"
A client id can be generated from https://dev.twitch.tv/
Once a client id and client secret have been generated, you can use a utility such as https://twitchtokengenerator.com/ to generate the appropriate OAuth. If you do choose to go this route, please read the instructions carefully. Especially where it mentions the callback address
Just give it everything. It's insecure, I'm aware, but Twitch keeps modify which scopes can access what and it's a PITA to keep updating it
You can revoke the token from your Twitch account settings at any time, if you feel uncomfortable.
Post-setup
The script, once the requirements are met, can be left to it's own devices. It will routinely check the list of VODs on a channel via the appropriate endpoint and begin to download whatever isn't logged in the database
A video isn't logged to the database unless the download and muxing completes
A video will not be downloaded again if it is in the database