get-pytube / pytube3

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

KeyError: 'cipher' #82

Open Jabyer opened 4 years ago

Jabyer commented 4 years ago

in video: https://www.youtube.com/watch?v=sh9SBIMGLAI&t=2827s

Traceback (most recent call last): File "C:\Users\user\AppData\Local\Programs\Thonny\lib\site-packages\pytube\extract.py", line 297, in apply_descrambler for format_item in formats File "C:\Users\user\AppData\Local\Programs\Thonny\lib\site-packages\pytube\extract.py", line 297, in for format_item in formats KeyError: 'url'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "D:\MEGA\Programación\Python\Descargar videos de Youtube.py", line 19, in YouTube(url).streams.first().download() File "C:\Users\user\AppData\Local\Programs\Thonny\lib\site-packages\pytube__main.py", line 92, in init self.descramble() File "C:\Users\user\AppData\Local\Programs\Thonny\lib\site-packages\pytube\main__.py", line 132, in descramble apply_descrambler(self.player_config_args, fmt) File "C:\Users\user\AppData\Local\Programs\Thonny\lib\site-packages\pytube\extract.py", line 301, in apply_descrambler parse_qs(formats[i]["cipher"]) for i, data in enumerate(formats) File "C:\Users\user\AppData\Local\Programs\Thonny\lib\site-packages\pytube\extract.py", line 301, in parse_qs(formats[i]["cipher"]) for i, data in enumerate(formats) KeyError: 'cipher'

boidushya commented 4 years ago

Refer to PR #80 , it is a potential fix to the issue