KeyError: 's'
See original GitHub issueyt = Youtube('https://www.youtube.com/watch?v=dkfW1Q1T72c')
This code gives an error:
Traceback (most recent call last): File “views.py”, line 46, in <module> yt = YouTube(url) File “C:\Users\Diego\AppData\Local\Programs\Python\Python37\lib\site-packages\pytube_main_.py”, line 88, in init self.prefetch_init() File “C:\Users\Diego\AppData\Local\Programs\Python\Python37\lib\site-packages\pytube_main_.py”, line 97, in prefetch_init self.init() File “C:\Users\Diego\AppData\Local\Programs\Python\Python37\lib\site-packages\pytube_main_.py”, line 133, in init mixins.apply_signature(self.player_config_args, fmt, self.js) File “C:\Users\Diego\AppData\Local\Programs\Python\Python37\lib\site-packages\pytube\mixins.py”, line 49, in apply_signature signature = cipher.get_signature(js, stream[‘s’]) KeyError: ‘s’
This error occurs for certain URLs but not necessarily. This problem has been bothering me for a long time, please help me solve this problem.(By the way, I am using the latest version.) Thank you!
Issue Analytics
- State:
- Created 4 years ago
- Comments:5
Top GitHub Comments
Quick and small workaround for ( what seems to be the most ) of the issue: Change line 41
to :
This video
https://www.youtube.com/watch?v=cfsICOzt6Do
do not download. Program failing with same error.