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',
38 'uploader_id
': '12082',
39 'uploader
': 'Comedy Club
',
42 'expected_warnings
': ['HTTP Error
404: Not Found
'],
44 'url
': 'https
://out
.pladform
.ru
/player?pl
=64471&videoid
=3777899&vk_puid15
=0&vk_puid34
=0',
45 'md5
': '53362fac3a27352da20fa2803cc5cd6f
',
49 'title
': 'СТУДИЯ СОЮЗ • Шоу Студия Союз
, 24 выпуск
(01.02.2018) Нурлан Сабуров и Слава Комиссаренко
',
50 'description
': 'md5
:05140e8bf1b7e2d46e7ba140be57fd95
',
51 'thumbnail
': r're
:^https?
://.*\
.jpg$
',
55 'url
': 'http
://static
.pladform
.ru
/player
.swf?pl
=21469&videoid
=100183293&vkcid
=0',
56 'only_matching
': True,
58 'url
': 'http
://video
.pladform
.ru
/catalog
/video
/videoid
/100183293/vkcid
/0',
59 'only_matching
': True,
62 def _real_extract(self, url):
63 video_id = self._match_id(url)
66 pl = qs.get('pl
', ['1'])[0]
68 video = self._download_xml(
69 'http
://out
.pladform
.ru
/getVideo
', video_id, query={
76 f'{self
.IE_NAME
} returned error
: {text}
',
80 target_url = self._request_webpage(url, video_id, note='Resolving final URL
').url
82 raise ExtractorError('Can
\'t parse page
')
83 return self.url_result(target_url)
85 if video.tag == 'error
':
88 quality = qualities(('ld
', 'sd
', 'hd
'))
91 for src in video.findall('./src
'):
97 if src.get('type') == 'hls
' or determine_ext(format_url) == 'm3u8
':
98 formats.extend(self._extract_m3u8_formats(
99 format_url, video_id, 'mp4
', entry_protocol='m3u8_native
',
100 m3u8_id='hls
', fatal=False))
104 'format_id
': src.get('quality
'),
105 'quality
': quality(src.get('quality
')),
109 error = xpath_text(video, './cap
', 'error
', default=None)
113 webpage = self._download_webpage(
114 f'http
://video
.pladform
.ru
/catalog
/video
/videoid
/{video_id}
',
117 title = self._og_search_title(webpage, fatal=False) or xpath_text(
118 video, './/title
', 'title
', fatal=True)
119 description = self._search_regex(
120 r'</h3
>\s
*<p
>([^
<]+)</p
>', webpage, 'description
', fatal=False)
121 thumbnail = self._og_search_thumbnail(webpage) or xpath_text(
122 video, './/cover
', 'cover
')
124 duration = int_or_none(xpath_text(video, './/time
', 'duration
'))
125 age_limit = int_or_none(xpath_text(video, './/age18
', 'age limit
'))
130 'description
': description,
131 'thumbnail
': thumbnail,
132 'duration
': duration,
133 'age_limit
': age_limit,