使用预取有什么优势?

问题描述

根据文档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 (将#修改为@)