DumpsterDoofus / Twitch-Chat-Downloader

3 stars 1 forks source link

Twitch Chat Downloader

Build Status

Have you ever downloaded a Twitch video using YouTube-DL, watched it, and wished you could download the chat too? Now you can.

This console app downloads the chat on a Twitch video and converts it to an SRT file, so you can read chat as subtitles while watching the video. Here's it in action on VLC:

How to use

Setup

  1. Ensure the .NET Core runtime is on the path.
  2. Download and unzip the latest release.

Documentation

In PowerShell (or similar terminal), run dotnet TwitchChatDownloader.dll to display the help, printed below for convenience:

ERROR(S):
  No verb selected.

  user       Download chat for all of a user's videos.

  video      Download a single video.

  help       Display more information on a specific command.

  version    Display version information.

If you run dotnet TwitchChatDownloader.dll user, you'll get this help:

ERROR(S):
  Required option 'u, username' is missing.

  -u, --username     Required. The username (for example, https://www.twitch.tv/zfg1 has username zfg1).

  -t, --videotype    (Default: All) The type of videos to download. Can be: All, Upload, Archive, or Highlight.

  --help             Display this help screen.

  --version          Display version information.

And if you run dotnet TwitchChatDownloader.dll video, you'll get this help:

ERROR(S):
  Required option 'v, videoid' is missing.

  -v, --videoid    Required. The video ID (for example, https://www.twitch.tv/videos/213105685 has ID 213105685). This
                   will download subtitles for a single video.

  --help           Display this help screen.

  --version        Display version information.

Hopefully this is self-explanatory, but if not, below are some examples.

Examples

Downloading for a single video (https://www.twitch.tv/videos/69027652)

dotnet TwitchChatDownloader.dll video --videoid 69027652

Example log output:

[12:51:59 INF] Getting info for video ID: 69027652
[12:51:59 INF] Got info for video "Double 46"
[12:51:59 INF] Saving video Double 46.
[12:51:59 INF] Getting comments for video Double 46, ID 69027652.
[12:52:00 INF] Got 149 comments for video.
[12:52:00 INF] Wrote SRT file to C:\Users\Peter\Desktop\TwitchChatDownloader\SRT\Double 46-v69027652.srt.
[12:52:00 INF] Done saving video chat.

In this case, it saved off a single SRT file (Double 46-v69027652.srt) containing the comments as subtitles.

Downloading only highlights from a user's channel (https://www.twitch.tv/zfg1)

dotnet TwitchChatDownloader.dll user --username zfg1 --videotype highlight

This will download a bunch of SRT files (for each highlight-type video).

Advanced Configuration

The appsettings.json contains configuration settings that you can edit, such as:

How To Contribute

If you want to improve something (fix a bug, or add an enhancement), then file a pull request. Once CI checks pass, it's reviewed, and merged, a new release will automatically be published.

If you don't know how to implement the improvement, then file an issue and describe what you'd like to see improved. Hopefully someone will implement it!