shubham1710 / Youtube-downloader

It is a simple YouTube downloader which takes URL of the YouTube Video from the user and saves it in your device. Multiple Video downloads at the same time are also supported by this downloader.
60 stars 23 forks source link

Program chrashes? Somehow i get this error #8

Closed CybersamuraiDK closed 3 years ago

CybersamuraiDK commented 3 years ago

I got pytube installed.

Enter the number of youtube videos to download:   1

Enter all the links one per line:
https://youtu.be/hGIW2fDb0jg
Traceback (most recent call last):
  File "C:\Users\cybersamurai\PycharmProjects\Python3Projects\YoutubeDownloaders\python3downloader.py", line 15, in <module>
    yt = YouTube(link)
  File "C:\Users\cybersamurai\PycharmProjects\Python3Projects\venv\lib\site-packages\pytube\__main__.py", line 91, in __init__
    self.prefetch()
  File "C:\Users\cybersamurai\PycharmProjects\Python3Projects\venv\lib\site-packages\pytube\__main__.py", line 183, in prefetch
    self.js_url = extract.js_url(self.watch_html)
  File "C:\Users\cybersamurai\PycharmProjects\Python3Projects\venv\lib\site-packages\pytube\extract.py", line 143, in js_url
    base_js = get_ytplayer_config(html)["assets"]["js"]
  File "C:\Users\cybersamurai\PycharmProjects\Python3Projects\venv\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

Process finished with exit code 1

Edit: I tried with another youtube link also, I dont know if i am missing a lib?

shubham1710 commented 3 years ago

This issue is with Pytube library. Check out this stack overflow answer for the same:- https://stackoverflow.com/questions/64660585/pytube-error-get-ytplayer-config-could-not-find-match-for-config-patterns-whe

rahulnegi20 commented 3 years ago

"You can do this by running python -m pip install git+https://github.com/pytube/pytube. Sometimes, the pypi library repository is not up to date, and your issue may have been fixed already!" -author of pytube

shubham1710 commented 3 years ago

Thanks for providing the method to fix this problem.