Skip to content

Commit

Permalink
Link to CLI example commands at the end of the getting started guides…
Browse files Browse the repository at this point in the history
…, clarify CLI README
  • Loading branch information
ScrubN committed Jan 20, 2024
1 parent b4696f7 commit 0e3e02b
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 27 deletions.
22 changes: 14 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,11 @@ cd C:\folder\containing\TwitchDownloaderCLI
```
TwitchDownloaderCLI.exe ffmpeg --download
```
5. You can now start using the downloader, for example:
5. 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](TwitchDownloaderCLI/README.md#example-commands).

## Linux – Getting started

Expand All @@ -122,10 +123,11 @@ sudo chmod +x TwitchDownloaderCLI
```
sudo chmod +x ffmpeg
```
8. You can now start using the downloader, for example:
8. 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](TwitchDownloaderCLI/README.md#example-commands).

## 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:
Expand All @@ -150,16 +152,18 @@ chmod +x TwitchDownloaderCLI
```
chmod +x ffmpeg
```
7. You can now start using the downloader, for example:
7. 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](TwitchDownloaderCLI/README.md#example-commands).

# Building from source

## Requirements

- [.NET 6.0.x SDK](https://dotnet.microsoft.com/en-us/download/dotnet/6.0)
- About 1GB of disk space

## Build Instructions

Expand Down Expand Up @@ -194,13 +198,9 @@ cd TwitchDownloaderWPF/bin/Release/net6.0-windows/publish/win-x64
cd TwitchDownloaderCLI/bin/Release/net6.0/publish
```

# License

[MIT](./LICENSE.txt)

# Third Party Credits

Chat Renders are rendered with [SkiaSharp and HarfBuzzSharp](https://github.com/mono/SkiaSharp) © Microsoft Corporation.
Chat Renders are rendered with [SkiaSharp](https://github.com/mono/SkiaSharp) and [HarfBuzzSharp](https://github.com/mono/SkiaSharp) © Microsoft Corporation.

Chat Renders are encoded and Video Downloads are finalized with [FFmpeg](https://ffmpeg.org/) © The FFmpeg developers.

Expand All @@ -215,3 +215,9 @@ FFmpeg binaries fetched are runtime are downloaded using [Xabe.FFmpeg.Downloader
Chat Html exports utilize the _Inter_ typeface hosted by the [Google Fonts API](https://fonts.google.com/) © Google.

For a full list of utilized external libraries, see [THIRD-PARTY-LICENSES.txt](./TwitchDownloaderCore/Resources/THIRD-PARTY-LICENSES.txt).

# License

[MIT](./LICENSE.txt)

TwitchDownloader is in no way associated with Twitch Interactive, Inc. or its affiliates.
58 changes: 39 additions & 19 deletions TwitchDownloaderCLI/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ A cross platform command line tool that can do the main functions of the GUI pro
---

## Arguments for mode videodownload
<sup>Downloads a stream VOD or highlight from Twitch</sup>
#### Downloads a stream VOD or highlight from Twitch

**-u / --id (REQUIRED)**
The ID or URL of the VOD to download.
Expand Down Expand Up @@ -53,7 +53,7 @@ Path to temporary folder for cache.
(Default: `true`) Displays a banner containing version and copyright information.

## Arguments for mode clipdownload
<sup>Downloads a clip from Twitch</sup>
#### Downloads a clip from Twitch

**-u / --id (REQUIRED)**
The ID or URL of the Clip to download.
Expand All @@ -80,7 +80,7 @@ Path to temporary folder for cache.
(Default: `true`) Displays a banner containing version and copyright information.

## Arguments for mode chatdownload
<sup>Downloads the chat of a VOD, highlight, or clip</sup>
#### Downloads the chat of a VOD, highlight, or clip

**-u / --id (REQUIRED)**
The ID or URL of the VOD or clip to download.
Expand Down Expand Up @@ -125,7 +125,7 @@ Path to temporary folder for cache.
(Default: `true`) Displays a banner containing version and copyright information.

## Arguments for mode chatupdate
<sup>Updates the embedded emotes, badges, bits, and crops of a chat download and/or converts a JSON chat to another format</sup>
#### Updates the embedded emotes, badges, bits, and crops of a chat download and/or converts a JSON chat to another format

**-i / --input (REQUIRED)**
Path to input file. Valid extensions are: `.json`, `.json.gz`.
Expand Down Expand Up @@ -167,7 +167,7 @@ Path to temporary folder for cache.
(Default: `true`) Displays a banner containing version and copyright information.

## Arguments for mode chatrender
<sup>Renders a chat JSON as a video</sup>
#### Renders a chat JSON as a video

**-i / --input (REQUIRED)**
The path to the `.json` or `.json.gz` chat file input.
Expand Down Expand Up @@ -323,7 +323,7 @@ Other = `1`, Broadcaster = `2`, Moderator = `4`, VIP = `8`, Subscriber = `16`, P


## Arguments for mode ffmpeg
<sup>Manage standalone FFmpeg</sup>
#### Manage standalone FFmpeg

**-d / --download**
(Default: `false`) Downloads FFmpeg as a standalone file.
Expand All @@ -332,7 +332,7 @@ Other = `1`, Broadcaster = `2`, Moderator = `4`, VIP = `8`, Subscriber = `16`, P
(Default: `true`) Displays a banner containing version and copyright information.

## Arguments for mode cache
<sup>Manage the working cache.</sup>
#### Manage the working cache.

**-c / --clear**
(Default: `false`) Clears the default cache folder.
Expand All @@ -346,51 +346,71 @@ Other = `1`, Broadcaster = `2`, Moderator = `4`, VIP = `8`, Subscriber = `16`, P
---

## Example Commands
<sup>Examples of typical use cases</sup>
#### Examples of typical TwitchDownloaderCLI use cases.

Note: Commands are formatted for unix systems (i.e. Mac, Linux). For usage on Windows, replace `./TwitchDownloaderCLI` with `TwitchDownloaderCLI.exe` (cmd) or `./TwitchDownloaderCLI.exe` (powershell).

Download a VOD with defaults

TwitchDownloaderCLI videodownload --id 612942303 -o video.mp4
./TwitchDownloaderCLI videodownload --id 612942303 -o video.mp4

Download a Clip with defaults

TwitchDownloaderCLI clipdownload --id NurturingCalmHamburgerVoHiYo -o clip.mp4
./TwitchDownloaderCLI clipdownload --id NurturingCalmHamburgerVoHiYo -o clip.mp4

Download a Chat JSON with embedded emotes/badges from Twitch and emotes from Bttv

TwitchDownloaderCLI chatdownload --id 612942303 --embed-images --bttv=true --ffz=false --stv=false -o chat.json
./TwitchDownloaderCLI chatdownload --id 612942303 --embed-images --bttv=true --ffz=false --stv=false -o chat.json

Download a Chat as plain text with timestamps

TwitchDownloaderCLI chatdownload --id 612942303 --timestamp-format Relative -o chat.txt
./TwitchDownloaderCLI chatdownload --id 612942303 --timestamp-format Relative -o chat.txt

Add embeds to a chat file that was downloaded without embeds

TwitchDownloaderCLI chatupdate -i chat.json -o chat_embedded.json --embed-missing
./TwitchDownloaderCLI chatupdate -i chat.json -o chat_embedded.json --embed-missing

Convert a JSON chat file to HTML

TwitchDownloaderCLI chatupdate -i chat.json -o chat.html
./TwitchDownloaderCLI chatupdate -i chat.json -o chat.html

Render a chat with defaults

TwitchDownloaderCLI chatrender -i chat.json -o chat.mp4
./TwitchDownloaderCLI chatrender -i chat.json -o chat.mp4

Render a chat with custom video settings and message outlines

TwitchDownloaderCLI chatrender -i chat.json -h 1440 -w 720 --framerate 60 --outline -o chat.mp4
./TwitchDownloaderCLI chatrender -i chat.json -h 1440 -w 720 --framerate 60 --outline -o chat.mp4

Render a chat with custom FFmpeg arguments

TwitchDownloaderCLI chatrender -i chat.json --output-args='-c:v libx264 -preset veryfast -crf 18 -pix_fmt yuv420p "{save_path}"' -o chat.mp4
./TwitchDownloaderCLI chatrender -i chat.json --output-args='-c:v libx264 -preset veryfast -crf 18 -pix_fmt yuv420p "{save_path}"' -o chat.mp4

Download a portable FFmpeg binary for your system

./TwitchDownloaderCLI ffmpeg --download

Clear the default TwitchDownloader cache folder

./TwitchDownloaderCLI cache --clear

Print the available operations

./TwitchDownloaderCLI help

Print the available options for the VOD downloader

./TwitchDownloaderCLI videodownload --help

---

## Additional Notes

String arguments, such as output file, that contain spaces should be wrapped in either single quotes <kbd>'</kbd> or double quotes <kbd>"</kbd> .
All `--id` inputs will accept either video/clip IDs or full video/clip URLs. i.e. `--id 612942303` or `--id https://twitch.tv/videos/612942303`.

String arguments that contain spaces should be wrapped in either single quotes <kbd>'</kbd> or double quotes <kbd>"</kbd>. i.e. `--output 'my output file.mp4'` or `--output "my output file.mp4"`

Default true boolean flags must be assigned: `--default-true-flag=false`. Default false boolean flags should still be raised normally: `--default-false-flag`
Default true boolean flags must be assigned: `--default-true-flag=false`. Default false boolean flags should still be raised normally: `--default-false-flag`.

For Linux users, ensure both `fontconfig` and `libfontconfig1` are installed. `apt-get install fontconfig libfontconfig1` on Ubuntu.

Expand Down

0 comments on commit 0e3e02b

Please sign in to comment.