-1
我试图使用YoutubeExtractor从YouTube下载音频,但如果单击按钮我有信息“序列没有元素”。我该如何解决它?从YouTube下载音频c#
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视频吗? – Jim