我可以尝试找到不同格式的youtube视频。正在使用pytube流筛选器,但它给出了一个错误pytube.exceptions.RegexMatchError
from pytube import YouTube
url = input('Enter url :')
link = YouTube(url)
print(link.title)
obj = link.streams.filter(progressive="True")
print(obj)
以下给出了此错误:
Traceback (most recent call last):
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/__main__.py", line 170, in fmt_streams
extract.apply_signature(stream_manifest, self.vid_info, self.js)
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/extract.py", line 409, in apply_signature
cipher = Cipher(js=js)
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/cipher.py", line 43, in __init__
self.throttling_plan = get_throttling_plan(js)
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/cipher.py", line 387, in get_throttling_plan
raw_code = get_throttling_function_code(js)
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/cipher.py", line 293, in get_throttling_function_code
name = re.escape(get_throttling_function_name(js))
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/cipher.py", line 279, in get_throttling_function_name
caller="get_throttling_function_name", pattern="multiple"
pytube.exceptions.RegexMatchError: get_throttling_function_name: could not find match for multiple
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "main.py", line 44, in <module>
yt = myVideo.streams.filter(type='mp4')
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/__main__.py", line 285, in streams
return StreamQuery(self.fmt_streams)
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/__main__.py", line 177, in fmt_streams
extract.apply_signature(stream_manifest, self.vid_info, self.js)
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/extract.py", line 409, in apply_signature
cipher = Cipher(js=js)
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/cipher.py", line 43, in __init__
self.throttling_plan = get_throttling_plan(js)
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/cipher.py", line 387, in get_throttling_plan
raw_code = get_throttling_function_code(js)
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/cipher.py", line 293, in get_throttling_function_code
name = re.escape(get_throttling_function_name(js))
File "/home/jay/PycharmProjects/videoinfo/venv/lib/python3.7/site-packages/pytube/cipher.py", line 279, in get_throttling_function_name
caller="get_throttling_function_name", pattern="multiple"
pytube.exceptions.RegexMatchError: get_throttling_function_name: could not find match for multiple
我还可以使用“pip-install-git”重新安装pytube+https://github.com/nficano/pytube.git“以及”pip安装pytube”。但错误仍然存在
您可以安装:
或者您可以在pytube/cipher.py中更改:
到
在def get_throttling_函数中\u name(js:str)->;str:函数
相关问题 更多 >
编程相关推荐