No description
  • Python 64.7%
  • C# 21.7%
  • HTML 10.1%
  • PowerShell 1.6%
  • Batchfile 0.7%
  • Other 1.2%
Find a file
MaddoScientisto 4083fb4d78
All checks were successful
Publish Twitch Archive Container / publish (push) Successful in 1m29s
Add support for CLIENT-ID, CLIENT-SECRET, and OAUTH-PRIVATE-TOKEN environment variables
Co-authored-by: Copilot <copilot@github.com>
2026-04-25 17:04:44 +02:00
.forgejo/workflows Refactor downloader and file manager for improved rclone integration and add healthcheck and smoke test options 2026-04-25 11:54:03 +02:00
.github/instructions Refactor code structure for improved readability and maintainability 2026-02-21 10:40:12 +01:00
bin Refactor code structure for improved readability and maintainability 2026-02-09 21:56:17 +01:00
config feat: add upload options for pre-merge, merged, and standalone chat videos 2026-02-11 17:44:34 +01:00
docker Add support for CLIENT-ID, CLIENT-SECRET, and OAUTH-PRIVATE-TOKEN environment variables 2026-04-25 17:04:44 +02:00
dotnet Refactor downloader and file manager for improved rclone integration and add healthcheck and smoke test options 2026-04-25 11:54:03 +02:00
modules Implement Docker healthcheck functionality and improve progress message handling 2026-04-25 16:46:20 +02:00
.dockerignore Refactor downloader and file manager for improved rclone integration and add healthcheck and smoke test options 2026-04-25 11:54:03 +02:00
.env.development Refactor downloader and file manager for improved rclone integration and add healthcheck and smoke test options 2026-04-25 11:54:03 +02:00
.env.production Update environment variable loading to support process environment and improve error handling 2026-04-25 16:19:01 +02:00
.gitattributes Added git lfs 2026-02-22 23:12:11 +01:00
.gitignore Refactor downloader and file manager for improved rclone integration and add healthcheck and smoke test options 2026-04-25 11:54:03 +02:00
.python-version Updated script 2026-02-09 21:29:47 +01:00
docker-compose.nvidia.yml Add NVIDIA support for FFmpeg in Docker and enhance chat rendering functionality 2026-04-25 12:28:59 +02:00
docker-compose.override.yml Implement Docker healthcheck functionality and improve progress message handling 2026-04-25 16:46:20 +02:00
docker-compose.yml Add support for CLIENT-ID, CLIENT-SECRET, and OAUTH-PRIVATE-TOKEN environment variables 2026-04-25 17:04:44 +02:00
dockerrebuild.bat Refactor downloader and file manager for improved rclone integration and add healthcheck and smoke test options 2026-04-25 11:54:03 +02:00
dockerstart.bat Add NVIDIA support for FFmpeg in Docker and enhance chat rendering functionality 2026-04-25 12:28:59 +02:00
extra.md Update extra.md 2022-12-16 10:04:56 -05:00
IMPROVEMENTS.md Updated script 2026-02-09 21:29:47 +01:00
install-pyenv-win.ps1 My improvements 2026-02-09 19:01:24 +01:00
loopstart.bat Updated script 2026-02-09 21:29:47 +01:00
only-vod-chat.py Refactor code structure for improved readability and maintainability 2026-02-21 10:40:12 +01:00
README.md Add NVIDIA support for FFmpeg in Docker and enhance chat rendering functionality 2026-04-25 12:28:59 +02:00
requirements.txt Add chat_downloader support with fallback for live chat downloads 2026-02-10 23:42:22 +01:00
run_chat_only.py feat: enhance chat downloading with stream monitoring and improved file paths 2026-02-18 18:11:53 +01:00
run_tests.ps1 Chat monitors stream to end 2026-02-11 13:23:14 +01:00
start.bat Add chat_downloader support with fallback for live chat downloads 2026-02-10 23:42:22 +01:00
start_chat_only.bat feat: add standalone chat downloader script and batch file for testing 2026-02-15 09:38:58 +01:00
startmulti - Copy.bat My improvements 2026-02-09 19:01:24 +01:00
startmulti.bat My improvements 2026-02-09 19:01:24 +01:00
test_twitch_archive.py feat: add upload options for pre-merge, merged, and standalone chat videos 2026-02-11 17:44:34 +01:00
test_twitch_archive_simple.py Implement Docker healthcheck functionality and improve progress message handling 2026-04-25 16:46:20 +02:00
twitch-archive.py Implement Docker healthcheck functionality and improve progress message handling 2026-04-25 16:46:20 +02:00
UpgradePlan.md Refactor code structure for improved readability and maintainability 2026-02-21 10:40:12 +01:00
UpgradePlan2.md Refactor code structure for improved readability and maintainability 2026-02-21 10:40:12 +01:00

