+
+ def _extract_mobile(self, url):
+ video_id = self._match_id(url)
+
+ webpage = self._download_webpage(
+ 'http://m.ok.ru/video/%s' % video_id, video_id,
+ note='Downloading mobile webpage')
+
+ error = self._search_regex(
+ r'видео</a>\s*<div\s+class="empty">(.+?)</div>',
+ webpage, 'error', default=None)
+ if error:
+ raise ExtractorError(error, expected=True)
+
+ json_data = self._search_regex(
+ r'data-video="(.+?)"', webpage, 'json data')
+ json_data = self._parse_json(unescapeHTML(json_data), video_id) or {}
+
+ return {
+ 'id': video_id,
+ 'title': json_data.get('videoName'),
+ 'duration': float_or_none(json_data.get('videoDuration'), scale=1000),
+ 'thumbnail': json_data.get('videoPosterSrc'),
+ 'formats': [{
+ 'format_id': 'mobile',
+ 'url': json_data.get('videoSrc'),
+ 'ext': 'mp4',
+ }]
+ }