Menu

Tree [69d8e9] master /
 History

HTTPS access


File Date Author Commit
 .github 2024-07-25 dragomerlin dragomerlin [94c57e] Mirror of lay295:4c65eb81e10a064f1f99022c8a8316...
 .vscode 2025-01-26 dragomerlin dragomerlin [5d203b] Add .vscode/launch.json for debugging for twitc...
 TwitchDownloaderCLI 2025-01-21 dragomerlin dragomerlin [ed22d9] Update all pubxml files from net6 to net9
 TwitchDownloaderCLI.Tests 2025-01-21 dragomerlin dragomerlin [51d88c] Upgrade net6 to net9
 TwitchDownloaderCore 2025-02-06 dragomerlin dragomerlin [e9147f] Update changes to lay295:cd5e73b7bb5dcbf99f8dd3...
 TwitchDownloaderCore.Tests 2025-01-21 dragomerlin dragomerlin [51d88c] Upgrade net6 to net9
 TwitchDownloaderWPF 2025-02-06 dragomerlin dragomerlin [e9147f] Update changes to lay295:cd5e73b7bb5dcbf99f8dd3...
 .editorconfig 2024-08-30 dragomerlin dragomerlin [5eebf3] Sync to lay295:64fac09a0fbdd7da43e14395c31d42b2...
 .gitattributes 2023-12-26 dragomerlin dragomerlin [3e7438] Fork from github.com/lay295/TwitchDownloader/co...
 .gitignore 2023-12-26 dragomerlin dragomerlin [3e7438] Fork from github.com/lay295/TwitchDownloader/co...
 LICENSE.txt 2023-12-26 dragomerlin dragomerlin [3e7438] Fork from github.com/lay295/TwitchDownloader/co...
 README.md 2025-02-08 dragomerlin dragomerlin [69d8e9] Some doc improvements
 README_es.md 2024-05-18 dragomerlin dragomerlin [990758] Update to lay295:7331863273d452e77f99484c019685...
 README_it.md 2024-05-18 dragomerlin dragomerlin [990758] Update to lay295:7331863273d452e77f99484c019685...
 README_ja.md 2024-06-08 dragomerlin dragomerlin [6a5efd] Update to lay295: 18a55aa999191d886bf8af24e6170...
 README_pt-br.md 2024-05-18 dragomerlin dragomerlin [990758] Update to lay295:7331863273d452e77f99484c019685...
 README_ru.md 2024-07-25 dragomerlin dragomerlin [94c57e] Mirror of lay295:4c65eb81e10a064f1f99022c8a8316...
 README_tr.md 2024-05-18 dragomerlin dragomerlin [990758] Update to lay295:7331863273d452e77f99484c019685...
 README_zh-cn.md 2024-11-01 dragomerlin dragomerlin [d18242] sync to https://github.com/lay295/TwitchDownloa...
 README_zh-tw.md 2024-11-01 dragomerlin dragomerlin [d18242] sync to https://github.com/lay295/TwitchDownloa...
 TwitchDownloaderWPF.sln 2024-04-19 dragomerlin dragomerlin [8af919] Mirror from lay295:b5da2872f0f8870f3a31fdc8e2b8...
 WHERE IS THE EXE.txt 2023-12-26 dragomerlin dragomerlin [3e7438] Fork from github.com/lay295/TwitchDownloader/co...
 publish-rename-all-cli.sh 2025-02-08 dragomerlin dragomerlin [69d8e9] Some doc improvements

Read Me

Logo

Twitch Downloader

Twitch VOD/Clip/Chat Downloader and Chat Renderer

Report Bug

NOTICE

This project TwitchDownloader2 is a fork of TwitchDownloader, which only does:

  • Download metadata file metadata.txt.
  • Save playlist for selected quality as index-dvr.m3u8, inserting a custom tag #CUSTOM-DOWNLOADER: in second line.

See source code only changes from lay295's version to TwitchDownloader2 since last sync, for selected branch:

git diff 4c11919149974182f9a707eefae5dc9526258ff8 HEAD -- . ':(exclude)README.md' ':(exclude)publish-rename-all-cli.sh'

