X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=youtube_dl%2Fextractor%2Fvk.py;h=36cd7e52e7a492207a3b47934d327f4845ab1d62;hb=939fe70de064130330b137da86a11c1f7a78af24;hp=6c7db7a6f192a5efb16b89b61c12dd8c1104ed05;hpb=849086a1ae153e0dbc5047cbcf8324938d7b7036;p=youtube-dl diff --git a/youtube_dl/extractor/vk.py b/youtube_dl/extractor/vk.py index 6c7db7a6f..36cd7e52e 100644 --- a/youtube_dl/extractor/vk.py +++ b/youtube_dl/extractor/vk.py @@ -101,6 +101,7 @@ class VKIE(InfoExtractor): 'title': 'Книга Илая', 'duration': 6771, }, + 'skip': 'Only works from Russia', }, ] @@ -137,9 +138,19 @@ class VKIE(InfoExtractor): info_url = 'http://vk.com/al_video.php?act=show&al=1&video=%s' % video_id info_page = self._download_webpage(info_url, video_id) - if re.search(r'Please log in or <', info_page): - raise ExtractorError('This video is only available for registered users, ' - 'use --username and --password options to provide account credentials.', expected=True) + ERRORS = { + r'>Видеозапись .*? была изъята из публичного доступа в связи с обращением правообладателя.<': + 'Video %s has been removed from public access due to rightholder complaint.', + r'Please log in or <': + 'Video %s is only available for registered users, ' + 'use --username and --password options to provide account credentials.', + 'Unknown error': + 'Video %s does not exist.' + } + + for error_re, error_msg in ERRORS.items(): + if re.search(error_re, info_page): + raise ExtractorError(error_msg % video_id, expected=True) m_yt = re.search(r'src="(http://www.youtube.com/.*?)"', info_page) if m_yt is not None: