mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-29 03:23:02 +00:00
parent
297b0a3792
commit
4b50b292cc
1 changed files with 15 additions and 17 deletions
|
@ -314,23 +314,11 @@ def add_format(f, protocol, is_preview=False):
|
||||||
self.write_debug(f'"{identifier}" is not a requested format, skipping')
|
self.write_debug(f'"{identifier}" is not a requested format, skipping')
|
||||||
continue
|
continue
|
||||||
|
|
||||||
stream = None
|
# XXX: if not extract_flat, 429 error must be caught where _extract_info_dict is called
|
||||||
for retry in self.RetryManager(fatal=False):
|
stream_url = traverse_obj(self._call_api(
|
||||||
try:
|
format_url, track_id, f'Downloading {identifier} format info JSON',
|
||||||
stream = self._call_api(
|
query=query, headers=self._HEADERS), ('url', {url_or_none}))
|
||||||
format_url, track_id, f'Downloading {identifier} format info JSON',
|
|
||||||
query=query, headers=self._HEADERS)
|
|
||||||
except ExtractorError as e:
|
|
||||||
if isinstance(e.cause, HTTPError) and e.cause.status == 429:
|
|
||||||
self.report_warning(
|
|
||||||
'You have reached the API rate limit, which is ~600 requests per '
|
|
||||||
'10 minutes. Use the --extractor-retries and --retry-sleep options '
|
|
||||||
'to configure an appropriate retry count and wait time', only_once=True)
|
|
||||||
retry.error = e.cause
|
|
||||||
else:
|
|
||||||
self.report_warning(e.msg)
|
|
||||||
|
|
||||||
stream_url = traverse_obj(stream, ('url', {url_or_none}))
|
|
||||||
if invalid_url(stream_url):
|
if invalid_url(stream_url):
|
||||||
continue
|
continue
|
||||||
format_urls.add(stream_url)
|
format_urls.add(stream_url)
|
||||||
|
@ -647,7 +635,17 @@ def _real_extract(self, url):
|
||||||
info = self._call_api(
|
info = self._call_api(
|
||||||
info_json_url, full_title, 'Downloading info JSON', query=query, headers=self._HEADERS)
|
info_json_url, full_title, 'Downloading info JSON', query=query, headers=self._HEADERS)
|
||||||
|
|
||||||
return self._extract_info_dict(info, full_title, token)
|
for retry in self.RetryManager():
|
||||||
|
try:
|
||||||
|
return self._extract_info_dict(info, full_title, token)
|
||||||
|
except ExtractorError as e:
|
||||||
|
if not isinstance(e.cause, HTTPError) or not e.cause.status == 429:
|
||||||
|
raise
|
||||||
|
self.report_warning(
|
||||||
|
'You have reached the API rate limit, which is ~600 requests per '
|
||||||
|
'10 minutes. Use the --extractor-retries and --retry-sleep options '
|
||||||
|
'to configure an appropriate retry count and wait time', only_once=True)
|
||||||
|
retry.error = e.cause
|
||||||
|
|
||||||
|
|
||||||
class SoundcloudPlaylistBaseIE(SoundcloudBaseIE):
|
class SoundcloudPlaylistBaseIE(SoundcloudBaseIE):
|
||||||
|
|
Loading…
Reference in a new issue