我正在尝试使用 Python pytube3 制作 YouTube 视频下载器,但它不会下载所有视频。有些视频很容易下载,但有些视频不会下载,而是显示错误:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\tarun\PycharmProjects\YTDownloader\venv\lib\site-packages\pytube\extract.py", line 297, in apply_descrambler
for format_item in formats
File "C:\Users\tarun\PycharmProjects\YTDownloader\venv\lib\site-packages\pytube\extract.py", line 297, in <listcomp>
for format_item in formats
KeyError: 'url'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\tarun\AppData\Local\Programs\Python\Python37-32\lib\tkinter\__init__.py", line 1705, in __call__
return self.func(*args)
File "C:/Users/tarun/PycharmProjects/YTDownloader/YTD.py", line 15, in video_download
my_video = YouTube(input_user)
File "C:\Users\tarun\PycharmProjects\YTDownloader\venv\lib\site-packages\pytube\__main__.py", line 92, in __init__
self.descramble()
File "C:\Users\tarun\PycharmProjects\YTDownloader\venv\lib\site-packages\pytube\__main__.py", line 132, in descramble
apply_descrambler(self.player_config_args, fmt)
File "C:\Users\tarun\PycharmProjects\YTDownloader\venv\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\tarun\PycharmProjects\YTDownloader\venv\lib\site-packages\pytube\extract.py", line 301, in <listcomp>
parse_qs(formats[i]["cipher"]) for i, data in enumerate(formats)
KeyError: 'cipher'