Closed Dei11 closed 3 years ago
Hey,
i had the same problem like yours and found a solution.
var youtube = YouTube.Default;
var video = youtube.GetVideo(url);
string title = video.Title;
var videos = youtube.GetAllVideosAsync(url).GetAwaiter().GetResult();
var maxResolution = videos.First(i => i.Resolution == 1080);
var bytes = maxResolution.GetBytesAsync();
var contents = await maxResolution.GetBytesAsync();
File.WriteAllBytes(path + "/" + title + "mp4", contents);
(Note that you replace the path with your path!)
Regards