get-pytube / pytube3

A lightweight, dependency-free Python 3 library (and command-line utility) for downloading YouTube Videos.
https://pytube3.readthedocs.io
Other
178 stars 55 forks source link

RegexMatchError #85

Open boidushya opened 4 years ago

boidushya commented 4 years ago
  File "main.py", line 45, in <module>
    post()
  File "main.py", line 24, in post
    vidUrl,(songUrl,t) = prUtils.generate()
  File "E:\bots\dancebot\prUtils.py", line 67, in generate
    pytube.YouTube(q).streams.filter(file_extension='mp4').first().download(output_path="./assets",filename="tempdance")
  File "E:\ProgramData\Anaconda3\lib\site-packages\pytube\__main__.py", line 91, in __init__
    self.prefetch()
  File "E:\ProgramData\Anaconda3\lib\site-packages\pytube\__main__.py", line 183, in prefetch
    self.js_url = extract.js_url(self.watch_html)
  File "E:\ProgramData\Anaconda3\lib\site-packages\pytube\extract.py", line 143, in js_url
    base_js = get_ytplayer_config(html)["assets"]["js"]
  File "E:\ProgramData\Anaconda3\lib\site-packages\pytube\extract.py", line 202, in get_ytplayer_config
    raise RegexMatchError(caller="get_ytplayer_config", pattern="config_patterns")

Occasionally this RegexMatchError pops up while running my script. Didn't use to happen before, again, seems like a youtube change thing

twwwy commented 4 years ago

I have the same issue

sirodus commented 3 years ago

Here is my solution: https://github.com/nficano/pytube/issues/742

fotscode commented 3 years ago

i had the same problem but i just upgraded to the version 10.0.0 and it worked, try it out using "pip install pytube --upgrade"