使用Pytube模块时,我会遇到此错误。如何求解Pytube的错误?
from pytube import YouTube
url="https://youtu.be/N2TW4cko1DM"
video=YouTube(url)
print(video.title)
for stream in video.streams():
print(stream)
跑步:
RegexMatchError Trackback(最近的最新呼叫)file/data/user/0/ru.iiec.iec.pydroid3/files/arm-linux-androideabi/lib/python3.9/site-packages/pytages/pytytube/ main main < /strong>:181,在youtube.fmt_streams(self)180尝试: - &gt; 181 extract.apply_signature(stream_manifest,self.vid_info,self.js)182例外。ExtracterRor:183#要强制对JS文件的更新,我们清除了缓存和重试文件/data/data/data/user/0/ru.iiec。 pydroid3/files/arm-linux-androideabi/lib/python3.9/site-packages/pytube/extract.py:409,在apply_signature(stream_manifest,vid_info,vid_info,js)401 401“ 401” 401“”“”将解密的签名应用于流式清单。 402 403:param dict stream_manifest:(...)407 408“” - &gt; 409 cipher = cipher(js = js)411 i,在枚举中流(stream_manifest):file/data/user/0/ru.iiec.pydroid3/files/marm-linux-and-linux-androideabi/lib/lib/python3.9/site-site-site-site-site-site-site-site-site-site-site-site-site-site-site-site-site-site-site-site-site-site-site-site-site-site-site-site-site-site-site-site-stit一下packages/pytube/cipher.py:43,在密码中。 init> in (self,js)38 self.js_func_patterns = [39 r“ \ w+。(\ w+)(\ w+)(\ w,(\ d+) )“,40 r” \ w+[(“ \ w+”)](\ w,(\ d+))” 41] ---&gt; 43 self.throttling_plan = get_throttling_plan(js)44 self.throttling_array = get_throttling_function_array_array(js)file/data/data/user/0/ru.iiec.iec.pydroid3/files/arm-linux-linux-andux-linux-and-linux-and-linux-androideabi/lib/lib/lib/lib/lib/site-pate- pytube/cipher.py:405,在get_throttling_plan(js)393“”“提取“节流计划”。394395“节流计划”是用于调用函数的元组列表(...)403完整功能代码用于计算节点参数。 405 raw_code = get_throttling_function_code(js)407 transform_start = r“ try {” file/data/user/0/ru.iiec.pydroid3/files/marm-linux-and-linux-androideabi/lib/python3.9/ 。 311名称= re.escape(get_throttling_function_name(js))313#确定函数在何处定义file/data/data/user/0/ru.iiec.pydroid3/files/arm-linux-ang-linux-androideabi/lib/python3.9/site-site-9/site-site--site-site--site-site-site-site-site-site-site-site-site-site-site--site--site--site--site--site-by-site--n.9/ packages/pytube/cipher.py:296,在get_throttling_function_name(js)294返回阵列[
from pytube import YouTube
url="https://youtu.be/N2TW4cko1DM"
video=YouTube(url)
print(video.title)
for stream in video.streams():
print(stream)
run:
RegexMatchError Traceback (most recent call last) File /data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.9/site-packages/pytube/main.py:181, in YouTube.fmt_streams(self) 180 try: --> 181 extract.apply_signature(stream_manifest, self.vid_info, self.js) 182 except exceptions.ExtractError: 183 # To force an update to the js file, we clear the cache and retry File /data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.9/site-packages/pytube/extract.py:409, in apply_signature(stream_manifest, vid_info, js) 401 """Apply the decrypted signature to the stream manifest. 402 403 :param dict stream_manifest: (...) 407 408 """ --> 409 cipher = Cipher(js=js) 411 for i, stream in enumerate(stream_manifest): File /data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.9/site-packages/pytube/cipher.py:43, in Cipher.init(self, js) 38 self.js_func_patterns = [ 39 r"\w+.(\w+)(\w,(\d+))", 40 r"\w+[("\w+")](\w,(\d+))" 41 ] ---> 43 self.throttling_plan = get_throttling_plan(js) 44 self.throttling_array = get_throttling_function_array(js) File /data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.9/site-packages/pytube/cipher.py:405, in get_throttling_plan(js) 393 """Extract the "throttling plan". 394 395 The "throttling plan" is a list of tuples used for calling functions (...) 403 The full function code for computing the throttlign parameter. 404 """ --> 405 raw_code = get_throttling_function_code(js) 407 transform_start = r"try{" File /data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.9/site-packages/pytube/cipher.py:311, in get_throttling_function_code(js) 310 # Begin by extracting the correct function name --> 311 name = re.escape(get_throttling_function_name(js)) 313 # Identify where the function is defined File /data/user/0/ru.iiec.pydroid3/files/arm-linux-androideabi/lib/python3.9/site-packages/pytube/cipher.py:296, in get_throttling_function_name(js) 294 return array[
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论