From 4c4b4934b1b3f0bbfe994198630f36ba67065e8d Mon Sep 17 00:00:00 2001 From: ScrubN <72096833+ScrubN@users.noreply.github.com> Date: Sat, 6 Jan 2024 01:29:30 -0500 Subject: [PATCH] Fix VODs failing to download from VOD or URL mass downloader --- TwitchDownloaderCore/Extensions/M3U8Extensions.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/TwitchDownloaderCore/Extensions/M3U8Extensions.cs b/TwitchDownloaderCore/Extensions/M3U8Extensions.cs index afb4dd44..2a5371aa 100644 --- a/TwitchDownloaderCore/Extensions/M3U8Extensions.cs +++ b/TwitchDownloaderCore/Extensions/M3U8Extensions.cs @@ -32,6 +32,11 @@ public static M3U8.Stream GetStreamOfQuality(this M3U8 m3u8, string qualityStrin throw new ArgumentException(nameof(m3u8), "M3U8 does not contain any streams."); } + if (qualityString is null) + { + return streams.MaxBy(x => x.StreamInfo.Resolution.Width * x.StreamInfo.Resolution.Height * x.StreamInfo.Framerate); + } + if (qualityString.Contains("audio", StringComparison.OrdinalIgnoreCase) && streams.FirstOrDefault(x => x.MediaInfo.Name.Contains("audio", StringComparison.OrdinalIgnoreCase)) is { } audioStream) {