如何解决使用预取有什么优势?
根据文档here,预取被认为可以以某种方式增强脚本。
我尝试过的代码:
try:
a=pytube.YouTube(self.link)
YTOBJ=a
STATUS=True
except:
STATUS=False
if STATUS:
YTOBJ.prefetch()
错误:
File "e:/Python files/Projects/Tool Kit/dir/no_name.py",line 83,in checkLink
YTOBJ.prefetch()
File "E:\Anaconda_Interpreter\lib\site-packages\pytube\__main__.py",line 183,in prefetch
self.js_url = extract.js_url(self.watch_html)
File "E:\Anaconda_Interpreter\lib\site-packages\pytube\extract.py",line 143,in js_url
base_js = get_ytplayer_config(html)["assets"]["js"]
File "E:\Anaconda_Interpreter\lib\site-packages\pytube\extract.py",line 202,in get_ytplayer_config
raise RegexMatchError(caller="get_ytplayer_config",pattern="config_patterns")
pytube.exceptions.RegexMatchError: get_ytplayer_config: could not find match for config_patterns
即使我仍然可以解析YTOBJ
中的详细信息。有人可以解释为什么存在此错误吗?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。