mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-01 00:52:58 +01:00
[youtube] Capture and output unavailable message
This commit is contained in:
parent
a8776b107b
commit
8ceabd4df3
@ -1508,6 +1508,11 @@ def _map_to_format_list(urlmap):
|
|||||||
for a_format in formats:
|
for a_format in formats:
|
||||||
a_format.setdefault('http_headers', {})['Youtubedl-no-compression'] = 'True'
|
a_format.setdefault('http_headers', {})['Youtubedl-no-compression'] = 'True'
|
||||||
else:
|
else:
|
||||||
|
unavailable_message = self._html_search_regex(
|
||||||
|
r'(?s)<h1[^>]+id="unavailable-message"[^>]*>(.+?)</h1>',
|
||||||
|
video_webpage, 'unavailable message', default=None)
|
||||||
|
if unavailable_message:
|
||||||
|
raise ExtractorError(unavailable_message, expected=True)
|
||||||
raise ExtractorError('no conn, hlsvp or url_encoded_fmt_stream_map information found in video info')
|
raise ExtractorError('no conn, hlsvp or url_encoded_fmt_stream_map information found in video info')
|
||||||
|
|
||||||
# Look for the DASH manifest
|
# Look for the DASH manifest
|
||||||
|
Loading…
Reference in New Issue
Block a user