Twitch Chat Downloader 
Neat python script to download chat messages from past broadcasts
Requirements
Installation and usage
There are multiple ways to install this script.
# Install package with pip
pip3 install tdh-tcd
python3 -m tcd <video_id>
# Run pip3 as root to install `tcd` for all users (not recommended)
sudo pip3 install tdh-tcd
tcd <video_id>
# Start script directly from cloned repository
git clone https://github.com/TheDrHax/Twitch-Chat-Downloader.git
cd Twitch-Chat-Downloader
pip install -r requirements.txt
python -m tcd <video_id>
# or ...
python app.py <video_id>
Settings
To override default options, run python -m tcd --generate-config and edit generated settings.json or just use console arguments listed below.
| Option | Type | Argument | Description |
|---|---|---|---|
| client_id | str | --client-id |
Twitch API Client-ID header. |
| cooldown | int | --cooldown |
Delay (in milliseconds) between API calls. |
| display_progress | bool | --[no-]progress |
Display animated progress bar in terminal. |
| formats | str[] | -f/--formats |
List of formats to download. See Formats table below. |
| directory | str | -t/--directory |
Name of directory to save all generated files. |
| filename_format | str | --filename-format |
Full format of generated filenames. Possible arguments: directory, video_id and format. |
| max_width | int | --max-width |
Add line breaks to fit messages into specified width. Note: Implemented only for SSA/ASS subtitles. |
| subtitle_duration | int | --subtitle-duration |
Duration (in seconds) of each line of subtitles. |
| dynamic_duration | obj | Convert Kappa Kappa Kappa to Kappa x3. |
|
| —.enabled | bool | --[no-]dynamic-duration |
Increase subtitle duration based on message length. |
| —.max | int | --dynamic-duration-max |
Maximum duration of subtitle message. |
| —.max_length | int | --dynamic-duration-max-length |
Maximum length of subtitle message. |
| group_repeating_emotes | obj | Convert Kappa Kappa Kappa to Kappa x3. |
|
| —.enabled | bool | --[no-]group |
Enable or disable this function. |
| —.threshold | int | --group-threshold |
Number of repeating emotes to trigger this function. |
| —.collocations | int | --group-collocations |
Maximum number of words in repeating collocations (default: 1, more is slower). |
| —.collocations_threshold | int | --group-collocations-threshold |
Same logic as in —.threshold, but applies only to repeating collocations. |
| —.format | str | --group-format |
Customize format of replaced emotes. |
| video_types | str | --video-types |
Comma-separated list of VOD types to detect in Channel Mode. (see broadcast_type) |
Formats
| Format | Description |
|---|---|
ass or ssa |
Advanced SubStation Alpha |
srt |
SubRip |
irc |
IRC-style log |
Notes
- Empty messages means the user has been timed out. There's no known way to get these.
- This script is using Twitch's API v5 that is deprecated.
- Consider increasing the delay between API calls in
settings.jsonto avoid a potential temporary block from Twitch for sending too many requests when downloading messages from very long streams.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tdh-tcd-2.4.8.tar.gz
(10.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
tdh_tcd-2.4.8-py3-none-any.whl
(11.4 kB
view details)
File details
Details for the file tdh-tcd-2.4.8.tar.gz.
File metadata
- Download URL: tdh-tcd-2.4.8.tar.gz
- Upload date:
- Size: 10.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
baa16821dd9315243243d7366f7e2337470ac93d513ff4822feee8696b9b4d46
|
|
| MD5 |
5b588a6980f8af36424a622579bc28de
|
|
| BLAKE2b-256 |
08f0df2ae0121e6037e87dfaba26da9259b6e9ad293705bb401cd7a1c664faea
|
File details
Details for the file tdh_tcd-2.4.8-py3-none-any.whl.
File metadata
- Download URL: tdh_tcd-2.4.8-py3-none-any.whl
- Upload date:
- Size: 11.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb7cc344db9bfe1f105a94371daf34e13dd6ee90c7995eaeb8ef6781016571f7
|
|
| MD5 |
eb3e08aab7ebd8668bdcf8dc606ea7b3
|
|
| BLAKE2b-256 |
7b362bc64dd428e5bd46d9188576ed22bd422dd548300e97e1af539c77308e8b
|