This program is designed to work with the twitch-batch-downloader scripts, when selected as downloader.

The READMEs in other languages than English are not up-to-date with this notice.

Pre-compiled binaries

The self-contained executables for various architectures are available in the Files/Releases section, renamed to TwitchDownloaderCLI2(.exe), so are not mistaken with the original ones from GitHub.

If the binary is for macOS, and has not been compiled on the same machine (for example downloaded from the Releases section), is mandatory to self-sign it and remove it from quarantine. Otherwise it will be killed instantly upon execution (may depend on macOS version or hardware):

$ ./TwitchDownloaderCLI2 help
Killed: 9

Checking the logs to make sure it was blocked and it's not a faulty executable:

$ log show --predicate 'eventMessage contains "TwitchDownloaderCLI2"' --last 1h
Filtering the log data using "composedMessage CONTAINS "TwitchDownloaderCLI2""
Skipping info and debug messages, pass --info and/or --debug to include.
Timestamp                       Thread     Type        Activity             PID    TTL
2024-02-26 10:10:24.823327+0000 0x5cd311   Default     0x0                  0      0    kernel: (AppleSystemPolicy) ASP: Security policy would not allow process: 65440, TwitchDownloaderCLI2
2024-02-26 10:10:25.263282+0000 0x5cd316   Default     0x0                  260    0    syspolicyd: (Security) [com.apple.securityd:gk] temporarySigning type=1 matchFlags=0x0 path=TwitchDownloaderCLI2
2024-02-26 10:10:46.417458+0000 0x5cd497   Default     0x0                  0      0    kernel: (AppleSystemPolicy) ASP: Security policy would not allow process: 65454, TwitchDownloaderCLI2
2024-02-26 10:10:52.887625+0000 0x5cd4ea   Default     0x0                  0      0    kernel: (AppleSystemPolicy) ASP: Security policy would not allow process: 65462, TwitchDownloaderCLI2
2024-02-26 10:10:53.789344+0000 0x5cd50f   Default     0x0                  0      0    kernel: (AppleSystemPolicy) ASP: Security policy would not allow process: 65468, TwitchDownloaderCLI2
2024-02-26 10:13:36.478086+0000 0x5cdc83   Default     0x0                  0      0    kernel: (AppleSystemPolicy) ASP: Security policy would not allow process: 65568, TwitchDownloaderCLI2
2024-02-26 10:15:03.181237+0000 0x5cdfdc   Default     0x0                  0      0    kernel: (AppleSystemPolicy) ASP: Security policy would not allow process: 65596, TwitchDownloaderCLI2
2024-02-26 10:16:36.063926+0000 0x5ce61b   Default     0x0                  0      0    kernel: (AppleSystemPolicy) ASP: Security policy would not allow process: 65870, TwitchDownloaderCLI2
2024-02-26 10:16:38.650626+0000 0x5ce644   Default     0x0                  0      0    kernel: (AppleSystemPolicy) ASP: Security policy would not allow process: 65876, TwitchDownloaderCLI2
--------------------------------------------------------------------------------------------------------------------
Log      - Default:          9, Info:                0, Debug:             0, Error:          0, Fault:          0
Activity - Create:           0, Transition:          0, Actions:           0

To fix the issue for the local computer:

$ xattr -d com.apple.quarantine TwitchDownloaderCLI2
$ codesign --force --deep --sign - TwitchDownloaderCLI2

How to compile

1) Clone the project:

git clone git://git.code.sf.net/p/twitchdownloader2/code TwitchDownloader2

2) Change CWD to project's top folder:

cd TwitchDownloader2

3.1) Run the script publish-rename-all-cli.sh, to compile and rename the executables (bytecode) for all profiles. It can compile for 3 cases:

  • Original (lay295) TwitchDownloader project: compiles as TwitchDownloaderCLI(.exe), as self-contained. The script has to be copied over since it's not included in that project.
  • Fork TwitchDownloader2 project, master branch: compiles as TwitchDownloaderCLI2(.exe), as self-contained.
  • Fork TwitchDownloader2 project, debug branch: compiles as TwitchDownloaderCLI2(.exe), as not self-contained. The important files here are the TwitchDownloaderCLI.dll (which are not renamed).

