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

pytube 3 keyError: 'assets' #108

Open okanyesil opened 3 years ago

okanyesil commented 3 years ago

I am trying to download video from youtube. I installed pytube pip install pytube3. when I am trying to download a video it gives me this error Traceback (most recent call last): File "", line 1, in File "C:\Users\OKAN\AppData\Roaming\Python\Python38\site-packages\pytube__main.py", line 91, in init self.prefetch() File "C:\Users\OKAN\AppData\Roaming\Python\Python38\site-packages\pytube\main__.py", line 183, in prefetch self.js_url = extract.js_url(self.watch_html) File "C:\Users\OKAN\AppData\Roaming\Python\Python38\site-packages\pytube\extract.py", line 143, in js_url base_js = get_ytplayer_config(html)["assets"]["js"] KeyError: 'assets'

AssesBesses commented 3 years ago

here is the solution https://github.com/nficano/pytube/issues/777

okanyesil commented 3 years ago

it didnt help me

AssesBesses commented 3 years ago

What error are you getting?

okanyesil commented 3 years ago

Same error

AssesBesses commented 3 years ago

Download the original pytube from github https://github.com/nficano/pytube Don't use pip, download directly from github. pytube works fine with up to python 3.7

bigbear22941 commented 3 years ago

Copy code from codebas still not work for me, too...

AssesBesses commented 3 years ago

what version of python are you using?