X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fvk.py;h=8f677cae3a503ef34230cf205c12378e3c2ecb66;hb=1b541d8d6ee5e3543253501d725af7ce4a55cad8;hp=c0292095bab55d792249fedd03a7d927a98763e5;hpb=3f19b9b7c111ef0f12b880d8676a346280cc3ef4;p=youtube-dl diff --git a/youtube_dl/extractor/vk.py b/youtube_dl/extractor/vk.py index c0292095b..8f677cae3 100644 --- a/youtube_dl/extractor/vk.py +++ b/youtube_dl/extractor/vk.py @@ -29,7 +29,7 @@ class VKIE(InfoExtractor): (?:m\.)?vk\.com/(?:.+?\?.*?z=)?video| (?:www\.)?biqle\.ru/watch/ ) - (?P[^s].*?)(?:\?|%2F|$) + (?P[^s].*?)(?:\?(?:.*\blist=(?P[\da-f]+))?|%2F|$) ) ''' _NETRC_MACHINE = 'vk' @@ -119,6 +119,20 @@ class VKIE(InfoExtractor): }, 'skip': 'Only works from Russia', }, + { + # video (removed?) only available with list id + 'url': 'https://vk.com/video30481095_171201961?list=8764ae2d21f14088d4', + 'md5': '091287af5402239a1051c37ec7b92913', + 'info_dict': { + 'id': '171201961', + 'ext': 'mp4', + 'title': 'ТюменцевВВ_09.07.2015', + 'uploader': 'Anton Ivanov', + 'duration': 109, + 'upload_date': '20150709', + 'view_count': int, + }, + }, { # youtube embed 'url': 'https://vk.com/video276849682_170681728', @@ -154,7 +168,7 @@ class VKIE(InfoExtractor): login_page = self._download_webpage( 'https://vk.com', None, 'Downloading login page') - login_form = self._form_hidden_inputs(login_page) + login_form = self._hidden_inputs(login_page) login_form.update({ 'email': username.encode('cp1251'), @@ -182,6 +196,12 @@ class VKIE(InfoExtractor): video_id = '%s_%s' % (mobj.group('oid'), mobj.group('id')) info_url = 'https://vk.com/al_video.php?act=show&al=1&module=video&video=%s' % video_id + + # Some videos (removed?) can only be downloaded with list id specified + list_id = mobj.group('list_id') + if list_id: + info_url += '&list=%s' % list_id + info_page = self._download_webpage(info_url, video_id) if re.search(r'/login\.php\?.*\bact=security_check', info_page): @@ -202,6 +222,9 @@ class VKIE(InfoExtractor): r'Видео временно недоступно': 'Video %s is temporarily unavailable.', + + r'Access denied': + 'Access denied to video %s.', } for error_re, error_msg in ERRORS.items():