Improved song bitrate from youtube

This commit is contained in:
Kwoth 2016-11-12 16:44:31 +01:00
parent df07fbaffa
commit 25735a679f

View File

@ -337,7 +337,7 @@ namespace NadekoBot.Modules.Music.Classes
var allVideos = await Task.Run(async () => { try { return await YouTube.Default.GetAllVideosAsync(link).ConfigureAwait(false); } catch { return Enumerable.Empty<YouTubeVideo>(); } }).ConfigureAwait(false);
var videos = allVideos.Where(v => v.AdaptiveKind == AdaptiveKind.Audio);
var video = videos
.Where(v => v.AudioBitrate < 192)
.Where(v => v.AudioBitrate < 256)
.OrderByDescending(v => v.AudioBitrate)
.FirstOrDefault();