diff --git a/TwitchDownloaderCore/Extensions/M3U8Extensions.cs b/TwitchDownloaderCore/Extensions/M3U8Extensions.cs index d2db63cc..29571e15 100644 --- a/TwitchDownloaderCore/Extensions/M3U8Extensions.cs +++ b/TwitchDownloaderCore/Extensions/M3U8Extensions.cs @@ -32,7 +32,7 @@ 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) + if (string.IsNullOrWhiteSpace(qualityString)) { return m3u8.BestQualityStream(); } diff --git a/TwitchDownloaderCore/Tools/M3U8.cs b/TwitchDownloaderCore/Tools/M3U8.cs index 900b5470..7a9cf883 100644 --- a/TwitchDownloaderCore/Tools/M3U8.cs +++ b/TwitchDownloaderCore/Tools/M3U8.cs @@ -1,6 +1,5 @@ using System; using System.Collections.Generic; -using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Text; diff --git a/TwitchDownloaderCore/VideoDownloader.cs b/TwitchDownloaderCore/VideoDownloader.cs index 49a21527..5ab1a333 100644 --- a/TwitchDownloaderCore/VideoDownloader.cs +++ b/TwitchDownloaderCore/VideoDownloader.cs @@ -56,7 +56,7 @@ public async Task DownloadAsync(CancellationToken cancellationToken) GqlVideoChapterResponse videoChapterResponse = await TwitchHelper.GetOrGenerateVideoChapters(downloadOptions.Id, videoInfoResponse.data.video); - var qualityPlaylist = await GetQualityPlaylist(videoInfoResponse); + var qualityPlaylist = await GetQualityPlaylist(); var playlistUrl = qualityPlaylist.Path; var baseUrl = new Uri(playlistUrl[..(playlistUrl.LastIndexOf('/') + 1)], UriKind.Absolute); @@ -556,7 +556,7 @@ private static Range GetStreamListCrop(IList streamList, VideoDownl return new Range(startIndex, endIndex); } - private async Task GetQualityPlaylist(GqlVideoResponse videoInfo) + private async Task GetQualityPlaylist() { GqlVideoTokenResponse accessToken = await TwitchHelper.GetVideoToken(downloadOptions.Id, downloadOptions.Oauth);