[ie/soundcloud] Improve error handling (#16602)

Closes #16603
Authored by: bashonly
This commit is contained in:
bashonly
2026-04-30 17:23:20 -05:00
committed by GitHub
parent 165ee77a2b
commit ebf0c0f61e

View File

@@ -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)