Skip to content

Record Twitch.tv shows on Windows, Ubuntu 18.04+ (or similar)

Notifications You must be signed in to change notification settings

sogladev/record-twitch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

record-critrole

Record Twitch.tv shows on Windows, Ubuntu 18.04+ (or similar)

In essence, this is a CLI wrapper to call streamlink. As of writing this, it offers more reliable recordings by auto-retrying if connection is lost or the stream disconnects.

Allows you to set a duration (optional) and a time until recording (optional).

There are files with .py for both windows/linux, a linux shell .sh script + cronjob and a windows batch .bat + scheduled task.

Initially created to record Critical Role. One feature is to parse the website http://wheniscriticalrole.com to see when the show airs.

record.py

❯ python3 record.py --help
usage: record.py [-h] [-u URL] [-o OUT_DIR] [-s SLEEP_TIME] [-n] [--offset OFFSET]

Process arguments

options:
  -h, --help            show this help message and exit
  -u URL, --url URL     url to twitch channel
  -o OUT_DIR, --out OUT_DIR
                        directory where to save video
  -s SLEEP_TIME, --sleep SLEEP_TIME
                        time to sleep in seconds before recording starts
  -n, --now             start recording right now
  --offset OFFSET       amount of minutes to start recording before stream is online. Default is 5

TODO

  • Package with PyInstall. Has support for python3+, Windows and Linux, one file executable
  • Rewriting below scripts into python only
  • Read time until critical role from website
  • Update cronjob to launch python script in virtualenv

Requirements

Streamlink

(optional) Selenium with Firefox driver to parse wheniscriticalrole.com

(example) python3 record.py -u twitch.tv/criticalrole -w 3600 -o outdir

Omitting `-n` or `-w` option defaults to using Selenium to parse the above
mentioned website and gets the most accurate time automatically. You will need
Selenium and a Firefox driver available in your Path

About

Record Twitch.tv shows on Windows, Ubuntu 18.04+ (or similar)

Resources

Stars

Watchers

Forks

Packages

No packages published