public async Task <string> GetMuxedSource(string url)
        {
            if (url != currentUrl)
            {
                video = await youtubeClient.Videos.GetAsync(url).ConfigureAwait(false);

                streamManifest = await youtubeClient.Videos.Streams.GetManifestAsync(video.Id).ConfigureAwait(false);

                currentUrl = url;
            }

            foreach (var videoStreamInfo in streamManifest.GetMuxedStreams())
            {
                if (videoStreamInfo.VideoResolution.Height == 720)
                {
                    return(videoStreamInfo.Url);
                }
            }
            foreach (var videoStreamInfo in streamManifest.GetMuxedStreams())
            {
                if (videoStreamInfo.VideoResolution.Height == 480)
                {
                    return(videoStreamInfo.Url);
                }
            }
            foreach (var videoStreamInfo in streamManifest.GetMuxedStreams())
            {
                if (videoStreamInfo.VideoResolution.Height == 360)
                {
                    return(videoStreamInfo.Url);
                }
            }
            return(null);
        }
        public override async Task <List <StreamInfo> > GetVideoList(string url)
        {
            if (url != currentUrl)
            {
                video = await youtubeClient.Videos.GetAsync(url).ConfigureAwait(false);

                streamManifest = await youtubeClient.Videos.Streams.GetManifestAsync(video.Id).ConfigureAwait(false);

                currentUrl = url;
            }

            List <StreamInfo> videoList = new List <StreamInfo>();
            string            displayValue;

            foreach (var videoStreamInfo in streamManifest.GetVideoOnlyStreams())
            {
                string videoCodec;
                if (videoStreamInfo.VideoCodec.Contains("avc"))
                {
                    videoCodec = "h264";
                }
                else if (videoStreamInfo.VideoCodec.Contains("av01"))
                {
                    videoCodec = "av1";
                }
                else
                {
                    videoCodec = videoStreamInfo.VideoCodec;
                }
                displayValue = $"{videoStreamInfo.VideoQuality.Label} ({videoCodec}) - {videoStreamInfo.Size.Bytes.ToBytesString()}";
                videoList.Add(new StreamInfo(videoStreamInfo.Url, false, video.Title, displayValue, videoStreamInfo.Size.Bytes));
            }
            foreach (var audioStreamInfo in streamManifest.GetAudioOnlyStreams())
            {
                string audioCodec = audioStreamInfo.AudioCodec.Replace("mp4a.40.2", "aac");
                displayValue = $"{audioStreamInfo.Bitrate.BitsPerSecond / 1000} Kbps ({audioCodec}) - {audioStreamInfo.Size.Bytes.ToBytesString()}";
                videoList.Add(new StreamInfo(audioStreamInfo.Url, true, video.Title, displayValue, audioStreamInfo.Size.Bytes));
            }
            videoList.Sort((x, y) => { return(y.Size.CompareTo(x.Size)); });
            return(videoList);
        }