0

我试图用 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("./")

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

4

1 回答 1

1

我也遇到了这个问题,我pip install pytubetemp以前解决过(不要改import行)

于 2019-04-25T17:03:18.037 回答