libvideo
libvideo copied to clipboard
Flie is not working
Something is wrong with GetBytes function.
I have tried the following code and it saved the file but the file can't be played:
var url = "https://www.youtube.com/watch?v=Sf5XYmNlhpY";
var youtube = YouTube.Default;
var videos = youtube.GetAllVideos(url).ToList();
var videosMP4 = videos.Where(video => video.AdaptiveKind == AdaptiveKind.Video && video.Format == VideoFormat.Mp4).OrderByDescending(video => video.Resolution).ToList();
var video = videosMP4.First();
File.WriteAllBytes(video.FullName, video.GetBytes());
Any idea?