diff options
author | Sergey M․ <dstftw@gmail.com> | 2016-01-19 20:54:43 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2016-01-19 20:54:43 +0600 |
commit | 8ceabd4df332d9c39f71a62bbd60cbea9fcb6621 (patch) | |
tree | 1c038b7aa2bf48dd0d824ddcb1079ad004cad348 /youtube_dl/extractor/youtube.py | |
parent | a8776b107b0137fc13d8fd4350035d02e7bb7761 (diff) |
[youtube] Capture and output unavailable message
Diffstat (limited to 'youtube_dl/extractor/youtube.py')
-rw-r--r-- | youtube_dl/extractor/youtube.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/extractor/youtube.py b/youtube_dl/extractor/youtube.py index 2045f5386..2a0c2e5a6 100644 --- a/youtube_dl/extractor/youtube.py +++ b/youtube_dl/extractor/youtube.py @@ -1508,6 +1508,11 @@ class YoutubeIE(YoutubeBaseInfoExtractor): for a_format in formats: a_format.setdefault('http_headers', {})['Youtubedl-no-compression'] = 'True' 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') # Look for the DASH manifest |