Skip to main content
       ______ __    __ ____ ______   __ __ __       ____ ____     __ __ __ ____ __ __   ___ ____  
      |      |  T__T  l    |      T /  |  T  T     /    |    \   /  |  T  l    |  T  | /  _|    \ 
      |      |  |  |  ||  T|      |/  /|  l  |    Y  o  |  D  ) /  /|  l  ||  T|  |  |/  [_|  D  )
      l_j  l_|  |  |  ||  |l_j  l_/  / |  _  |    |     |    / /  / |  _  ||  ||  |  Y    _|    / 
        |  | l  `  '  !|  |  |  |/   \_|  |  |    |  _  |    \/   \_|  |  ||  |l  :  |   [_|    \ 
        |  |  \      / j  l  |  |\     |  |  |    |  |  |  .  \     |  |  |j  l \   /|     |  .  Y
        l__j   \_/\_/ |____j l__j \____l__j__j    l__j__l__j\_j\____l__j__|____j \_/ l_____l__j\_j

A simple, fast, platform-independent tool for downloading Twitch streams, videos and chat logs.
Primarily focused on data preservation, this script can be used to archive an entire Twitch channel at once, or quickly grab the chat from a single VOD.

Table of Contents

Features

  • Archives both video and chat logs.
  • Support for subscriber-only VODs.
  • Downloads as fast as your Internet connection (and storage) can handle.1
  • Real-time archiving of Twitch streams.2
  • Saves both a raw and readable chat log with timestamps and user badges.
  • Supports downloading streams which aren't being archived to Twitch.
  • Error notifications via pushbullet.
  • Supports Twitch Turbo and channel Subscriptions (see Wiki).

Requirements

Installation & Usage

Installation

Twitch Archiver can be installed via pip, setup as a docker container or installed manually.
Make sure to read the usage section after installation.

Installing with PIP

  1. Ensure you meet the above requirements.
  2. Install pip if you do not already have it.
  3. Download and install TA with python -m pip install twitch-archiver.

Installing Manually

  1. Either download the repository via the green code button at the top of the page, or grab the latest release here.
  2. Unpack the archive and enter the directory with cd twitch-archiver.
  3. Install pip if you do not already have it.
  4. Install Python "Build" package with python -m pip install --upgrade build.
  5. Build the package with python -m build, then install with python -m pip install ./dist/twitch-archiver-*.tar.gz.

Installing as a Docker Container

  1. Either download the repository via the green code button at the top of the page, or grab the latest release here.
  2. Unpack the archive and enter the directory with cd twitch-archiver.
  3. Build the container with docker build . -t twitch-archiver.
  4. Run the container with the following command. Configuration can also be provided via environment variables (see wiki).
docker run -it -v {output_dir}:/output -v {config_dir}:/config twitch-archiver -c Brisppy -d "/output" -I "/config"

Usage

Run via your terminal of choice. Use twitch-archiver -h to see help text.

More advanced usage such as watch mode and setting up as a service can be found in the Wiki.

Examples

# twitch-archiver -c Brisppy -d "Z:\\twitch-archive"

Would download video and chat of all VODs from the channel Brisppy to the directory Z:\twitch-archive.

# twitch-archiver -v 1276315849,1275305106 -d "/mnt/twitch-archive" -V -t 10

Would download VODs 1276315849 and 1275305106 to the directory /mnt/twitch-archive, only saving the video using 10 download threads.

Arguments

Below is the output of the --help or -h command. This displays all the available arguments and a brief description of how to use them.

usage: __init__.py [-h] (-c CHANNEL | -v VOD) [-f] [-C] [-V] [-t THREADS]
                   [-q QUALITY] [-d DIRECTORY] [-w] [-l | -a] [-H] [-R]
                   [-L LOG_DIR] [-I CONFIG_DIR] [-W DISCORD_WEBHOOK]
                   [-p PUSHBULLET_KEY] [-o OAUTH_TOKEN] [-Q | -D] [--version]
                   [--show-config]

requires one of:
    -c CHANNEL, --channel CHANNEL / URL
            Channel(s) to download, separated with commas or a file path with `-f | --file` arg.
    -v VOD, --vod VOD_ID / URL
            VOD ID(s) to download, separated with commas or a file path with `-f | --file` arg.

Both the video and chat logs are grabbed if neither are specified.

options:
  -h, --help            show this help message and exit
  -c, --channel CHANNEL
                        A single twitch channel to download, or multiple comma-separated channels.
  -v, --vod, --vod-id VOD
                        A single VOD (e.g 12763849) or many comma-separated IDs (e.g 12763159,12753056).
  -f, --file            Denotes that the value provided to `-c | --channel` or `-v | --vod` is a
                        path to a file. Each line should contain a VOD ID or channel name.
  -C, --chat            Only save chat logs.
  -V, --video           Only save video.
  -t, --threads THREADS
                        Number of video download threads. (default: 20)
  -q, --quality QUALITY
                        Quality to download. Options are 'best', 'worst' or a custom value.
                        Format for custom values is [resolution]p[framerate], (e.g 1080p60, 720p30).
                        (default: best)
  -d, --directory DIRECTORY
                        Directory to store archived VOD(s), use TWO slashes for Windows paths.
                        (default: current directory)
  -w, --watch           Continually check every 10 seconds for new streams/VODs from a specified channel.
  -l, --live-only       Only download streams / VODs which are currently live.
  -a, --archive-only    Don't download streams / VODs which are currently live.
  -H, --highlights      Archive highlights with channel.
  -R, --real-time-archiver
                        Enable real-time stream archiver.
                        Read https://github.com/Brisppy/twitch-archiver/wiki/Wiki#real-time-archiver.
  -L, --log-dir LOG_DIR
                        Output logs to specified directory.
  -I, --config-dir CONFIG_DIR
                        Directory to store configuration and VOD database.
                        (default: C:\Users\HC\.config\twitch-archiver)
  -W, --discord-webhook DISCORD_WEBHOOK
                        Webhook URL for sending messages on error.
  -p, --pushbullet-key PUSHBULLET_KEY
                        Pushbullet key for sending pushes on error. Enabled by supplying key.
  -o, --oauth-token OAUTH_TOKEN
                        Run archiver with provided Twitch OAuth token.
  -Q, --quiet           Disable all log output.
  -D, --debug           Enable debug logs.
  --unsorted            Download VODs in the order they are provided or retrieved (Usually newest > oldest).
                        By default, VODS are downloaded oldest to newest as there is a non-zero chance that
                        old VODs are purged before they can be archived.
  --version             Show version number and exit.
  --show-config         Show saved config and exit.

Disclaimer

This script is intended to be used with the express permission of any involved rights holders, and is not intended to be used to duplicate, download or steal copyrighted content or information. When downloading VODs ensure you have permission from ALL involved rights holders for the content which you are downloading, and if you have the intention to share such content, you should also have explicit permission to do so.

If your intent is to use this script to lazily rip and upload streams to another platform for your own gain without the permission of the streamer, I implore you to stop and think about what you are doing and the possible effect of doing so, and politely request that you find another method with which to steal the work of others.

  1. If you wish to speed up (or slow down) the downloading of VOD pieces, supply the '--threads NUMBER' argument to the script. This changes how many download threads are used to grab the individual video files. With the default of 20, I can max out my gigabit Internet while downloading to an M.2 drive. ↩

  2. There is one caveat with live archiving due to how Twitch presents ads. Ads are not downloaded, BUT while an ad is displayed, the actual stream output is not sent. This can result in missing segments under very rare circumstances, but any missing segments should be filled via a parallel VOD archival function. See the OAuth Token secion of the wiki for how to avoid this. ↩

Metadata

Release files for twitch-archiver 4.4.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for twitch-archiver 4.4.8
File Size Uploaded
twitch_archiver-4.4.8.tar.gz 69.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for twitch-archiver 4.4.8
File Interpreter ABI Platform
twitch_archiver-4.4.8-py3-none-any.whl Python 3 none any Details

Total release size: 151.7 kB

Release files / twitch_archiver-4.4.8.tar.gz

Download URL twitch_archiver-4.4.8.tar.gz
Size 69.8 kB
Tags Source
SHA-256 checksum
How to use checksums
056c8e24fc302e6ae11984a0731b5624fcc320ef66430981a2da7aac82b2c0cc
BLAKE2b-256 checksum
How to use checksums
6c90808e09a99f37382e42d5231ce76f3ba167a1ecae6bb9a5280aad9e7797df
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release files / twitch_archiver-4.4.8-py3-none-any.whl

Download URL twitch_archiver-4.4.8-py3-none-any.whl
Size 81.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f800b7d6b00150156c0f20165f0138d79dac60f17d393768f5b34ff962786c13
BLAKE2b-256 checksum
How to use checksums
8ec61f43d51ec5ec174a4b36321f6814530631f77fc36955a1a5123590f18a28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.25

Release history Release notifications | RSS feed

This release

4.4.8 This release

2 release files

4.4.7

2 release files

4.4.6

2 release files

4.4.5

2 release files

4.4.4

2 release files

4.4.3

2 release files

4.4.2

2 release files

4.4.1

2 release files

4.4.0

2 release files

4.3.0

2 release files

4.2.0

2 release files

4.1.0

2 release files

4.0.10

2 release files

4.0.9

2 release files

4.0.8

2 release files

4.0.7

2 release files

4.0.6

2 release files

4.0.5

2 release files

4.0.4

2 release files

4.0.3

2 release files

4.0.2

2 release files

4.0.1

2 release files

3.0.7

2 release files

3.0.6

2 release files

3.0.5

2 release files

3.0.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page