Twitch Archive

Inspired by https://github.com/EnterGin/Auto-Stream-Recording-Twitch

Git LFS

This repository stores large media files (recorded video and some binaries). Use Git LFS to manage large objects.

Quick setup (Windows):

  1. Install Git LFS: git lfs install
  2. Ensure .gitattributes is committed (this repo includes one).
  3. If you already have large files tracked by normal Git, migrate them:
git lfs install
git lfs track "*.mp4" "*.mkv" "bin/*"
git add .gitattributes
git add -A
git commit -m "Migrate large files to LFS"
git push origin main

Notes:

  • Git LFS needs server-side support. If using GitHub, enable Git LFS on the remote and ensure you have sufficient bandwidth/storage quota.
  • You can customize tracked patterns in .gitattributes.

Python script to check, download live stream, VOD, chat and upload them to any cloud storage supported by rclone.

Docker

This repository now includes a Python-only container setup for the archiver. The dotnet subapp is not part of this container flow.

Files:

  • docker/python.Dockerfile: production image for the Python archiver
  • docker-compose.yml: deployment-oriented compose file
  • docker-compose.override.yml: local development and testing override
  • .env.production: production container and app environment template
  • .env.development: development container and app environment template
  • dockerstart.bat: Windows helper to run the container like the old batch launcher

Container layout

  • Mount your external archive folder to /app/archive
  • Mount your external config folder to /app/config
  • Put your rclone.conf file at /app/config/rclone.conf on the mounted host path
  • The container exports RCLONE_CONFIG=/app/config/rclone.conf, so rclone will use that file automatically

Production deployment

  1. Edit .env.production with your image name, Twitch credentials, bind paths, and default arguments.
  2. Place your streamer JSON files and rclone.conf in the mounted config folder.
  3. Start the container:
docker compose --env-file .env.production up -d
  1. Follow logs:
docker compose --env-file .env.production logs -f twitch-archive

Development and local testing

The override compose file builds the image locally and mounts the repository for faster iteration.

Start it with:

docker compose --env-file .env.development -f docker-compose.yml -f docker-compose.override.yml up --build

Run a one-off manual test for another streamer:

docker compose --env-file .env.development -f docker-compose.yml -f docker-compose.override.yml run --rm twitch-archive python twitch-archive.py -u hackerling --verbose

Or use the Windows helper:

.\dockerstart.bat vinesauce --verbose

That batch launcher mirrors the old pattern and expands to a compose run command, so you can test any streamer manually.

If the host has the NVIDIA Container Toolkit installed and you want FFmpeg/NVENC inside the container, use the optional NVIDIA override:

.\dockerrebuild.bat
.\dockerstart.bat --nvidia vinesauce --verbose

The image built by .\dockerrebuild.bat already includes the NVIDIA-capable FFmpeg/container toolchain. The optional docker-compose.nvidia.yml layer is only for runtime GPU passthrough: it requests gpus: all and sets NVIDIA_VISIBLE_DEVICES plus NVIDIA_DRIVER_CAPABILITIES=compute,utility,video for the container.

On systems without NVIDIA support, keep using the normal command without --nvidia; the image still builds the same way, it just runs without GPU passthrough.

Healthcheck and smoke tests

  • Container healthcheck command: python twitch-archive.py --healthcheck -u vinesauce
  • Rclone smoke test command: python twitch-archive.py -u vinesauce --rclone-smoke-test

The healthcheck verifies config loading plus streamlink, ffmpeg, TwitchDownloaderCLI, and rclone availability. The smoke test writes a tiny file, uploads it with the configured rclone remote, and prints the live rclone output into the container logs.

FFmpeg 8.0 Enhanced

Now with FFmpeg 8.0+ support featuring hardware acceleration and performance improvements!

Requirements

Getting started

  1. Install Python 3.x
  2. Install Streamlink 5.1.x
  3. If you want to upload to any cloud storage using rclone, configure rclone.
  4. git clone https://github.com/piero0920/Twitch-Archive.git
  5. cd Twitch-Archive
  6. pip install -r requirements.txt
  7. Edit the .env.sample and rename it to .env
CLIENT-ID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
CLIENT-SECRET=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
OAUTH-PRIVATE-TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx # optional to record without ADS or download sub-only VODS
  1. Copy config.sample.json to config.json and edit it with your settings (username, quality, paths, etc.)
  2. run Python twitch-archive.py or for multiple streamers Python twitch-archive.py -u streamer

...