【发布时间】: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
【问题讨论】:
-
请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如目前所写的那样,很难准确地说出你在问什么。