2 from __future__ import unicode_literals
4 from .common import InfoExtractor
12 class PladformIE(InfoExtractor):
17 out\.pladform\.ru/player|
18 static\.pladform\.ru/player\.swf
21 video\.pladform\.ru/catalog/video/videoid/
26 # http://muz-tv.ru/kinozal/view/7400/
27 'url': 'http://out.pladform.ru/player?pl=24822&videoid=100183293',
28 'md5': '61f37b575dd27f1bb2e1854777fe31f4',
32 'title': 'Тайны перевала Дятлова • Тайна перевала Дятлова 1 серия 2 часть',
33 'description': 'Документальный сериал-расследование одной из самых жутких тайн ХХ века',
34 'thumbnail': 're:^https?://.*\.jpg$',
39 'url': 'http://static.pladform.ru/player.swf?pl=21469&videoid=100183293&vkcid=0',
40 'only_matching': True,
42 'url': 'http://video.pladform.ru/catalog/video/videoid/100183293/vkcid/0',
43 'only_matching': True,
46 def _real_extract(self, url):
47 video_id = self._match_id(url)
49 video = self._download_xml(
50 'http://out.pladform.ru/getVideo?pl=1&videoid=%s' % video_id,
53 if video.tag == 'error':
55 '%s returned error: %s' % (self.IE_NAME, video.text),
60 'format_id': src.get('quality'),
61 } for src in video.findall('./src')]
62 self._sort_formats(formats)
64 webpage = self._download_webpage(
65 'http://video.pladform.ru/catalog/video/videoid/%s' % video_id,
68 title = self._og_search_title(webpage, fatal=False) or xpath_text(
69 video, './/title', 'title', fatal=True)
70 description = self._search_regex(
71 r'</h3>\s*<p>([^<]+)</p>', webpage, 'description', fatal=False)
72 thumbnail = self._og_search_thumbnail(webpage) or xpath_text(
73 video, './/cover', 'cover')
75 duration = int_or_none(xpath_text(video, './/time', 'duration'))
76 age_limit = int_or_none(xpath_text(video, './/age18', 'age limit'))
81 'description': description,
82 'thumbnail': thumbnail,
84 'age_limit': age_limit,