Twitch聊天下载程序
tdh-tcd的Python项目详细描述
Twitch Chat下载程序
从过去的广播下载聊天信息的整洁的python脚本
要求
安装和使用
有多种方法可以安装此脚本。
# 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>
设置
要覆盖默认选项,请运行python -m tcd --generate-config
,然后编辑生成的settings.json
,或者只使用下面列出的控制台参数。
Option | Type | Argument | Description |
---|---|---|---|
client_id | str | ^{ | Twitch API Client-ID header. |
cooldown | int | ^{ | Delay (in milliseconds) between API calls. |
display_progress | bool | ^{ | Display animated progress bar in terminal. |
formats | str[] | ^{ | List of formats to download. See Formats table below. |
directory | str | ^{ | Name of directory to save all generated files. |
filename_format | str | ^{ | Full format of generated filenames. Possible arguments: ^{ |
subtitle_duration | int | ^{ | Duration (in seconds) of each line of subtitles. |
dynamic_duration | obj | Convert ^{ | |
—.enabled | bool | ^{ | Increase subtitle duration based on message length. |
—.max | int | ^{ | Maximum duration of subtitle message. |
—.max_length | int | ^{ | Maximum length of subtitle message. |
group_repeating_emotes | obj | Convert ^{ | |
—.enabled | bool | ^{ | Enable or disable this function. |
—.threshold | int | ^{ | Number of repeating emotes to trigger this function. |
—.format | str | ^{ | Customize format of replaced emotes. |
video_types | str | ^{ | Comma-separated list of VOD types to detect in Channel Mode. (see broadcast_type) |
格式
Format | Description |
---|---|
^{ | Advanced SubStation Alpha |
^{ | SubRip |
^{ | IRC-style log |
注释
- 空消息表示用户已超时。没办法弄到这些。
- 这个脚本使用的是twitch的api v5,即deprecated。
- 考虑在
settings.json
中增加api调用之间的延迟,以避免在从非常长的流下载消息时由于发送太多请求而引起的抽搐的潜在临时块。