libvideo icon indicating copy to clipboard operation
libvideo copied to clipboard

Flie is not working

Open noammaoz opened this issue 4 months ago • 4 comments

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?

noammaoz avatar Oct 09 '24 07:10 noammaoz