python - pytube.exceptions.RegexMatchError:正则表达式有0个匹配项

标签 python youtube playlist pytube

我试图用pytube制作youtube播放列表下载器,但无论我如何尝试,我都会

  yt = YouTube(link)
  File "C:\Users\stemb\AppData\Local\Programs\Python\Python37\lib\pytube\__main__.py", line 88, in __init__
    self.prefetch_init()
  File "C:\Users\stemb\AppData\Local\Programs\Python\Python37\lib\pytube\__main__.py", line 96, in prefetch_init
    self.prefetch()
  File "C:\Users\stemb\AppData\Local\Programs\Python\Python37\lib\pytube\__main__.py", line 170, in prefetch
    age_restricted=self.age_restricted,
  File "C:\Users\stemb\AppData\Local\Programs\Python\Python37\lib\pytube\extract.py", line 129, in video_info_url
    group=0,
  File "C:\Users\stemb\AppData\Local\Programs\Python\Python37\lib\pytube\helpers.py", line 65, in regex_search
    .format(pattern=pattern),
  pytube.exceptions.RegexMatchError: regex pattern (\W[\'"]?t[\'"]?: ?[\'"](.+?)[\'"]) had zero matches

我的代码是
from pytube import Playlist

pl = Playlist("https://www.youtube.com/watch?v=HkjMtpD6EkE&list=PLWOXYsio2bGZJcBDPTsQVtYaPMe_akEsu")
pl.download_all("./")

请告知该怎么办,我们将不胜感激。

最佳答案

我也有这个问题,我用pip install pytubetemp解决了(不要更改导入行)

关于python - pytube.exceptions.RegexMatchError:正则表达式有0个匹配项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55852918/

相关文章:

python - Nginx 和 flask 静态目录 - CSS 链接不正确

django - 夹层Pagedown嵌入YouTube视频

python - 查看python帮助时如何退出帮助(os.listdir)

python - 通过HTTP连接获取YouTube搜索结果

python - 将 youtube_dl 基本嵌入到 Python 3.4 脚本中的问题

wordpress - 嵌入式 Spotify 播放列表中没有播放按钮

mysql - 存储播放列表中视频的顺序

search - Youtube api v3,playlist.list不是最新的,也不是发布日期的顺序。

python - Google App Engine 内存使用率异常高

python - 将 for 循环应用于 Pandas 中的多个 DataFrame