libvideo
libvideo copied to clipboard
GetAllVideos not working
I have upgraded to the new version the GetAllVideos function is not working. The following is my code: var url = "https://www.youtube.com/watch?v=Sf5XYmNlhpY"; var youtube = YouTube.Default; var videos = youtube.GetAllVideos(url).ToList(); var audios = videos.Where(video => video.AdaptiveKind == AdaptiveKind.Audio).OrderByDescending(video => video.AudioBitrate).ToList(); var audio = audios.First();
if (audio != null && audio.Format == VideoFormat.Mp4) {
var bSong = audio.GetBytes();
MessageBox.Show("Audio File");
} else {
var video = youtube.GetVideo(url);
var bSong = video.GetBytes();
MessageBox.Show("video File");
}
Getting the video only is working fine: var video = youtube.GetVideo(url); var bSong = video.GetBytes();
Any idea why it's not working?