From 7da8d1011007b017111de175dfbdfcfb3e4f5187 Mon Sep 17 00:00:00 2001 From: lay295 Date: Sun, 30 Aug 2020 18:02:42 -0400 Subject: [PATCH] Fix clip parsing and download issues --- README.md | 12 ++++++++++++ TwitchDownloaderCLI/Program.cs | 6 +++--- TwitchDownloaderWPF/PageChatDownload.xaml.cs | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index eff217f8..aef43041 100644 --- a/README.md +++ b/README.md @@ -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 +``` \ No newline at end of file diff --git a/TwitchDownloaderCLI/Program.cs b/TwitchDownloaderCLI/Program.cs index 25e15666..7c0bc13a 100644 --- a/TwitchDownloaderCLI/Program.cs +++ b/TwitchDownloaderCLI/Program.cs @@ -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); } @@ -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); diff --git a/TwitchDownloaderWPF/PageChatDownload.xaml.cs b/TwitchDownloaderWPF/PageChatDownload.xaml.cs index c5e19ceb..cd405262 100644 --- a/TwitchDownloaderWPF/PageChatDownload.xaml.cs +++ b/TwitchDownloaderWPF/PageChatDownload.xaml.cs @@ -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);