X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fvk.py;h=36cd7e52e7a492207a3b47934d327f4845ab1d62;hb=8569f3d629c1ec2e4b1d8472238aedb1d877d5f0;hp=837c3167e839cc7c9a023a4c9ea0e2a4b1de0f6c;hpb=9334f8f17a0e6a2b97d4e20b12a9ede52e4c0b9a;p=youtube-dl diff --git a/youtube_dl/extractor/vk.py b/youtube_dl/extractor/vk.py index 837c3167e..36cd7e52e 100644 --- a/youtube_dl/extractor/vk.py +++ b/youtube_dl/extractor/vk.py @@ -138,13 +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.' + } - if 'Unknown error' in info_page: - raise ExtractorError( - 'Video %s does not exist' % video_id, expected=True) + 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: