gpt4 book ai didi

c# - 图书馆youtubeExtractor给我一个错误

转载 作者:行者123 更新时间:2023-12-03 05:53:08 25 4
gpt4 key购买 nike

我正在尝试制作一个使用youtubeExtractor library从YouTube下载视频的应用程序。该代码没有错误,但是当我单击下载时,它给了我这个错误:

YoutubeExtractor.VideoNotAvailableException: Video is removed or has an age restriction.



using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Web;
using System.Net;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using YoutubeExtractor;
using VideoExtractor;

namespace Url_DownLoad
{

public partial class Url_DownLoad : Form
{

public Url_DownLoad()
{

InitializeComponent();
}

private void Url_DownLoad_Load(object sender, EventArgs e)
{

//WebClient client = new WebClient();
//client.DownloadProgressChanged += new DownloadProgressChangedEventHandler(client_DownloadProgressChanged);
//client.DownloadFileCompleted += new AsyncCompletedEventHandler(client_DownloadFileCompleted);
}
private void Btn_Scarica_Click(object sender, EventArgs e)
{

Download();
}
void Download()
{
IEnumerable <VideoInfo> videos = DownloadUrlResolver.GetDownloadUrls(Txt_Url.Text);
VideoInfo vi = videos.First(info => info.VideoType == VideoType.Mp4 && info.Resolution == Convert.ToInt32(360));
if (vi.RequiresDecryption)
{
DownloadUrlResolver.DecryptDownloadUrl(vi);
}
var videodownload = new VideoDownloader(vi, @"C: \Users\Nicola\Desktop\" + vi.Title + vi.VideoExtension);
videodownload.DownloadFinished += Videodownload_DownloadFinished;

videodownload.Execute();
}
void Videodownload_DownloadFinished(object s,EventArgs e)
{
MessageBox.Show("DownLoad Terminato");
}
//void client_DownloadProgressChanged(object sender, DownloadProgressChangedEventArgs e)
//{
// progressBar1.Maximum = (int) e.TotalBytesToReceive / 100;
// progressBar1.Value = (int) e.BytesReceived / 100;
//}

}
}

最佳答案

GitHub issue所述,显然库中存在一个错误。

关于c# - 图书馆youtubeExtractor给我一个错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61268624/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com