Is there any advantage of Using prefetch?

79 Views Asked by At

According to the documentation here prefetch is believed to boost the script somehow.

Code, that I have tried:

try:
    a=pytube.YouTube(self.link)
    YTOBJ=a
    STATUS=True
except:
    STATUS=False  
if STATUS:
    YTOBJ.prefetch()

Error:

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

Even though I can still parse details from YTOBJ. Can someone please explain why this error exists?

0

There are 0 best solutions below