【发布时间】:2017-04-20 10:45:13
【问题描述】:
我正在尝试使用 YoutubeExtractor 从 youtube 下载音频,但如果单击按钮,我会得到“序列没有元素”的信息。我该如何解决?
private void button2_Click(object sender, EventArgs e)
{
try
{
IEnumerable<VideoInfo> videos = DownloadUrlResolver.GetDownloadUrls(textBox1.Text);
VideoInfo video = videos.Where(info => info.CanExtractAudio).OrderByDescending(info => info.AudioBitrate).First();
if (video.RequiresDecryption)
{
DownloadUrlResolver.DecryptDownloadUrl(video);
}
AudioDownloader download = new AudioDownloader(video, Path.Combine(Application.StartupPath + "\\", video.Title + video.AudioExtension));
download.Execute();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
【问题讨论】:
-
您知道 YoutubeExtractor 音频提取目前仅适用于 Flash 视频吗?
-
我想做上面的代码还需要在这个东西上安装什么类型的库