omansak / libvideo

A lightweight .NET library to download YouTube videos.
BSD 2-Clause "Simplified" License
553 stars 163 forks source link

1080 video downloading without sound #209

Closed EdwinCloud101 closed 3 years ago

EdwinCloud101 commented 3 years ago

I came across this code that works but there is no sound. I searched for old github issues and it seems it was supposed to be fixed in the 3.0 version from 2019.

thanks

            string link = "https://www.youtube.com/watch?v=OT2b5KzMoC0";

            var youTube = YouTube.Default; // starting point for YouTube actions
            var videoInfos = youTube.GetAllVideosAsync(link).GetAwaiter().GetResult();
            var maxResolution = videoInfos.First(i => i.Resolution == videoInfos.Max(j => j.Resolution));
            File.WriteAllBytes(@"C:\" + maxResolution.FullName, maxResolution.GetBytes());
omansak commented 3 years ago

its youtube problem you cant download audio+video for new videos. you should mix them with like ffmpeg