Skip to content

Commit

Permalink
Copyright clarification (#768)
Browse files Browse the repository at this point in the history
* Fix Ffmpeg detection priority and rename PathUtils

* Fix potential IndexOutOfRangeException

* Spell FFmpeg correctly where meaningful

* Rename Quiet to Silent

* Add more verbose licensing information

* Update workflows

* Update CLI README
  • Loading branch information
ScrubN authored Aug 1, 2023
1 parent 8848024 commit a212fa3
Show file tree
Hide file tree
Showing 32 changed files with 3,200 additions and 85 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Build Windows GUI
run: dotnet publish TwitchDownloaderWPF -p:PublishProfile=Windows -p:DebugType=None -p:DebugSymbols=false

- name: Download Ffmpeg To Workspace
- name: Download FFmpeg To Workspace
# You may pin to the exact commit or the version.
# uses: carlosperate/download-file-action@e85e0aa6262f13571d17a4a39687b26981c583dc
uses: carlosperate/[email protected]
Expand All @@ -34,7 +34,7 @@ jobs:
# New filename to rename the downloaded file
file-name: ffmpeg.zip

- name: Bundle Ffmpeg
- name: Bundle FFmpeg
run: tar xfz ffmpeg.zip --strip-components=1; copy bin/ffmpeg.exe TwitchDownloaderWPF/bin/Release/net6.0-windows/publish/win-x64/ffmpeg.exe

- name: Zip Windows GUI
Expand Down Expand Up @@ -74,31 +74,31 @@ jobs:
- name: Zip Windows CLI
uses: vimtor/action-zip@v1
with:
files: TwitchDownloaderCLI/bin/Release/net6.0/publish/Windows/TwitchDownloaderCLI.exe
files: "TwitchDownloaderCLI/bin/Release/net6.0/publish/Windows"
dest: TwitchDownloaderCLI-Windows-x64.zip

- name: Zip Linux CLI
uses: vimtor/action-zip@v1
with:
files: TwitchDownloaderCLI/bin/Release/net6.0/publish/Linux/TwitchDownloaderCLI
files: "TwitchDownloaderCLI/bin/Release/net6.0/publish/Linux"
dest: TwitchDownloaderCLI-Linux-x64.zip

- name: Zip LinuxAlpine CLI
uses: vimtor/action-zip@v1
with:
files: TwitchDownloaderCLI/bin/Release/net6.0/publish/LinuxAlpine/TwitchDownloaderCLI
files: "TwitchDownloaderCLI/bin/Release/net6.0/publish/LinuxAlpine"
dest: TwitchDownloaderCLI-LinuxAlpine-x64.zip

- name: Zip LinuxArm CLI
uses: vimtor/action-zip@v1
with:
files: TwitchDownloaderCLI/bin/Release/net6.0/publish/LinuxArm/TwitchDownloaderCLI
files: "TwitchDownloaderCLI/bin/Release/net6.0/publish/LinuxArm"
dest: TwitchDownloaderCLI-LinuxArm.zip

- name: Zip LinuxArm64 CLI
uses: vimtor/action-zip@v1
with:
files: TwitchDownloaderCLI/bin/Release/net6.0/publish/LinuxArm64/TwitchDownloaderCLI
files: "TwitchDownloaderCLI/bin/Release/net6.0/publish/LinuxArm64"
dest: TwitchDownloaderCLI-LinuxArm64.zip

- name: Upload Windows CLI Artifact Asset
Expand Down Expand Up @@ -148,7 +148,7 @@ jobs:
- name: Zip MacOS CLI
uses: vimtor/action-zip@v1
with:
files: TwitchDownloaderCLI/bin/Release/net6.0/publish/MacOS/TwitchDownloaderCLI
files: "TwitchDownloaderCLI/bin/Release/net6.0/publish/MacOS"
dest: TwitchDownloaderCLI-MacOS-x64.zip

- name: Upload MacOS CLI Artifact Asset
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
- name: Build Windows GUI
run: dotnet publish TwitchDownloaderWPF -p:PublishProfile=Windows -p:DebugType=None -p:DebugSymbols=false

- name: Download Ffmpeg To Workspace
- name: Download FFmpeg To Workspace
# You may pin to the exact commit or the version.
# uses: carlosperate/download-file-action@e85e0aa6262f13571d17a4a39687b26981c583dc
uses: carlosperate/[email protected]
Expand All @@ -59,7 +59,7 @@ jobs:
# New filename to rename the downloaded file
file-name: ffmpeg.zip

- name: Bundle Ffmpeg
- name: Bundle FFmpeg
run: tar xfz ffmpeg.zip --strip-components=1; copy bin/ffmpeg.exe TwitchDownloaderWPF/bin/Release/net6.0-windows/publish/win-x64/ffmpeg.exe

- name: Zip Windows GUI Release Asset
Expand Down Expand Up @@ -115,31 +115,31 @@ jobs:
- name: Zip Windows CLI
uses: vimtor/action-zip@v1
with:
files: TwitchDownloaderCLI/bin/Release/net6.0/publish/Windows/TwitchDownloaderCLI.exe
files: "TwitchDownloaderCLI/bin/Release/net6.0/publish/Windows"
dest: TwitchDownloaderCLI-${{ github.event.inputs.release_tag }}-Windows-x64.zip

- name: Zip Linux CLI
uses: vimtor/action-zip@v1
with:
files: TwitchDownloaderCLI/bin/Release/net6.0/publish/Linux/TwitchDownloaderCLI
files: "TwitchDownloaderCLI/bin/Release/net6.0/publish/Linux"
dest: TwitchDownloaderCLI-${{ github.event.inputs.release_tag }}-Linux-x64.zip

- name: Zip LinuxAlpine CLI
uses: vimtor/action-zip@v1
with:
files: TwitchDownloaderCLI/bin/Release/net6.0/publish/LinuxAlpine/TwitchDownloaderCLI
files: "TwitchDownloaderCLI/bin/Release/net6.0/publish/LinuxAlpine"
dest: TwitchDownloaderCLI-${{ github.event.inputs.release_tag }}-LinuxAlpine-x64.zip

- name: Zip LinuxArm CLI
uses: vimtor/action-zip@v1
with:
files: TwitchDownloaderCLI/bin/Release/net6.0/publish/LinuxArm/TwitchDownloaderCLI
files: "TwitchDownloaderCLI/bin/Release/net6.0/publish/LinuxArm"
dest: TwitchDownloaderCLI-${{ github.event.inputs.release_tag }}-LinuxArm.zip

- name: Zip LinuxArm64 CLI
uses: vimtor/action-zip@v1
with:
files: TwitchDownloaderCLI/bin/Release/net6.0/publish/LinuxArm64/TwitchDownloaderCLI
files: "TwitchDownloaderCLI/bin/Release/net6.0/publish/LinuxArm64"
dest: TwitchDownloaderCLI-${{ github.event.inputs.release_tag }}-LinuxArm64.zip

- name: Download URL
Expand Down Expand Up @@ -220,7 +220,7 @@ jobs:
- name: Zip MacOS CLI
uses: vimtor/action-zip@v1
with:
files: TwitchDownloaderCLI/bin/Release/net6.0/publish/MacOS/TwitchDownloaderCLI
files: "TwitchDownloaderCLI/bin/Release/net6.0/publish/MacOS"
dest: TwitchDownloaderCLI-${{ github.event.inputs.release_tag }}-MacOS-x64.zip

- name: Download URL
Expand Down
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ TwitchDownloaderCLI.exe videodownload --id <vod-id-here> -o out.mp4
```
sudo chmod +x TwitchDownloaderCLI
```
6. a) If you do not have ffmpeg, you should install it via your distro package manager, however you can also get it as a standalone file from [ffmpeg.org](https://ffmpeg.org/download.html) or by using TwitchDownloaderCLI:
6. a) If you do not have FFmpeg, you should install it via your distro package manager, however you can also get it as a standalone file from [ffmpeg.org](https://ffmpeg.org/download.html) or by using TwitchDownloaderCLI:
```
./TwitchDownloaderCLI ffmpeg --download
```
Expand All @@ -126,7 +126,7 @@ sudo chmod +x ffmpeg
```
chmod +x TwitchDownloaderCLI
```
4. a) If you do not have ffmpeg, you can install it via [Homebrew package manager](https://brew.sh/), or you can get it as a standalone file from [ffmpeg.org](https://ffmpeg.org/download.html) or by using TwitchDownloaderCLI:
4. a) If you do not have FFmpeg, you can install it via [Homebrew package manager](https://brew.sh/), or you can get it as a standalone file from [ffmpeg.org](https://ffmpeg.org/download.html) or by using TwitchDownloaderCLI:
```
./TwitchDownloaderCLI ffmpeg --download
```
Expand Down Expand Up @@ -181,7 +181,20 @@ cd TwitchDownloaderCLI/bin/Release/net6.0/publish

[MIT](./LICENSE.txt)

# Credits
[Noto Color Emoji](https://github.com/googlefonts/noto-emoji) © Google and contributors.
# Third Party Credits

[Twemoji](https://github.com/twitter/twemoji) © Twitter and contributors.
Chat Renders are rendered with [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.

Chat Renders may use [Noto Color Emoji](https://github.com/googlefonts/noto-emoji) © Google and contributors.

Chat Renders may use [Twemoji](https://github.com/twitter/twemoji) © Twitter and contributors.

Bundled FFmpeg binaries are fetched from [gyan.dev](https://www.gyan.dev/ffmpeg/) © Gyan Doshi.

FFmpeg binaries fetched are runtime are downloaded using [Xabe.FFmpeg.Downloader](https://github.com/tomaszzmuda/Xabe.FFmpeg) © Xabe.

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).
5 changes: 4 additions & 1 deletion TwitchDownloaderCLI/Modes/Arguments/CacheArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ namespace TwitchDownloaderCLI.Modes.Arguments
{

[Verb("cache", HelpText = "Manage the working cache")]
public class CacheArgs
public class CacheArgs : ITwitchDownloaderArgs
{
[Option('c', "clear", Default = false, Required = false, HelpText = "Clears the default cache folder.")]
public bool ClearCache { get; set; }

[Option("force-clear", Default = false, Required = false, HelpText = "Clears the default cache folder, bypassing the confirmation prompt")]
public bool ForceClearCache { get; set; }

[Option("banner", Default = true, HelpText = "Displays a banner containing version and copyright information.")]
public bool? ShowBanner { get; set; }
}
}
9 changes: 6 additions & 3 deletions TwitchDownloaderCLI/Modes/Arguments/ChatDownloadArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace TwitchDownloaderCLI.Modes.Arguments
{

[Verb("chatdownload", HelpText = "Downloads the chat from a VOD or clip")]
public class ChatDownloadArgs
public class ChatDownloadArgs : ITwitchDownloaderArgs
{
[Option('u', "id", Required = true, HelpText = "The ID or URL of the VOD or clip to download that chat of.")]
public string Id { get; set; }
Expand Down Expand Up @@ -40,10 +40,13 @@ public class ChatDownloadArgs
[Option("chat-connections", Default = 4, HelpText = "Number of downloading connections for chat")]
public int ChatConnections { get; set; }

[Option('q', "quiet", Default = false, HelpText = "Suppresses progress console output")]
public bool Quiet { get; set; }
[Option("silent", Default = false, HelpText = "Suppresses progress console output")]
public bool Silent { get; set; }

[Option("temp-path", Default = "", HelpText = "Path to temporary folder to use for cache.")]
public string TempFolder { get; set; }

[Option("banner", Default = true, HelpText = "Displays a banner containing version and copyright information.")]
public bool? ShowBanner { get; set; }
}
}
13 changes: 8 additions & 5 deletions TwitchDownloaderCLI/Modes/Arguments/ChatRenderArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace TwitchDownloaderCLI.Modes.Arguments
{

[Verb("chatrender", HelpText = "Renders a chat JSON as a video")]
public class ChatRenderArgs
public class ChatRenderArgs : ITwitchDownloaderArgs
{
[Option('i', "input", Required = true, HelpText = "Path to JSON chat file input.")]
public string InputFile { get; set; }
Expand Down Expand Up @@ -84,10 +84,10 @@ public class ChatRenderArgs
[Option("update-rate", Default = 0.2, HelpText = "Time in seconds to update chat render output.")]
public double UpdateRate { get; set; }

[Option("input-args", Default = "-framerate {fps} -f rawvideo -analyzeduration {max_int} -probesize {max_int} -pix_fmt {pix_fmt} -video_size {width}x{height} -i -", HelpText = "Input arguments for ffmpeg chat render.")]
[Option("input-args", Default = "-framerate {fps} -f rawvideo -analyzeduration {max_int} -probesize {max_int} -pix_fmt {pix_fmt} -video_size {width}x{height} -i -", HelpText = "Input arguments for FFmpeg chat render.")]
public string InputArgs { get; set; }

[Option("output-args", Default = "-c:v libx264 -preset veryfast -crf 18 -pix_fmt yuv420p \"{save_path}\"", HelpText = "Output arguments for ffmpeg chat render.")]
[Option("output-args", Default = "-c:v libx264 -preset veryfast -crf 18 -pix_fmt yuv420p \"{save_path}\"", HelpText = "Output arguments for FFmpeg chat render.")]
public string OutputArgs { get; set; }

[Option("ignore-users", Default = "", HelpText = "List of usernames to ignore when rendering, separated by commas. Not case-sensitive.")]
Expand All @@ -111,13 +111,13 @@ public class ChatRenderArgs
[Option("emoji-vendor", Default = "notocolor", HelpText = "The emoji vendor used for rendering emojis. Valid values are: 'twitter' / 'twemoji', 'google' / 'notocolor', and 'system' / 'none'.")]
public string EmojiVendor { get; set; }

[Option("ffmpeg-path", HelpText = "Path to ffmpeg executable.")]
[Option("ffmpeg-path", HelpText = "Path to FFmpeg executable.")]
public string FfmpegPath { get; set; }

[Option("temp-path", Default = "", HelpText = "Path to temporary folder to use for cache.")]
public string TempFolder { get; set; }

[Option("verbose-ffmpeg", Default = false, HelpText = "Prints every message from ffmpeg.")]
[Option("verbose-ffmpeg", Default = false, HelpText = "Prints every message from FFmpeg.")]
public bool LogFfmpegOutput { get; set; }

[Option("skip-drive-waiting", Default = false, HelpText = "Do not wait for the output drive to transmit a ready signal before writing the next frame. Waiting is usually only necessary on low-end USB drives.")]
Expand Down Expand Up @@ -152,5 +152,8 @@ public class ChatRenderArgs

[Option("scale-highlight-indent", Default = 1.0, HelpText = "Number to scale highlight indent size (sub messages).")]
public double ScaleAccentIndent { get; set; }

[Option("banner", Default = true, HelpText = "Displays a banner containing version and copyright information.")]
public bool? ShowBanner { get; set; }
}
}
5 changes: 4 additions & 1 deletion TwitchDownloaderCLI/Modes/Arguments/ChatUpdateArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ namespace TwitchDownloaderCLI.Modes.Arguments
{

[Verb("chatupdate", HelpText = "Updates the embedded emotes, badges, bits, and crops of a chat download and/or converts a JSON chat to another format.")]
public class ChatUpdateArgs
public class ChatUpdateArgs : ITwitchDownloaderArgs
{
[Option('i', "input", Required = true, HelpText = "Path to input file. Valid extensions are: .json, .json.gz.")]
public string InputFile { get; set; }
Expand Down Expand Up @@ -42,5 +42,8 @@ public class ChatUpdateArgs

[Option("temp-path", Default = "", HelpText = "Path to temporary folder to use for cache.")]
public string TempFolder { get; set; }

[Option("banner", Default = true, HelpText = "Displays a banner containing version and copyright information.")]
public bool? ShowBanner { get; set; }
}
}
5 changes: 4 additions & 1 deletion TwitchDownloaderCLI/Modes/Arguments/ClipDownloadArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace TwitchDownloaderCLI.Modes.Arguments
{

[Verb("clipdownload", HelpText = "Downloads a clip from Twitch")]
public class ClipDownloadArgs
public class ClipDownloadArgs : ITwitchDownloaderArgs
{
[Option('u', "id", Required = true, HelpText = "The ID or URL of the clip to download.")]
public string Id { get; set; }
Expand All @@ -17,5 +17,8 @@ public class ClipDownloadArgs

[Option("bandwidth", Default = -1, HelpText = "The maximum bandwidth the clip downloader is allowed to use in kibibytes per second (KiB/s), or -1 for no maximum.")]
public int ThrottleKib { get; set; }

[Option("banner", Default = true, HelpText = "Displays a banner containing version and copyright information.")]
public bool? ShowBanner { get; set; }
}
}
7 changes: 5 additions & 2 deletions TwitchDownloaderCLI/Modes/Arguments/FfmpegArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ namespace TwitchDownloaderCLI.Modes.Arguments
{

[Verb("ffmpeg", HelpText = "Manage standalone ffmpeg")]
public class FfmpegArgs
public class FfmpegArgs : ITwitchDownloaderArgs
{
[Option('d', "download", Default = false, Required = false, HelpText = "Downloads ffmpeg as a standalone file.")]
[Option('d', "download", Default = false, Required = false, HelpText = "Downloads FFmpeg as a standalone file.")]
public bool DownloadFfmpeg { get; set; }

[Option("banner", Default = true, HelpText = "Displays a banner containing version and copyright information.")]
public bool? ShowBanner { get; set; }
}
}
8 changes: 8 additions & 0 deletions TwitchDownloaderCLI/Modes/Arguments/ITwitchDownloaderArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
namespace TwitchDownloaderCLI.Modes.Arguments
{
public interface ITwitchDownloaderArgs
{
// TODO: Mode --silent here
public bool? ShowBanner { get; set; }
}
}
7 changes: 5 additions & 2 deletions TwitchDownloaderCLI/Modes/Arguments/VideoDownloadArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ namespace TwitchDownloaderCLI.Modes.Arguments
{

[Verb("videodownload", HelpText = "Downloads a stream VOD from Twitch")]
public class VideoDownloadArgs
public class VideoDownloadArgs : ITwitchDownloaderArgs
{
[Option('u', "id", Required = true, HelpText = "The ID or URL of the VOD to download.")]
public string Id { get; set; }
Expand All @@ -30,10 +30,13 @@ public class VideoDownloadArgs
[Option("oauth", HelpText = "OAuth access token to download subscriber only VODs. DO NOT SHARE THIS WITH ANYONE.")]
public string Oauth { get; set; }

[Option("ffmpeg-path", HelpText = "Path to ffmpeg executable.")]
[Option("ffmpeg-path", HelpText = "Path to FFmpeg executable.")]
public string FfmpegPath { get; set; }

[Option("temp-path", Default = "", HelpText = "Path to temporary caching folder.")]
public string TempFolder { get; set; }

[Option("banner", Default = true, HelpText = "Displays a banner containing version and copyright information.")]
public bool? ShowBanner { get; set; }
}
}
2 changes: 1 addition & 1 deletion TwitchDownloaderCLI/Modes/DownloadChat.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private static ChatDownloadOptions GetDownloadOptions(ChatDownloadArgs inputOpti
Compression = inputOptions.Compression,
TimeFormat = inputOptions.TimeFormat,
ConnectionCount = inputOptions.ChatConnections,
Quiet = inputOptions.Quiet,
Silent = inputOptions.Silent,
BttvEmotes = (bool)inputOptions.BttvEmotes!,
FfzEmotes = (bool)inputOptions.FfzEmotes!,
StvEmotes = (bool)inputOptions.StvEmotes!,
Expand Down
Loading

0 comments on commit a212fa3

Please sign in to comment.