Skip to content

Commit

Permalink
Fix clip parsing and download issues
Browse files Browse the repository at this point in the history
  • Loading branch information
lay295 committed Aug 30, 2020
1 parent 4298ce5 commit 7da8d10
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,15 @@ https://www.youtube.com/watch?v=0W3MhfhnYjk
## Things still needed to be done
- Fix bugs that slipped by
- More options for chat rendering

## Linux? MacOS?
Sorry the GUI version is only avaliable for Windows :( but there is a command line version avaliable.
This is a cross platform client that can do the main functions of the program without a GUI. It works on Windows and Linux, haven't tested it on MacOS though.
[Some documentation here](https://github.com/lay295/TwitchDownloader/blob/master/TwitchDownloaderCLI/README.md), for example, you could copy/paste this into a .bat file on Windows and you can download a VOD, download chat, then render it in a single go. I've never really made a command line utility before, so things may change in the future. If you're on Linux, make sure fontconfig and libfontconfig1 are installed. (apt-get install fontconfig libfontconfig1)
```
@echo off
set /p vodid="Enter VOD ID: "
TwitchDownloaderCLI -m VideoDownload --id %vodid% --ffmpeg-path "ffmpeg.exe" -o %vodid%.mp4
TwitchDownloaderCLI -m ChatDownload --id %vodid% -o %vodid%_chat.json
TwitchDownloaderCLI -m ChatRender -i %vodid%_chat.json -h 1080 -w 422 --framerate 30 --update-rate 0 --font-size 18 -o %vodid%_chat.mp4
```
6 changes: 3 additions & 3 deletions TwitchDownloaderCLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ private static void DownloadClip(Options inputOptions)
{
ClipDownloadOptions downloadOptions = new ClipDownloadOptions();

if (inputOptions.Id == "" || inputOptions.Id.Any(x => !Char.IsLetter(x)))
if (inputOptions.Id == "" || inputOptions.Id.All(Char.IsDigit))
{
Console.WriteLine("[ERROR] - Invalid Clip ID, unable to parse. Must be only letters.");
Console.WriteLine("[ERROR] - Invalid Clip ID, unable to parse.");
Environment.Exit(1);
}

Expand All @@ -116,7 +116,7 @@ private static void DownloadChat(Options inputOptions)
{
ChatDownloadOptions downloadOptions = new ChatDownloadOptions();

if (inputOptions.Id == "" || (!inputOptions.Id.All(Char.IsLetter) && !inputOptions.Id.All(Char.IsDigit)))
if (inputOptions.Id == "")
{
Console.WriteLine("[ERROR] - Invalid ID, unable to parse.");
Environment.Exit(1);
Expand Down
2 changes: 1 addition & 1 deletion TwitchDownloaderWPF/PageChatDownload.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ private async void btnDownload_Click(object sender, RoutedEventArgs e)
}
else
{
downloadOptions.Id = videoData["vod"]["id"].ToString();
downloadOptions.Id = downloadId;
}

ChatDownloader currentDownload = new ChatDownloader(downloadOptions);
Expand Down

0 comments on commit 7da8d10

Please sign in to comment.