【问题标题】:I was making a youtube video downloader but pytube is giving error [closed]我正在制作一个 youtube 视频下载器,但 pytube 出现错误 [关闭]
【发布时间】:2021-08-27 16:01:00
【问题描述】:
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

【问题讨论】:

  • 请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。

标签: python pytube


【解决方案1】:

这个问题已经在最新版本中解决了 所以像这样升级到最新版本

python3 -m pip install --upgrade pytube

或在窗户上

python -m pip install --upgrade pytube

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-08-12
    • 1970-01-01
    • 2021-10-03
    • 2022-06-18
    • 2022-11-18
    • 2011-01-30
    相关资源
    最近更新 更多