I am trying to make a YouTube video downloader using Python pytube3 but it doesn't download all the videos. Some videos download very easily but some videos won't download and instead of download it shows error:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:UsersarunPycharmProjectsYTDownloadervenvlibsite-packagespytubeextract.py", line 297, in apply_descrambler
for format_item in formats
File "C:UsersarunPycharmProjectsYTDownloadervenvlibsite-packagespytubeextract.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:UsersarunAppDataLocalProgramsPythonPython37-32libkinter\__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:UsersarunPycharmProjectsYTDownloadervenvlibsite-packagespytube\__main__.py", line 92, in __init__
self.descramble()
File "C:UsersarunPycharmProjectsYTDownloadervenvlibsite-packagespytube\__main__.py", line 132, in descramble
apply_descrambler(self.player_config_args, fmt)
File "C:UsersarunPycharmProjectsYTDownloadervenvlibsite-packagespytubeextract.py", line 301, in apply_descrambler
parse_qs(formats[i]["cipher"]) for i, data in enumerate(formats)
File "C:UsersarunPycharmProjectsYTDownloadervenvlibsite-packagespytubeextract.py", line 301, in <listcomp>
parse_qs(formats[i]["cipher"]) for i, data in enumerate(formats)
KeyError: 'cipher'
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…