a5e4a3e672676113e14f3cd17ebe5a130f86aea3
[youtube-dl] / youtube_dl / extractor / vk.py
1 # coding: utf-8
2 from __future__ import unicode_literals
3
4 import collections
5 import re
6
7 from .common import InfoExtractor
8 from ..compat import compat_urlparse
9 from ..utils import (
10     clean_html,
11     ExtractorError,
12     get_element_by_class,
13     int_or_none,
14     orderedSet,
15     str_or_none,
16     str_to_int,
17     unescapeHTML,
18     unified_timestamp,
19     url_or_none,
20     urlencode_postdata,
21 )
22 from .dailymotion import DailymotionIE
23 from .odnoklassniki import OdnoklassnikiIE
24 from .pladform import PladformIE
25 from .vimeo import VimeoIE
26 from .youtube import YoutubeIE
27
28
29 class VKBaseIE(InfoExtractor):
30     _NETRC_MACHINE = 'vk'
31
32     def _login(self):
33         username, password = self._get_login_info()
34         if username is None:
35             return
36
37         login_page, url_handle = self._download_webpage_handle(
38             'https://vk.com', None, 'Downloading login page')
39
40         login_form = self._hidden_inputs(login_page)
41
42         login_form.update({
43             'email': username.encode('cp1251'),
44             'pass': password.encode('cp1251'),
45         })
46
47         # vk serves two same remixlhk cookies in Set-Cookie header and expects
48         # first one to be actually set
49         self._apply_first_set_cookie_header(url_handle, 'remixlhk')
50
51         login_page = self._download_webpage(
52             'https://login.vk.com/?act=login', None,
53             note='Logging in',
54             data=urlencode_postdata(login_form))
55
56         if re.search(r'onLoginFailed', login_page):
57             raise ExtractorError(
58                 'Unable to login, incorrect username and/or password', expected=True)
59
60     def _real_initialize(self):
61         self._login()
62
63     def _download_payload(self, path, video_id, data, fatal=True):
64         data['al'] = 1
65         code, payload = self._download_json(
66             'https://vk.com/%s.php' % path, video_id,
67             data=urlencode_postdata(data), fatal=fatal,
68             headers={'X-Requested-With': 'XMLHttpRequest'})['payload']
69         if code == '3':
70             self.raise_login_required()
71         elif code == '8':
72             raise ExtractorError(clean_html(payload[0][1:-1]), expected=True)
73         return payload
74
75
76 class VKIE(VKBaseIE):
77     IE_NAME = 'vk'
78     IE_DESC = 'VK'
79     _VALID_URL = r'''(?x)
80                     https?://
81                         (?:
82                             (?:
83                                 (?:(?:m|new)\.)?vk\.com/video_|
84                                 (?:www\.)?daxab.com/
85                             )
86                             ext\.php\?(?P<embed_query>.*?\boid=(?P<oid>-?\d+).*?\bid=(?P<id>\d+).*)|
87                             (?:
88                                 (?:(?:m|new)\.)?vk\.com/(?:.+?\?.*?z=)?video|
89                                 (?:www\.)?daxab.com/embed/
90                             )
91                             (?P<videoid>-?\d+_\d+)(?:.*\blist=(?P<list_id>[\da-f]+))?
92                         )
93                     '''
94     _TESTS = [
95         {
96             'url': 'http://vk.com/videos-77521?z=video-77521_162222515%2Fclub77521',
97             'md5': '7babad3b85ea2e91948005b1b8b0cb84',
98             'info_dict': {
99                 'id': '-77521_162222515',
100                 'ext': 'mp4',
101                 'title': 'ProtivoGunz - Хуёвая песня',
102                 'uploader': 're:(?:Noize MC|Alexander Ilyashenko).*',
103                 'uploader_id': '-77521',
104                 'duration': 195,
105                 'timestamp': 1329049880,
106                 'upload_date': '20120212',
107             },
108         },
109         {
110             'url': 'http://vk.com/video205387401_165548505',
111             'info_dict': {
112                 'id': '205387401_165548505',
113                 'ext': 'mp4',
114                 'title': 'No name',
115                 'uploader': 'Tom Cruise',
116                 'uploader_id': '205387401',
117                 'duration': 9,
118                 'timestamp': 1374364108,
119                 'upload_date': '20130720',
120             }
121         },
122         {
123             'note': 'Embedded video',
124             'url': 'https://vk.com/video_ext.php?oid=-77521&id=162222515&hash=87b046504ccd8bfa',
125             'md5': '7babad3b85ea2e91948005b1b8b0cb84',
126             'info_dict': {
127                 'id': '-77521_162222515',
128                 'ext': 'mp4',
129                 'uploader': 're:(?:Noize MC|Alexander Ilyashenko).*',
130                 'title': 'ProtivoGunz - Хуёвая песня',
131                 'duration': 195,
132                 'upload_date': '20120212',
133                 'timestamp': 1329049880,
134                 'uploader_id': '-77521',
135             },
136         },
137         {
138             # VIDEO NOW REMOVED
139             # please update if you find a video whose URL follows the same pattern
140             'url': 'http://vk.com/video-8871596_164049491',
141             'md5': 'a590bcaf3d543576c9bd162812387666',
142             'note': 'Only available for registered users',
143             'info_dict': {
144                 'id': '-8871596_164049491',
145                 'ext': 'mp4',
146                 'uploader': 'Триллеры',
147                 'title': '► Бойцовский клуб / Fight Club 1999 [HD 720]',
148                 'duration': 8352,
149                 'upload_date': '20121218',
150                 'view_count': int,
151             },
152             'skip': 'Removed',
153         },
154         {
155             'url': 'http://vk.com/hd_kino_mania?z=video-43215063_168067957%2F15c66b9b533119788d',
156             'info_dict': {
157                 'id': '-43215063_168067957',
158                 'ext': 'mp4',
159                 'uploader': 'Bro Mazter',
160                 'title': ' ',
161                 'duration': 7291,
162                 'upload_date': '20140328',
163                 'uploader_id': '223413403',
164                 'timestamp': 1396018030,
165             },
166             'skip': 'Requires vk account credentials',
167         },
168         {
169             'url': 'http://m.vk.com/video-43215063_169084319?list=125c627d1aa1cebb83&from=wall-43215063_2566540',
170             'md5': '0c45586baa71b7cb1d0784ee3f4e00a6',
171             'note': 'ivi.ru embed',
172             'info_dict': {
173                 'id': '-43215063_169084319',
174                 'ext': 'mp4',
175                 'title': 'Книга Илая',
176                 'duration': 6771,
177                 'upload_date': '20140626',
178                 'view_count': int,
179             },
180             'skip': 'Removed',
181         },
182         {
183             # video (removed?) only available with list id
184             'url': 'https://vk.com/video30481095_171201961?list=8764ae2d21f14088d4',
185             'md5': '091287af5402239a1051c37ec7b92913',
186             'info_dict': {
187                 'id': '30481095_171201961',
188                 'ext': 'mp4',
189                 'title': 'ТюменцевВВ_09.07.2015',
190                 'uploader': 'Anton Ivanov',
191                 'duration': 109,
192                 'upload_date': '20150709',
193                 'view_count': int,
194             },
195             'skip': 'Removed',
196         },
197         {
198             # youtube embed
199             'url': 'https://vk.com/video276849682_170681728',
200             'info_dict': {
201                 'id': 'V3K4mi0SYkc',
202                 'ext': 'mp4',
203                 'title': "DSWD Awards 'Children's Joy Foundation, Inc.' Certificate of Registration and License to Operate",
204                 'description': 'md5:bf9c26cfa4acdfb146362682edd3827a',
205                 'duration': 178,
206                 'upload_date': '20130116',
207                 'uploader': "Children's Joy Foundation Inc.",
208                 'uploader_id': 'thecjf',
209                 'view_count': int,
210             },
211         },
212         {
213             # dailymotion embed
214             'url': 'https://vk.com/video-37468416_456239855',
215             'info_dict': {
216                 'id': 'k3lz2cmXyRuJQSjGHUv',
217                 'ext': 'mp4',
218                 'title': 'md5:d52606645c20b0ddbb21655adaa4f56f',
219                 'description': 'md5:424b8e88cc873217f520e582ba28bb36',
220                 'uploader': 'AniLibria.Tv',
221                 'upload_date': '20160914',
222                 'uploader_id': 'x1p5vl5',
223                 'timestamp': 1473877246,
224             },
225             'params': {
226                 'skip_download': True,
227             },
228         },
229         {
230             # video key is extra_data not url\d+
231             'url': 'http://vk.com/video-110305615_171782105',
232             'md5': 'e13fcda136f99764872e739d13fac1d1',
233             'info_dict': {
234                 'id': '-110305615_171782105',
235                 'ext': 'mp4',
236                 'title': 'S-Dance, репетиции к The way show',
237                 'uploader': 'THE WAY SHOW | 17 апреля',
238                 'uploader_id': '-110305615',
239                 'timestamp': 1454859345,
240                 'upload_date': '20160207',
241             },
242             'params': {
243                 'skip_download': True,
244             },
245         },
246         {
247             # finished live stream, postlive_mp4
248             'url': 'https://vk.com/videos-387766?z=video-387766_456242764%2Fpl_-387766_-2',
249             'info_dict': {
250                 'id': '-387766_456242764',
251                 'ext': 'mp4',
252                 'title': 'ИгроМир 2016 День 1 — Игромания Утром',
253                 'uploader': 'Игромания',
254                 'duration': 5239,
255                 # TODO: use act=show to extract view_count
256                 # 'view_count': int,
257                 'upload_date': '20160929',
258                 'uploader_id': '-387766',
259                 'timestamp': 1475137527,
260             },
261             'params': {
262                 'skip_download': True,
263             },
264         },
265         {
266             # live stream, hls and rtmp links, most likely already finished live
267             # stream by the time you are reading this comment
268             'url': 'https://vk.com/video-140332_456239111',
269             'only_matching': True,
270         },
271         {
272             # removed video, just testing that we match the pattern
273             'url': 'http://vk.com/feed?z=video-43215063_166094326%2Fbb50cacd3177146d7a',
274             'only_matching': True,
275         },
276         {
277             # age restricted video, requires vk account credentials
278             'url': 'https://vk.com/video205387401_164765225',
279             'only_matching': True,
280         },
281         {
282             # pladform embed
283             'url': 'https://vk.com/video-76116461_171554880',
284             'only_matching': True,
285         },
286         {
287             'url': 'http://new.vk.com/video205387401_165548505',
288             'only_matching': True,
289         },
290         {
291             # This video is no longer available, because its author has been blocked.
292             'url': 'https://vk.com/video-10639516_456240611',
293             'only_matching': True,
294         },
295         {
296             # The video is not available in your region.
297             'url': 'https://vk.com/video-51812607_171445436',
298             'only_matching': True,
299         }]
300
301     def _real_extract(self, url):
302         mobj = re.match(self._VALID_URL, url)
303         video_id = mobj.group('videoid')
304
305         mv_data = {}
306         if video_id:
307             data = {
308                 'act': 'show_inline',
309                 'video': video_id,
310             }
311             # Some videos (removed?) can only be downloaded with list id specified
312             list_id = mobj.group('list_id')
313             if list_id:
314                 data['list'] = list_id
315
316             payload = self._download_payload('al_video', video_id, data)
317             info_page = payload[1]
318             opts = payload[-1]
319             mv_data = opts.get('mvData') or {}
320             player = opts.get('player') or {}
321         else:
322             video_id = '%s_%s' % (mobj.group('oid'), mobj.group('id'))
323
324             info_page = self._download_webpage(
325                 'http://vk.com/video_ext.php?' + mobj.group('embed_query'), video_id)
326
327             error_message = self._html_search_regex(
328                 [r'(?s)<!><div[^>]+class="video_layer_message"[^>]*>(.+?)</div>',
329                     r'(?s)<div[^>]+id="video_ext_msg"[^>]*>(.+?)</div>'],
330                 info_page, 'error message', default=None)
331             if error_message:
332                 raise ExtractorError(error_message, expected=True)
333
334             if re.search(r'<!>/login\.php\?.*\bact=security_check', info_page):
335                 raise ExtractorError(
336                     'You are trying to log in from an unusual location. You should confirm ownership at vk.com to log in with this IP.',
337                     expected=True)
338
339             ERROR_COPYRIGHT = 'Video %s has been removed from public access due to rightholder complaint.'
340
341             ERRORS = {
342                 r'>Видеозапись .*? была изъята из публичного доступа в связи с обращением правообладателя.<':
343                 ERROR_COPYRIGHT,
344
345                 r'>The video .*? was removed from public access by request of the copyright holder.<':
346                 ERROR_COPYRIGHT,
347
348                 r'<!>Please log in or <':
349                 'Video %s is only available for registered users, '
350                 'use --username and --password options to provide account credentials.',
351
352                 r'<!>Unknown error':
353                 'Video %s does not exist.',
354
355                 r'<!>Видео временно недоступно':
356                 'Video %s is temporarily unavailable.',
357
358                 r'<!>Access denied':
359                 'Access denied to video %s.',
360
361                 r'<!>Видеозапись недоступна, так как её автор был заблокирован.':
362                 'Video %s is no longer available, because its author has been blocked.',
363
364                 r'<!>This video is no longer available, because its author has been blocked.':
365                 'Video %s is no longer available, because its author has been blocked.',
366
367                 r'<!>This video is no longer available, because it has been deleted.':
368                 'Video %s is no longer available, because it has been deleted.',
369
370                 r'<!>The video .+? is not available in your region.':
371                 'Video %s is not available in your region.',
372             }
373
374             for error_re, error_msg in ERRORS.items():
375                 if re.search(error_re, info_page):
376                     raise ExtractorError(error_msg % video_id, expected=True)
377
378             player = self._parse_json(self._search_regex(
379                 r'var\s+playerParams\s*=\s*({.+?})\s*;\s*\n',
380                 info_page, 'player params'), video_id)
381
382         youtube_url = YoutubeIE._extract_url(info_page)
383         if youtube_url:
384             return self.url_result(youtube_url, YoutubeIE.ie_key())
385
386         vimeo_url = VimeoIE._extract_url(url, info_page)
387         if vimeo_url is not None:
388             return self.url_result(vimeo_url, VimeoIE.ie_key())
389
390         pladform_url = PladformIE._extract_url(info_page)
391         if pladform_url:
392             return self.url_result(pladform_url, PladformIE.ie_key())
393
394         m_rutube = re.search(
395             r'\ssrc="((?:https?:)?//rutube\.ru\\?/(?:video|play)\\?/embed(?:.*?))\\?"', info_page)
396         if m_rutube is not None:
397             rutube_url = self._proto_relative_url(
398                 m_rutube.group(1).replace('\\', ''))
399             return self.url_result(rutube_url)
400
401         dailymotion_urls = DailymotionIE._extract_urls(info_page)
402         if dailymotion_urls:
403             return self.url_result(dailymotion_urls[0], DailymotionIE.ie_key())
404
405         odnoklassniki_url = OdnoklassnikiIE._extract_url(info_page)
406         if odnoklassniki_url:
407             return self.url_result(odnoklassniki_url, OdnoklassnikiIE.ie_key())
408
409         m_opts = re.search(r'(?s)var\s+opts\s*=\s*({.+?});', info_page)
410         if m_opts:
411             m_opts_url = re.search(r"url\s*:\s*'((?!/\b)[^']+)", m_opts.group(1))
412             if m_opts_url:
413                 opts_url = m_opts_url.group(1)
414                 if opts_url.startswith('//'):
415                     opts_url = 'http:' + opts_url
416                 return self.url_result(opts_url)
417
418         data = player['params'][0]
419         title = unescapeHTML(data['md_title'])
420
421         # 2 = live
422         # 3 = post live (finished live)
423         is_live = data.get('live') == 2
424         if is_live:
425             title = self._live_title(title)
426
427         timestamp = unified_timestamp(self._html_search_regex(
428             r'class=["\']mv_info_date[^>]+>([^<]+)(?:<|from)', info_page,
429             'upload date', default=None)) or int_or_none(data.get('date'))
430
431         view_count = str_to_int(self._search_regex(
432             r'class=["\']mv_views_count[^>]+>\s*([\d,.]+)',
433             info_page, 'view count', default=None))
434
435         formats = []
436         for format_id, format_url in data.items():
437             format_url = url_or_none(format_url)
438             if not format_url or not format_url.startswith(('http', '//', 'rtmp')):
439                 continue
440             if (format_id.startswith(('url', 'cache'))
441                     or format_id in ('extra_data', 'live_mp4', 'postlive_mp4')):
442                 height = int_or_none(self._search_regex(
443                     r'^(?:url|cache)(\d+)', format_id, 'height', default=None))
444                 formats.append({
445                     'format_id': format_id,
446                     'url': format_url,
447                     'height': height,
448                 })
449             elif format_id == 'hls':
450                 formats.extend(self._extract_m3u8_formats(
451                     format_url, video_id, 'mp4', 'm3u8_native',
452                     m3u8_id=format_id, fatal=False, live=is_live))
453             elif format_id == 'rtmp':
454                 formats.append({
455                     'format_id': format_id,
456                     'url': format_url,
457                     'ext': 'flv',
458                 })
459         self._sort_formats(formats)
460
461         return {
462             'id': video_id,
463             'formats': formats,
464             'title': title,
465             'thumbnail': data.get('jpg'),
466             'uploader': data.get('md_author'),
467             'uploader_id': str_or_none(data.get('author_id') or mv_data.get('authorId')),
468             'duration': int_or_none(data.get('duration') or mv_data.get('duration')),
469             'timestamp': timestamp,
470             'view_count': view_count,
471             'like_count': int_or_none(mv_data.get('likes')),
472             'comment_count': int_or_none(mv_data.get('commcount')),
473             'is_live': is_live,
474         }
475
476
477 class VKUserVideosIE(VKBaseIE):
478     IE_NAME = 'vk:uservideos'
479     IE_DESC = "VK - User's Videos"
480     _VALID_URL = r'https?://(?:(?:m|new)\.)?vk\.com/videos(?P<id>-?[0-9]+)(?!\?.*\bz=video)(?:[/?#&]|$)'
481     _TEMPLATE_URL = 'https://vk.com/videos'
482     _TESTS = [{
483         'url': 'http://vk.com/videos205387401',
484         'info_dict': {
485             'id': '205387401',
486         },
487         'playlist_mincount': 4,
488     }, {
489         'url': 'http://vk.com/videos-77521',
490         'only_matching': True,
491     }, {
492         'url': 'http://vk.com/videos-97664626?section=all',
493         'only_matching': True,
494     }, {
495         'url': 'http://m.vk.com/videos205387401',
496         'only_matching': True,
497     }, {
498         'url': 'http://new.vk.com/videos205387401',
499         'only_matching': True,
500     }]
501     _VIDEO = collections.namedtuple(
502         'Video', ['owner_id', 'id', 'thumb', 'title', 'flags', 'duration', 'hash', 'moder_acts', 'owner', 'date', 'views', 'platform', 'blocked', 'music_video_meta'])
503
504     def _real_extract(self, url):
505         page_id = self._match_id(url)
506
507         l = self._download_payload('al_video', page_id, {
508             'act': 'load_videos_silent',
509             'oid': page_id,
510         })[0]['']['list']
511
512         entries = []
513         for video in l:
514             v = self._VIDEO._make(video)
515             video_id = '%d_%d' % (v.owner_id, v.id)
516             entries.append(self.url_result(
517                 'http://vk.com/video' + video_id, 'VK', video_id=video_id))
518
519         return self.playlist_result(entries, page_id)
520
521
522 class VKWallPostIE(VKBaseIE):
523     IE_NAME = 'vk:wallpost'
524     _VALID_URL = r'https?://(?:(?:(?:(?:m|new)\.)?vk\.com/(?:[^?]+\?.*\bw=)?wall(?P<id>-?\d+_\d+)))'
525     _TESTS = [{
526         # public page URL, audio playlist
527         'url': 'https://vk.com/bs.official?w=wall-23538238_35',
528         'info_dict': {
529             'id': '-23538238_35',
530             'title': 'Black Shadow - Wall post -23538238_35',
531             'description': 'md5:3f84b9c4f9ef499731cf1ced9998cc0c',
532         },
533         'playlist': [{
534             'md5': '5ba93864ec5b85f7ce19a9af4af080f6',
535             'info_dict': {
536                 'id': '135220665_111806521',
537                 'ext': 'mp4',
538                 'title': 'Black Shadow - Слепое Верование',
539                 'duration': 370,
540                 'uploader': 'Black Shadow',
541                 'artist': 'Black Shadow',
542                 'track': 'Слепое Верование',
543             },
544         }, {
545             'md5': '4cc7e804579122b17ea95af7834c9233',
546             'info_dict': {
547                 'id': '135220665_111802303',
548                 'ext': 'mp4',
549                 'title': 'Black Shadow - Война - Негасимое Бездны Пламя!',
550                 'duration': 423,
551                 'uploader': 'Black Shadow',
552                 'artist': 'Black Shadow',
553                 'track': 'Война - Негасимое Бездны Пламя!',
554             },
555         }],
556         'params': {
557             'skip_download': True,
558             'usenetrc': True,
559         },
560         'skip': 'Requires vk account credentials',
561     }, {
562         # single YouTube embed, no leading -
563         'url': 'https://vk.com/wall85155021_6319',
564         'info_dict': {
565             'id': '85155021_6319',
566             'title': 'Сергей Горбунов - Wall post 85155021_6319',
567         },
568         'playlist_count': 1,
569         'params': {
570             'usenetrc': True,
571         },
572         'skip': 'Requires vk account credentials',
573     }, {
574         # wall page URL
575         'url': 'https://vk.com/wall-23538238_35',
576         'only_matching': True,
577     }, {
578         # mobile wall page URL
579         'url': 'https://m.vk.com/wall-23538238_35',
580         'only_matching': True,
581     }]
582     _BASE64_CHARS = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN0PQRSTUVWXYZO123456789+/='
583     _AUDIO = collections.namedtuple(
584         'Audio', ['id', 'owner_id', 'url', 'title', 'performer', 'duration', 'album_id', 'unk', 'author_link', 'lyrics', 'flags', 'context', 'extra', 'hashes', 'cover_url', 'ads', 'subtitle', 'main_artists', 'feat_artists', 'album', 'track_code', 'restriction', 'album_part', 'new_stats', 'access_key'])
585
586     def _decode(self, enc):
587         dec = ''
588         e = n = 0
589         for c in enc:
590             r = self._BASE64_CHARS.index(c)
591             cond = n % 4
592             e = 64 * e + r if cond else r
593             n += 1
594             if cond:
595                 dec += chr(255 & e >> (-2 * n & 6))
596         return dec
597
598     def _unmask_url(self, mask_url, vk_id):
599         if 'audio_api_unavailable' in mask_url:
600             extra = mask_url.split('?extra=')[1].split('#')
601             func, base = self._decode(extra[1]).split(chr(11))
602             mask_url = list(self._decode(extra[0]))
603             url_len = len(mask_url)
604             indexes = [None] * url_len
605             index = int(base) ^ vk_id
606             for n in range(url_len - 1, -1, -1):
607                 index = (url_len * (n + 1) ^ index + n) % url_len
608                 indexes[n] = index
609             for n in range(1, url_len):
610                 c = mask_url[n]
611                 index = indexes[url_len - 1 - n]
612                 mask_url[n] = mask_url[index]
613                 mask_url[index] = c
614             mask_url = ''.join(mask_url)
615         return mask_url
616
617     def _real_extract(self, url):
618         post_id = self._match_id(url)
619
620         webpage = self._download_payload('wkview', post_id, {
621             'act': 'show',
622             'w': 'wall' + post_id,
623         })[1]
624
625         description = clean_html(get_element_by_class('wall_post_text', webpage))
626         uploader = clean_html(get_element_by_class('author', webpage))
627
628         entries = []
629
630         for audio in re.findall(r'data-audio="([^"]+)', webpage):
631             audio = self._parse_json(unescapeHTML(audio), post_id)
632             a = self._AUDIO._make(audio)
633             if not a.url:
634                 continue
635             title = unescapeHTML(a.title)
636             performer = unescapeHTML(a.performer)
637             entries.append({
638                 'id': '%s_%s' % (a.owner_id, a.id),
639                 'url': self._unmask_url(a.url, a.ads['vk_id']),
640                 'title': '%s - %s' % (performer, title) if performer else title,
641                 'thumbnails': [{'url': c_url} for c_url in a.cover_url.split(',')] if a.cover_url else None,
642                 'duration': int_or_none(a.duration),
643                 'uploader': uploader,
644                 'artist': performer,
645                 'track': title,
646                 'ext': 'mp4',
647                 'protocol': 'm3u8',
648             })
649
650         for video in re.finditer(
651                 r'<a[^>]+href=(["\'])(?P<url>/video(?:-?[\d_]+).*?)\1', webpage):
652             entries.append(self.url_result(
653                 compat_urlparse.urljoin(url, video.group('url')), VKIE.ie_key()))
654
655         title = 'Wall post %s' % post_id
656
657         return self.playlist_result(
658             orderedSet(entries), post_id,
659             '%s - %s' % (uploader, title) if uploader else title,
660             description)