mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2026-05-01 21:35:55 +00:00
[ie/soundcloud] Improve error handling (#16602)
Closes #16603 Authored by: bashonly
This commit is contained in:
@@ -321,9 +321,16 @@ class SoundcloudBaseIE(InfoExtractor):
|
||||
continue
|
||||
|
||||
# XXX: if not extract_flat, 429 error must be caught where _extract_info_dict is called
|
||||
stream_url = traverse_obj(self._call_api(
|
||||
format_url, track_id, f'Downloading {short_identifier} format info JSON',
|
||||
query=query, headers=self._HEADERS), ('url', {url_or_none}))
|
||||
try:
|
||||
stream_url = traverse_obj(self._call_api(
|
||||
format_url, track_id, f'Downloading {short_identifier} format info JSON',
|
||||
query=query, headers=self._HEADERS), ('url', {url_or_none}))
|
||||
except ExtractorError as e:
|
||||
if isinstance(e.cause, HTTPError) and e.cause.status == 404:
|
||||
self.report_warning(f'{short_identifier} format not found', video_id=track_id)
|
||||
continue
|
||||
raise
|
||||
|
||||
if invalid_url(stream_url):
|
||||
continue
|
||||
format_urls.add(stream_url)
|
||||
|
||||
Reference in New Issue
Block a user