Skip to content
Twitch.TV live broadcast downloader without ffmpeg
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
twlived
.flake8
.gitignore
LICENSE
Pipfile
Pipfile.lock
README.md
launcher.py
logging.yaml
mypy.ini

README.md

twLiveD

Python 3.6+

Required packages: requests (http requests), pydantic (data validation), strictyaml (.yaml creation, validation), m3u8 (parsing HLS), iso8601 (parsing dates), mypy-extensions (extended type hints).

The script and lib are made for recording broadcasts and VODs from Twitch.tv.

Main purpose of default script is downloading live broadcast without mute from currently recording VOD. This allows you to create a good VOD storage with info from Twitch API. The library doesn't use ffmpeg or avconv for downloading because corresponding HLS-playlist are always finalized. Library automatically detects when VOD is completed. Default script (launcher.py) actions:

  1. Checkup when the stream on channel goes live.
  2. Wait until VOD corresponding to the stream appears in Twitch API. (by difference between stream's started_at and VOD's created_at)
  3. Download VOD while its duration is increasing.
  4. Move file to storage.
  5. Go to 1.

Library use latest Twitch API Helix (docs). All broadcasts will be saved *.ts as it presented on twitch.tv. Use ffmpeg after if you want to convert files to another format.

You can enable telegram notifications about start/stop downloading and fatal errors if you want.

Install

Install pipenv if it doen't installed yet.

git clone https://github.com/tausackhn/twlived.git
cd twlived && pipenv --python 3.6 && pipenv install && pipenv shell

Usage

Run launcher.py to generate configuration file template config.yaml.

pipenv run launcher.py

Open config.yml and edit it. Necessary positions are marked with <>. To get client-id you should go https://dev.twitch.tv/dashboard/apps and Register your application.

After all run again to start proccess

pipenv run launcher.py

TODOs

  • Add authorization flow for private VODs.
  • Add support for live broadcasts. (Streamer could turn off recording VODs.)
  • Add support for all type of video.
You can’t perform that action at this time.