3.2) or publish manually (only when as self-contained):

Restore all the dependencies and tools for the CLI only:

dotnet restore TwitchDownloaderCLI

Build all the executables for all the currently available architectures:

dotnet publish TwitchDownloaderCLI -p:PublishProfile=Windows
dotnet publish TwitchDownloaderCLI -p:PublishProfile=Linux
dotnet publish TwitchDownloaderCLI -p:PublishProfile=LinuxAlpine
dotnet publish TwitchDownloaderCLI -p:PublishProfile=LinuxArm
dotnet publish TwitchDownloaderCLI -p:PublishProfile=LinuxArm64
dotnet publish TwitchDownloaderCLI -p:PublishProfile=MacOS
dotnet publish TwitchDownloaderCLI -p:PublishProfile=MacOSArm64

Rename them to TwitchDownloaderCLI2 (only if it's this fork):

find TwitchDownloaderCLI/bin/Release/net9.0/publish/ -name 'TwitchDownloaderCLI' -exec mv {} {}2 \;
find TwitchDownloaderCLI/bin/Release/net9.0/publish/ -name 'TwitchDownloaderCLI.exe' -exec sh -c 'mv "$1" "${1%.exe}2.exe"' sh {} \;

They will be located in each subdirectory (the Windows build is the only one that has filename extension):

TwitchDownloaderCLI/bin/Release/net9.0/publish/Windows/TwitchDownloaderCLI2.exe
TwitchDownloaderCLI/bin/Release/net9.0/publish/Linux/TwitchDownloaderCLI2
TwitchDownloaderCLI/bin/Release/net9.0/publish/LinuxAlpine/TwitchDownloaderCLI2
TwitchDownloaderCLI/bin/Release/net9.0/publish/LinuxArm/TwitchDownloaderCLI2
TwitchDownloaderCLI/bin/Release/net9.0/publish/LinuxArm64/TwitchDownloaderCLI2
TwitchDownloaderCLI/bin/Release/net9.0/publish/MacOS/TwitchDownloaderCLI2
TwitchDownloaderCLI/bin/Release/net9.0/publish/MacOSArm64/TwitchDownloaderCLI2

4) Then copy to any system-wide folder in $PATH as TwitchDownloaderCLI2, for example the Linux variant:

sudo cp TwitchDownloaderCLI/bin/Release/net9.0/publish/Linux/TwitchDownloaderCLI2 /usr/local/bin/

or just for the current user to local bin path ~/bin/ or ~/.local/bin:

cp TwitchDownloaderCLI/bin/Release/net9.0/publish/Linux/TwitchDownloaderCLI2 ~/bin/

Mark the file as executable if the operating system is not Windows:

chmod +x TwitchDownloaderCLI2

Debug

This project has 2 branches: master (default) and debug. The debug branch is exactly the same as master, except that prints some variables and its content to terminal. This was done to help create the script twitch-batch-downloader/twitchdownloader-shell.sh, and only affects the verb videodownload.
To switch to this branch, clone the repository as usual then switch:

git clone git://git.code.sf.net/p/twitchdownloader2/code TwitchDownloader2
cd TwitchDownloader2
git checkout debug

The debugging is done usually with Visual Studio Code (VSC), and there's the required file .vscode/launch.json specific for this.
To debug with VSC, the bytecode must be compiled without being self-contained. The script publish-rename-all-cli.sh detect this automatically, so can run to build the alternative bytecode if hasn't been done already.

To manually compile for each RuntimeIdentifier:

