yt_dlp fail with any youtube video
Any idea why it fails on every youtube video? Using v3.9 with pip install yt_dlp -U
the error is
[debug] Encodings: locale UTF-8, fs utf-8, pref UTF-8, out UTF-8 (No ANSI), error UTF-8 (No ANSI), screen UTF-8 (No ANSI)
[debug] yt-dlp version stable@2024.04.09 from yt-dlp/yt-dlp [ff0779267] (pip) API
[debug] params: {'verbose': True, 'compat_opts': set(), 'http_headers': {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.24 Safari/537.36', 'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'Accept-Language': 'en-us,en;q=0.5', 'Sec-Fetch-Mode': 'navigate'}}
[debug] Python 3.9.19 (CPython x86_64 64bit) - macOS-10.15.7-x86_64-i386-64bit (OpenSSL 3.0.13 30 Jan 2024)
[debug] exe versions: none
[debug] Optional libraries: Cryptodome-3.20.0, brotli-1.1.0, certifi-2024.02.02, mutagen-1.47.0, requests-2.31.0, sqlite3-3.45.3, urllib3-2.2.1, websockets-12.0
[debug] Proxy map: {}
[debug] Request Handlers: urllib, requests, websockets
[debug] Loaded 1810 extractors
[youtube] Extracting URL:
[youtube] ZrQJaLemaoE: Downloading webpage
https://www.youtube.com/watch?v=ZrQJaLemaoE
WARNING: [youtube] unable to extract initial player response; please report this issue on , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
https://github.com/yt-dlp/yt-dlp/issues?q=
[youtube] ZrQJaLemaoE: Downloading ios player API JSON
WARNING: [youtube] ZrQJaLemaoE: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); please report this issue on , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
https://github.com/yt-dlp/yt-dlp/issues?q=
[youtube] ZrQJaLemaoE: Downloading android player API JSON
WARNING: [youtube] ZrQJaLemaoE: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); please report this issue on , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
https://github.com/yt-dlp/yt-dlp/issues?q=
[youtube] ZrQJaLemaoE: Downloading iframe API JS
WARNING: [youtube] unable to extract player version; please report this issue on , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
https://github.com/yt-dlp/yt-dlp/issues?q=
[youtube] ZrQJaLemaoE: Downloading web player API JSON
WARNING: [youtube] ZrQJaLemaoE: Failed to parse JSON (caused by JSONDecodeError("Expecting value in '': line 1 column 1 (char 0)")); please report this issue on , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
ERROR: [youtube] ZrQJaLemaoE: Failed to extract any player response; please report this issue on , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
File "/usr/local/anaconda3/envs/py39/lib/python3.9/site-packages/yt_dlp/extractor/common.py", line 734, in extract
ie_result = self._real_extract(url)
File "/usr/local/anaconda3/envs/py39/lib/python3.9/site-packages/yt_dlp/extractor/youtube.py", line 4079, in _real_extract
webpage, master_ytcfg, player_responses, player_url = self._download_player_responses(url, smuggled_data, video_id, webpage_url)
File "/usr/local/anaconda3/envs/py39/lib/python3.9/site-packages/yt_dlp/extractor/youtube.py", line 4043, in _download_player_responses
player_responses, player_url = self._extract_player_responses(
File "/usr/local/anaconda3/envs/py39/lib/python3.9/site-packages/yt_dlp/extractor/youtube.py", line 3733, in _extract_player_responses
raise ExtractorError('Failed to extract any player response')
https://github.com/yt-dlp/yt-dlp/issues?q=https://github.com/yt-dlp/yt-dlp/issues?q=
---------------------------------------------------------------------------
ExtractorError Traceback (most recent call last)
File /usr/local/anaconda3/envs/py39/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py:1606, in YoutubeDL._handle_extraction_exceptions.<locals>.wrapper(self, *args, **kwargs)
1605 try:
-> 1606 return func(self, *args, **kwargs)
1607 except (DownloadCancelled, LazyList.IndexError, PagedList.IndexError):
File /usr/local/anaconda3/envs/py39/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py:1741, in YoutubeDL.__extract_info(self, url, ie, download, extra_info, process)
1740 try:
-> 1741 ie_result = ie.extract(url)
1742 except UserNotLive as e:
File /usr/local/anaconda3/envs/py39/lib/python3.9/site-packages/yt_dlp/extractor/common.py:734, in InfoExtractor.extract(self, url)
732 self.to_screen('Extracting URL: %s' % (
733 url if self.get_param('verbose') else truncate_string(url, 100, 20)))
--> 734 ie_result = self._real_extract(url)
735 if ie_result is None:
File /usr/local/anaconda3/envs/py39/lib/python3.9/site-packages/yt_dlp/extractor/youtube.py:4079, in YoutubeIE._real_extract(self, url)
4077 webpage_url = base_url + 'watch?v=' + video_id
-> 4079 webpage, master_ytcfg, player_responses, player_url = self._download_player_responses(url, smuggled_data, video_id, webpage_url)
4081 playability_statuses = traverse_obj(
4082 player_responses, (..., 'playabilityStatus'), expected_type=dict)
File /usr/local/anaconda3/envs/py39/lib/python3.9/site-packages/yt_dlp/extractor/youtube.py:4043, in YoutubeIE._download_player_responses(self, url, smuggled_data, video_id, webpage_url)
4041 master_ytcfg = self.extract_ytcfg(video_id, webpage) or self._get_default_ytcfg()
-> 4043 player_responses, player_url = self._extract_player_responses(
4044 self._get_requested_clients(url, smuggled_data),
4045 video_id, webpage, master_ytcfg, smuggled_data)
4047 return webpage, master_ytcfg, player_responses, player_url
File /usr/local/anaconda3/envs/py39/lib/python3.9/site-packages/yt_dlp/extractor/youtube.py:3733, in YoutubeIE._extract_player_responses(self, clients, video_id, webpage, master_ytcfg, smuggled_data)
3732 elif not prs:
-> 3733 raise ExtractorError('Failed to extract any player response')
3734 return prs, player_url
ExtractorError: [youtube] ZrQJaLemaoE: Failed to extract any player response; please report this issue on , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -U
During handling of the above exception, another exception occurred:
DownloadError Traceback (most recent call last)
Cell In[14], line 11
3 ydl_opts = {
4 'verbose': True,
5 #"write_auto_sub":True,
(...)
8 #"output":'/tmp/sub.txt',
9 }
10 with yt_dlp.YoutubeDL(ydl_opts) as ydl:
---> 11 ydl.download(url)
File /usr/local/anaconda3/envs/py39/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py:3572, in YoutubeDL.download(self, url_list)
3569 raise SameFileError(outtmpl)
3571 for url in url_list:
-> 3572 self.__download_wrapper(self.extract_info)(
3573 url, force_generic_extractor=self.params.get('force_generic_extractor', False))
3575 return self._download_retcode
File /usr/local/anaconda3/envs/py39/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py:3547, in YoutubeDL.__download_wrapper.<locals>.wrapper(*args, **kwargs)
3544 @functools.wraps(func)
3545 def wrapper(*args, **kwargs):
3546 try:
-> 3547 res = func(*args, **kwargs)
3548 except UnavailableVideoError as e:
3549 self.report_error(e)
File /usr/local/anaconda3/envs/py39/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py:1595, in YoutubeDL.extract_info(self, url, download, ie_key, extra_info, process, force_generic_extractor)
1593 raise ExistingVideoReached()
1594 break
-> 1595 return self.__extract_info(url, self.get_info_extractor(key), download, extra_info, process)
1596 else:
1597 extractors_restricted = self.params.get('allowed_extractors') not in (None, ['default'])
File /usr/local/anaconda3/envs/py39/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py:1624, in YoutubeDL._handle_extraction_exceptions.<locals>.wrapper(self, *args, **kwargs)
1622 self.report_error(msg)
1623 except ExtractorError as e: # An error we somewhat expected
-> 1624 self.report_error(str(e), e.format_traceback())
1625 except Exception as e:
1626 if self.params.get('ignoreerrors'):
File /usr/local/anaconda3/envs/py39/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py:1073, in YoutubeDL.report_error(self, message, *args, **kwargs)
1068 def report_error(self, message, *args, **kwargs):
1069 '''
1070 Do the same as trouble, but prefixes the message with 'ERROR:', colored
1071 in red if stderr is a tty file.
1072 '''
-> 1073 self.trouble(f'{self._format_err("ERROR:", self.Styles.ERROR)} {message}', *args, **kwargs)
File /usr/local/anaconda3/envs/py39/lib/python3.9/site-packages/yt_dlp/YoutubeDL.py:1012, in YoutubeDL.trouble(self, message, tb, is_error)
1010 else:
1011 exc_info = sys.exc_info()
-> 1012 raise DownloadError(message, exc_info)
1013 self._download_retcode = 1
DownloadError: ERROR: [youtube] ZrQJaLemaoE: Failed to extract any player response; please report this issue on , filling out the appropriate issue template. Confirm you are on the latest version using yt-dlp -Uhttps://github.com/yt-dlp/yt-dlp/issues?q=https://github.com/yt-dlp/yt-dlp/issues?q=