为了账号安全,请及时绑定邮箱和手机立即绑定

Youtube_dl:错误:YouTube 说:无法提取视频数据

Youtube_dl:错误:YouTube 说:无法提取视频数据

千万里不及你 2023-07-27 13:54:17
我正在使用 Python 3 制作一个小图形界面,它应该下载一个 youtube 视频及其 URL。我youtube_dl为此使用了该模块。这是我的代码:import youtube_dl # Youtube_dl is used for download the videoydl_opt = {"outtmpl" : "/videos/%(title)s.%(ext)s", "format": "bestaudio/best"} # Here we give some advanced settings. outtmpl is used to define the path of the video that we are going to downloaddef operation(link):    """    Start the download operation    """    try:        with youtube_dl.YoutubeDL(ydl_opt) as yd: # The method YoutubeDL() take one argument which is a dictionary for changing default settings            video = yd.download([link]) # Start the download        result.set("Your video has been downloaded !")    except Exception:        result.set("Sorry, we got an error.")operation("https://youtube.com/watch?v=...")当我执行我的代码时,出现以下错误:ERROR: YouTube said: Unable to extract video data我看到这里是因为没有找到任何视频信息,我该如何解决这个问题?
查看完整描述

目前暂无任何回答

  • 0 回答
  • 0 关注
  • 95 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信