dotnet publish TwitchDownloaderCLI -c Debug -r linux-musl-x64 --self-contained false
dotnet publish TwitchDownloaderCLI -c Debug -r linux-arm64 --self-contained false
dotnet publish TwitchDownloaderCLI -c Debug -r linux-arm --self-contained false
dotnet publish TwitchDownloaderCLI -c Debug -r linux-x64 --self-contained false
dotnet publish TwitchDownloaderCLI -c Debug -r osx-arm64 --self-contained false
dotnet publish TwitchDownloaderCLI -c Debug -r osx-x64 --self-contained false
dotnet publish TwitchDownloaderCLI -c Debug -r win-x64 --self-contained false

Optionally TwitchDownloaderCLI can be renamed to TwitchDownloaderCLI2, but doesn't matter because the debugging is done by means of the dll (this is what VSC does):

/opt/homebrew/bin/dotnet TwitchDownloaderCLI/bin/Debug/net9.0/osx-arm64/publish/TwitchDownloaderCLI.dll videodownload -u 49711043 --temp-path ./ -o output.mp4 --banner false

Translations

This document is also partially available in other languages:

Chat Render Example

https://user-images.githubusercontent.com/1060681/197653099-c3fd12c2-f03a-4580-84e4-63ce3f36be8d.mp4

What can it do?

  • Download Twitch VODs
  • Download Twitch Clips
  • Download chat for VODs and Clips, in either a JSON with all the original information, a browser HTML file, or a plain text file
  • Update the contents of a previously generated JSON chat file with an option to save as another format
  • Use a previously generated JSON chat file to render the chat with Twitter Twemoji or Google Noto Color emojis and BTTV, FFZ, 7TV static and animated emotes

GUI

Windows WPF

See the full WPF documentation here

Functionality

The Windows WPF GUI implements all of the main functions of the program along with some extra quality of life functions:

  • Queue up multiple download/render jobs to run simultaneously
  • Create a list of download jobs from a list of vod/clip links
  • Search for and download multiple VODs/clips from any streamer without leaving the app

Multi-language Support

The Windows WPF GUI is available in multiple languages thanks to community translations. See the Localization section of the WPF README for more details.

Theming

The Windows WPF GUI comes bundled with both light and dark themes, along with an option to update live according the current Windows theme. It also supports user created themes! See the Theming section of the WPF README for more details.

Video Demonstration

https://www.youtube.com/watch?v=0W3MhfhnYjk
(older version, same concept)

Linux?

Check twitch-downloader-gui on github or on the AUR for a Linux GUI wrapper for the CLI.

MacOS?

No GUI is available for MacOS yet :(

CLI

See the full CLI documentation here

The CLI is cross-platform and implements the main functions of the program. It works on Windows, Linux, and MacOS*.

*Only Intel Macs have been tested

With the CLI, it is possible to automate video processing using external scripts. For example, you could copy-paste the following code into a .bat file on Windows to download a VOD and its chat, and then render the chat, all from a single input.

@echo off
set /p vodid="Enter VOD ID: "
TwitchDownloaderCLI.exe videodownload --id %vodid% --ffmpeg-path "ffmpeg.exe" -o %vodid%.mp4
TwitchDownloaderCLI.exe chatdownload --id %vodid% -o %vodid%_chat.json -E
TwitchDownloaderCLI.exe chatrender -i %vodid%_chat.json -h 1080 -w 422 --framerate 30 --update-rate 0 --font-size 18 -o %vodid%_chat.mp4

Windows - Getting started

  1. Go to Releases and download the latest version for Windows or build from source.
  2. Extract TwitchDownloaderCLI.exe.
  3. Browse to where you extracted the executable:
cd C:\folder\containing\TwitchDownloaderCLI
  1. If you do not have FFmpeg, you can install it via Chocolatey package manager, or you can get it as a standalone file from ffmpeg.org or by using TwitchDownloaderCLI:
TwitchDownloaderCLI.exe ffmpeg --download
  1. You can now start using TwitchDownloaderCLI, for example:
TwitchDownloaderCLI.exe videodownload --id <vod-id-here> -o out.mp4

You can find more example commands in the CLI README.

Linux – Getting started

  1. Some distros, like Linux Alpine, lack fonts for some languages (Arabic, Persian, Thai, etc.) If this is the case for you, install additional fonts families such as Noto or check your distro's wiki page on fonts as it may have an install command for this specific scenario, such as the Linux Alpine font page.
  2. Ensure both fontconfig and libfontconfig1 are installed. apt-get install fontconfig libfontconfig1 on Ubuntu.
  3. Go to Releases and download the latest binary for Linux, grab the AUR Package for Arch Linux, or build from source.
  4. Extract TwitchDownloaderCLI.
  5. Browse to where you extracted the binary:
cd directory/containing/TwitchDownloaderCLI
  1. Give the binary executable rights:
sudo chmod +x TwitchDownloaderCLI
  1. a) If you do not have FFmpeg, you should install it system-wide via your distro package manager, however you can also get it as a standalone file from ffmpeg.org or by using TwitchDownloaderCLI:
