设置已提取的YouTube视频的分辨率

时间:2016-06-20 15:46:09

标签: c# .net youtube

我使用了来自this GitHub project的示例代码。当我将info.Resolution == 360更改为480或其他时,下载的视频没有声音,只有视频。如何正确更改视频的分辨率?

VideoInfo video = videoInfos.First(info => info.VideoType == VideoType.Mp4 && info.Resolution == 360);
DownloadUrlResolver.DecryptDownloadUrl(video);
var videoDownloader = new VideoDownloader(video, Path.Combine("D:/Downloads", video.Title + video.VideoExtension));
videoDownloader.Execute();

1 个答案:

答案 0 :(得分:0)

您是否考虑过切换到libvideo?请参阅comparison with YouTubeExtractor。 libvideo的文档是available in the GitHub repo

通过阅读issue #31

,您的问题可以解决(提供切换)
var videos = YouTube.Default.GetAllVideos("YOUR_URL");
var @480p = videos.FirstOrDefault(v => v.Resolution == 480);