From f78df5b07f68068c9ddfc970e928d63b04984519 Mon Sep 17 00:00:00 2001 From: Elwador <75888166+Elwador@users.noreply.github.com> Date: Wed, 19 Jun 2024 11:09:55 +0200 Subject: [PATCH] Add - Additional checks for missing files Fix - Video quality check typo --- CRD/Downloader/Crunchyroll.cs | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/CRD/Downloader/Crunchyroll.cs b/CRD/Downloader/Crunchyroll.cs index eb3a27f..c46e1dc 100644 --- a/CRD/Downloader/Crunchyroll.cs +++ b/CRD/Downloader/Crunchyroll.cs @@ -549,6 +549,17 @@ public class Crunchyroll{ ErrorText = "Missing ffmpeg" }; } + + if (!File.Exists(CfgManager.PathMKVMERGE)){ + Console.Error.WriteLine("Missing Mkvmerge"); + MainWindow.Instance.ShowError("Mkvmerge not found"); + return new DownloadResponse{ + Data = new List(), + Error = true, + FileName = "./unknown", + ErrorText = "Missing Mkvmerge" + }; + } if (!_widevine.canDecrypt){ Console.Error.WriteLine("L3 key files missing"); @@ -560,6 +571,17 @@ public class Crunchyroll{ ErrorText = "Missing L3 Key" }; } + + if (!File.Exists(CfgManager.PathMP4Decrypt)){ + Console.Error.WriteLine("mp4decrypt not found"); + MainWindow.Instance.ShowError("Can't find mp4decrypt in lib folder "); + return new DownloadResponse{ + Data = new List(), + Error = true, + FileName = "./unknown", + ErrorText = "Missing mp4decrypt" + }; + } string mediaName = $"{data.SeasonTitle} - {data.EpisodeNumber} - {data.EpisodeTitle}"; string fileName = ""; @@ -864,7 +886,7 @@ public class Crunchyroll{ } else if (options.QualityVideo == "worst"){ chosenVideoQuality = 1; } else{ - var tempIndex = videos.FindIndex(a => a.quality.height + "" == options.QualityAudio); + var tempIndex = videos.FindIndex(a => a.quality.height + "" == options.QualityVideo); if (tempIndex < 0){ chosenVideoQuality = videos.Count; } else{