X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fvk.py;h=c30c5a8e524324a29d7c4a2dad49d5b9d50dda30;hb=795704f0f1f963d3f61a7e20074ce41eeb3cdf95;hp=98bd3a14145cced545bbe1a7f9051baa1ef8d6ff;hpb=fec73daaa30d006bc6c5d0483d255b7bc1c256b1;p=youtube-dl diff --git a/youtube_dl/extractor/vk.py b/youtube_dl/extractor/vk.py index 98bd3a141..c30c5a8e5 100644 --- a/youtube_dl/extractor/vk.py +++ b/youtube_dl/extractor/vk.py @@ -154,6 +154,11 @@ class VKIE(InfoExtractor): 'url': 'http://vk.com/feed?z=video-43215063_166094326%2Fbb50cacd3177146d7a', 'only_matching': True, }, + { + # age restricted video, requires vk account credentials + 'url': 'https://vk.com/video205387401_164765225', + 'only_matching': True, + }, { # vk wrapper 'url': 'http://www.biqle.ru/watch/847655_160197695', @@ -205,6 +210,12 @@ class VKIE(InfoExtractor): info_page = self._download_webpage(info_url, video_id) + error_message = self._html_search_regex( + r'(?s)]+class="video_layer_message"[^>]*>(.+?)', + 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.',