如何在pytube代码中修复“ KeyError:'s'”

时间:2019-07-11 16:02:09

标签: python-3.x pytube

每当我尝试下载youtube视频时,都会出现此错误:

Traceback (most recent call last):
  File "C:\Users\Desh Ratna\AppData\Local\Programs\Python\Python36-32\download_1_video.py", line 3, in <module>
    YouTube('video url').streams.first().download('destination folder')
  File "C:\Users\Desh Ratna\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pytube\__main__.py", line 88, in __init__
    self.prefetch_init()
  File "C:\Users\Desh Ratna\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pytube\__main__.py", line 97, in prefetch_init
    self.init()
  File "C:\Users\Desh Ratna\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pytube\__main__.py", line 133, in init
    mixins.apply_signature(self.player_config_args, fmt, self.js)
  File "C:\Users\Desh Ratna\AppData\Local\Programs\Python\Python36-32\lib\site-packages\pytube\mixins.py", line 49, in apply_signature
    signature = cipher.get_signature(js, stream['s'])
KeyError: 's'

from pytube import YouTube

YouTube('video url').streams.first().download('destination path')

0 个答案:

没有答案