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'
これはpytube3の問題です。現時点ではまだ修正を提出していません。 これはgithubの問題へのリンクです