1 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/
25 _EMBED_REGEX
= [r
'<iframe[^>]+src=(["\'])(?P
<url
>(?
:https?
:)?
//out\
.pladform\
.ru
/player
\?.+?
)\
1']
27 'url
': 'http
://out
.pladform
.ru
/player?pl
=18079&type=html5
&videoid
=100231282',
29 'id': '6216d548e755edae6e8280667d774791
',
31 'timestamp
': 1406117012,
32 'title
': 'Гарик Мартиросян и Гарик Харламов
- Кастинг на концерт ко Дню милиции
',
34 'upload_date
': '20140723',
39 'uploader_id
': '12082',
40 'uploader
': 'Comedy Club
',
43 'expected_warnings
': ['HTTP Error
404: Not Found
']
45 'url
': 'https
://out
.pladform
.ru
/player?pl
=64471&videoid
=3777899&vk_puid15
=0&vk_puid34
=0',
46 'md5
': '53362fac3a27352da20fa2803cc5cd6f
',
50 'title
': 'СТУДИЯ СОЮЗ • Шоу Студия Союз
, 24 выпуск
(01.02.2018) Нурлан Сабуров и Слава Комиссаренко
',
51 'description
': 'md5
:05140e8bf1b7e2d46e7ba140be57fd95
',
52 'thumbnail
': r're
:^https?
://.*\
.jpg$
',
56 'url
': 'http
://static
.pladform
.ru
/player
.swf?pl
=21469&videoid
=100183293&vkcid
=0',
57 'only_matching
': True,
59 'url
': 'http
://video
.pladform
.ru
/catalog
/video
/videoid
/100183293/vkcid
/0',
60 'only_matching
': True,
63 def _real_extract(self, url):
64 video_id = self._match_id(url)
67 pl = qs.get('pl
', ['1'])[0]
69 video = self._download_xml(
70 'http
://out
.pladform
.ru
/getVideo
', video_id, query={
77 '%s returned error
: %s' % (self.IE_NAME, text),
81 targetUrl = self._request_webpage(url, video_id, note='Resolving final URL
').geturl()
83 raise ExtractorError('Can
\'t parse page
')
84 return self.url_result(targetUrl)
86 if video.tag == 'error
':
89 quality = qualities(('ld
', 'sd
', 'hd
'))
92 for src in video.findall('./src
'):
98 if src.get('type') == 'hls
' or determine_ext(format_url) == 'm3u8
':
99 formats.extend(self._extract_m3u8_formats(
100 format_url, video_id, 'mp4
', entry_protocol='m3u8_native
',
101 m3u8_id='hls
', fatal=False))
105 'format_id
': src.get('quality
'),
106 'quality
': quality(src.get('quality
')),
110 error = xpath_text(video, './cap
', 'error
', default=None)
114 webpage = self._download_webpage(
115 'http
://video
.pladform
.ru
/catalog
/video
/videoid
/%s' % video_id,
118 title = self._og_search_title(webpage, fatal=False) or xpath_text(
119 video, './/title
', 'title
', fatal=True)
120 description = self._search_regex(
121 r'</h3
>\s
*<p
>([^
<]+)</p
>', webpage, 'description
', fatal=False)
122 thumbnail = self._og_search_thumbnail(webpage) or xpath_text(
123 video, './/cover
', 'cover
')
125 duration = int_or_none(xpath_text(video, './/time
', 'duration
'))
126 age_limit = int_or_none(xpath_text(video, './/age18
', 'age limit
'))
131 'description
': description,
132 'thumbnail
': thumbnail,
133 'duration
': duration,
134 'age_limit
': age_limit,