diff options
author | Sergey M․ <dstftw@gmail.com> | 2015-07-18 19:15:20 +0600 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2015-07-18 19:15:20 +0600 |
commit | ee48b6a88f4b8f076699f539ee4c92389fa37643 (patch) | |
tree | 1179139a7ae48dbbf740a2066540d95bef9170f7 | |
parent | 9ac09ed4deafc77cfd94e6a8827e4b0c47517b5c (diff) |
[vk] Capture error message
-rw-r--r-- | youtube_dl/extractor/vk.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/youtube_dl/extractor/vk.py b/youtube_dl/extractor/vk.py index 98bd3a141..9487fc9f5 100644 --- a/youtube_dl/extractor/vk.py +++ b/youtube_dl/extractor/vk.py @@ -205,6 +205,12 @@ class VKIE(InfoExtractor): info_page = self._download_webpage(info_url, video_id) + error_message = self._html_search_regex( + r'(?s)<!><div[^>]+class="video_layer_message"[^>]*>(.+?)</div>', + info_page, 'error message', default=None) + if error_message: + raise ExtractorError(error_message, expected=True) + if re.search(r'<!>/login\.php\?.*\bact=security_check', info_page): raise ExtractorError( 'You are trying to log in from an unusual location. You should confirm ownership at vk.com to log in with this IP.', |