./TwitchDownloaderCLI ffmpeg --download
  1. b) If downloaded as a standalone file, you must also give it executable rights with:
sudo chmod +x ffmpeg
  1. You can now start using TwitchDownloaderCLI, for example:
./TwitchDownloaderCLI videodownload --id <vod-id-here> -o out.mp4

You can find more example commands in the CLI README.

MacOS – Getting started

  1. If your device has an Apple Silicon M-series processor, ensure that you download the arm64 binary, however if you would like to use the x64 binary on Apple Silicon it must be run via a terminal session running under Rosetta 2:
arch -x86_64 zsh
  1. Go to Releases and download the latest binary for MacOS or build from source.
  2. Extract TwitchDownloaderCLI.
  3. Browse to where you extracted the binary:
cd directory/containing/TwitchDownloaderCLI
  1. Give the binary executable rights in the terminal:
chmod +x TwitchDownloaderCLI
  1. a) If you do not have FFmpeg, you can install it system-wide via the Homebrew package manager, or you can get it as a standalone file from ffmpeg.org or by using TwitchDownloaderCLI:
./TwitchDownloaderCLI ffmpeg --download
  1. b) If downloaded as a standalone file, you must also give it executable rights with:
chmod +x ffmpeg
  1. You can now start using TwitchDownloaderCLI, for example:
./TwitchDownloaderCLI videodownload --id <vod-id-here> -o out.mp4

You can find more example commands in the CLI README.

Building from source

Requirements

Build Instructions

  1. Clone the repository:
git clone https://github.com/lay295/TwitchDownloader.git
  1. Navigate to the solution folder:
cd TwitchDownloader
  1. Restore the solution:
dotnet restore
  • Non-Windows devices may need to explicitly specify a project to restore, i.e. dotnet restore TwitchDownloaderCLI

  • a) Build the GUI:

dotnet publish TwitchDownloaderWPF -p:PublishProfile=Windows
  1. b) Build the CLI:
dotnet publish TwitchDownloaderCLI -p:PublishProfile=<Profile>
  • Applicable Profiles: Windows, Linux, LinuxAlpine, LinuxArm, LinuxArm64, MacOS, MacOSArm64

  • a) Navigate to the GUI build folder:

cd TwitchDownloaderWPF/bin/Release/net6.0-windows/publish/win-x64
  1. b) Navigate to the CLI build folder:
cd TwitchDownloaderCLI/bin/Release/net6.0/publish

Third Party Credits

Chat Renders are rendered with SkiaSharp and HarfBuzzSharp © Microsoft Corporation.

Chat Renders are encoded and Video Downloads are finalized with FFmpeg © The FFmpeg developers.

Chat Renders may use Noto Color Emoji © Google and contributors.

Chat Renders may use Twemoji © Twitter and contributors.

Bundled FFmpeg binaries are fetched from gyan.dev © Gyan Doshi.

FFmpeg binaries fetched are runtime are downloaded using Xabe.FFmpeg.Downloader © Xabe.

Chat Html exports utilize the Inter typeface hosted by the Google Fonts API © Google.

For a full list of utilized external libraries, see THIRD-PARTY-LICENSES.txt.

License

MIT

TwitchDownloader is in no way associated with Twitch Interactive, Inc. or its affiliates.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.