- video_id = mobj.group('idv1')
-
- if not video_id:
- video_id = mobj.group('idv2prefix') + mobj.group('idv2suffix')
-
- webpage = self._download_webpage(url, video_id)
+ meta_id = mobj.group('metaid')
+
+ video_id = None
+ if meta_id:
+ meta_url = 'https://my.mail.ru/+/video/meta/%s' % meta_id
+ else:
+ video_id = mobj.group('idv1')
+ if not video_id:
+ video_id = mobj.group('idv2prefix') + mobj.group('idv2suffix')
+ webpage = self._download_webpage(url, video_id)
+ page_config = self._parse_json(self._search_regex(
+ r'(?s)<script[^>]+class="sp-video__page-config"[^>]*>(.+?)</script>',
+ webpage, 'page config', default='{}'), video_id, fatal=False)
+ if page_config:
+ meta_url = page_config.get('metaUrl') or page_config.get('video', {}).get('metaUrl')
+ else:
+ meta_url = None