[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
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -321,9 +321,16 @@ class SoundcloudBaseIE(InfoExtractor):
continue continue
# XXX: if not extract_flat, 429 error must be caught where _extract_info_dict is called # XXX: if not extract_flat, 429 error must be caught where _extract_info_dict is called
try:
stream_url = traverse_obj(self._call_api( stream_url = traverse_obj(self._call_api(
format_url, track_id, f'Downloading {short_identifier} format info JSON', format_url, track_id, f'Downloading {short_identifier} format info JSON',
query=query, headers=self._HEADERS), ('url', {url_or_none})) 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): if invalid_url(stream_url):
continue continue
format_urls.add(stream_url) format_urls.add(stream_url)