Pytube错误。AttributeError:“非类型”对象没有“下载”属性

2024-05-23 13:43:31 发布

您现在位置:Python中文网/ 问答频道 /正文

嗨,我正在使用python youtube下载程序,这是一项非常简单的任务。我使用pytube有一段时间了,从未遇到过这个错误。我的代码如下:

from pytube import YouTube
import pytube
yt_title = YouTube('https://www.youtube.com/watch?v=ZjDZrReZ4EI').title
ytd = YouTube('https://www.youtube.com/watch?v=ZjDZrReZ4EI').streams.first().download()

im获取的错误消息是:

Traceback (most recent call last):
  File ".\test.py", line 5, in <module>
    ytd = YouTube('https://www.youtube.com/watch?v=ZjDZrReZ4EI').streams.first().download()
AttributeError: 'NoneType' object has no attribute 'download'

这些是特殊情况:

Name: pytube
Version: 10.0.0
Summary: Python 3 library for downloading YouTube Videos.
Home-page: https://github.com/nficano/pytube
Author: Nick Ficano, Harold Martin
Author-email: nficano@gmail.com, harold.martin@gmail.com
License: MIT
Location: 'location of the package'
Requires: typing-extensions
Required-by:

im使用的视频为: https://www.youtube.com/watch?v=ZjDZrReZ4EI

我意识到一些我在几个小时前就可以下载的视频现在我无法下载了

我刚刚卸载了pytube并安装了pytube3。但现在我得到了以下错误:

pytube.exceptions.RegexMatchError: get_ytplayer_config: could not find match 
for config_patterns

它不允许我下载任何视频


Tags: httpsimportcom视频titleyoutubedownloadwww