Skip to content

Commit

Permalink
Fix VODs failing to download from VOD or URL mass downloader
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrubN committed Jan 6, 2024
1 parent 9de9db3 commit 4c4b493
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions TwitchDownloaderCore/Extensions/M3U8Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down

0 comments on commit 4c4b493

Please sign in to comment.