首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >我在做youtube视频下载程序,但是pytube出错了

我在做youtube视频下载程序,但是pytube出错了
EN

Stack Overflow用户
提问于 2021-08-27 16:01:00
回答 1查看 1.2K关注 0票数 1
代码语言:javascript
运行
复制
from pytube import YouTube

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

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

我得到了这个错误:

代码语言:javascript
运行
复制
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

在处理上述异常的过程中,发生了另一个异常:

代码语言:javascript
运行
复制
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
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-08-28 07:13:16

此问题已在最新版本中得到解决,因此请升级到以下最新版本

代码语言:javascript
运行
复制
python3 -m pip install --upgrade pytube

或在窗户上

代码语言:javascript
运行
复制
python -m pip install --upgrade pytube
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/68956373

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档