我正在制作youtube视频下载程序,但pytube给出了错误信息

2024-09-28 17:04:16 发布

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

from pytube import YouTube

yt = YouTube('https://www.youtube.com/watch?v=yVcjVsk29XQ')

streams = yt.streams.filter(adaptive=True)

我得到这个错误:

Traceback (most recent call last):
  File "C:\Users\Sanskar\PythonProjects\venv\lib\site-packages\pytube\__main__.py", line 170, in fmt_streams
    extract.apply_signature(stream_manifest, self.vid_info, self.js)
  File "C:\Users\Sanskar\PythonProjects\venv\lib\site-packages\pytube\extract.py", line 409, in apply_signature
    cipher = Cipher(js=js)
  File "C:\Users\Sanskar\PythonProjects\venv\lib\site-packages\pytube\cipher.py", line 43, in __init__
    self.throttling_plan = get_throttling_plan(js)
  File "C:\Users\Sanskar\PythonProjects\venv\lib\site-packages\pytube\cipher.py", line 387, in get_throttling_plan
    raw_code = get_throttling_function_code(js)
  File "C:\Users\Sanskar\PythonProjects\venv\lib\site-packages\pytube\cipher.py", line 293, in get_throttling_function_code
    name = re.escape(get_throttling_function_name(js))
  File "C:\Users\Sanskar\PythonProjects\venv\lib\site-packages\pytube\cipher.py", line 278, in get_throttling_function_name
    raise RegexMatchError(
pytube.exceptions.RegexMatchError: get_throttling_function_name: could not find match for multiple

在处理上述异常期间,发生了另一个异常:

Traceback (most recent call last):
  File "C:\Users\Sanskar\PythonProjects\YtDownload\yt.py", line 5, in <module>
    streams = yt.streams.filter(adaptive=True)
  File "C:\Users\Sanskar\PythonProjects\venv\lib\site-packages\pytube\__main__.py", line 285, in streams
    return StreamQuery(self.fmt_streams)
  File "C:\Users\Sanskar\PythonProjects\venv\lib\site-packages\pytube\__main__.py", line 177, in fmt_streams
    extract.apply_signature(stream_manifest, self.vid_info, self.js)
  File "C:\Users\Sanskar\PythonProjects\venv\lib\site-packages\pytube\extract.py", line 409, in apply_signature
    cipher = Cipher(js=js)
  File "C:\Users\Sanskar\PythonProjects\venv\lib\site-packages\pytube\cipher.py", line 43, in __init__
    self.throttling_plan = get_throttling_plan(js)
  File "C:\Users\Sanskar\PythonProjects\venv\lib\site-packages\pytube\cipher.py", line 387, in get_throttling_plan
    raw_code = get_throttling_function_code(js)
  File "C:\Users\Sanskar\PythonProjects\venv\lib\site-packages\pytube\cipher.py", line 293, in get_throttling_function_code
    name = re.escape(get_throttling_function_name(js))
  File "C:\Users\Sanskar\PythonProjects\venv\lib\site-packages\pytube\cipher.py", line 278, in get_throttling_function_name
    raise RegexMatchError(
pytube.exceptions.RegexMatchError: get_throttling_function_name: could not find match for multiple

Tags: inpygetvenvlibpackageslinejs