]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/pladform.py
3 from .common
import InfoExtractor
14 class PladformIE(InfoExtractor
):
19 out\.pladform\.ru/player|
20 static\.pladform\.ru/player\.swf
23 video\.pladform\.ru/catalog/video/videoid/
28 'url': 'http://out.pladform.ru/player?pl=18079&type=html5&videoid=100231282',
30 'id': '6216d548e755edae6e8280667d774791',
32 'timestamp': 1406117012,
33 'title': 'Гарик Мартиросян и Гарик Харламов - Кастинг на концерт ко Дню милиции',
35 'upload_date': '20140723',
40 'uploader_id': '12082',
41 'uploader': 'Comedy Club',
44 'expected_warnings': ['HTTP Error 404: Not Found']
46 'url': 'https://out.pladform.ru/player?pl=64471&videoid=3777899&vk_puid15=0&vk_puid34=0',
47 'md5': '53362fac3a27352da20fa2803cc5cd6f',
51 'title': 'СТУДИЯ СОЮЗ • Шоу Студия Союз, 24 выпуск (01.02.2018) Нурлан Сабуров и Слава Комиссаренко',
52 'description': 'md5:05140e8bf1b7e2d46e7ba140be57fd95',
53 'thumbnail': r
're:^https?://.*\.jpg$',
57 'url': 'http://static.pladform.ru/player.swf?pl=21469&videoid=100183293&vkcid=0',
58 'only_matching': True,
60 'url': 'http://video.pladform.ru/catalog/video/videoid/100183293/vkcid/0',
61 'only_matching': True,
65 def _extract_url(webpage
):
67 r
'<iframe[^>]+src=(["\'])(?P
<url
>(?
:https?
:)?
//out\
.pladform\
.ru
/player
\?.+?
)\
1', webpage)
69 return mobj.group('url
')
71 def _real_extract(self, url):
72 video_id = self._match_id(url)
75 pl = qs.get('pl
', ['1'])[0]
77 video = self._download_xml(
78 'http
://out
.pladform
.ru
/getVideo
', video_id, query={
85 '%s returned error
: %s' % (self.IE_NAME, text),
89 targetUrl = self._request_webpage(url, video_id, note='Resolving final URL
').geturl()
91 raise ExtractorError('Can
\'t parse page
')
92 return self.url_result(targetUrl)
94 if video.tag == 'error
':
97 quality = qualities(('ld
', 'sd
', 'hd
'))
100 for src in video.findall('./src
'):
103 format_url = src.text
106 if src.get('type') == 'hls
' or determine_ext(format_url) == 'm3u8
':
107 formats.extend(self._extract_m3u8_formats(
108 format_url, video_id, 'mp4
', entry_protocol='m3u8_native
',
109 m3u8_id='hls
', fatal=False))
113 'format_id
': src.get('quality
'),
114 'quality
': quality(src.get('quality
')),
118 error = xpath_text(video, './cap
', 'error
', default=None)
122 self._sort_formats(formats)
124 webpage = self._download_webpage(
125 'http
://video
.pladform
.ru
/catalog
/video
/videoid
/%s' % video_id,
128 title = self._og_search_title(webpage, fatal=False) or xpath_text(
129 video, './/title
', 'title
', fatal=True)
130 description = self._search_regex(
131 r'</h3
>\s
*<p
>([^
<]+)</p
>', webpage, 'description
', fatal=False)
132 thumbnail = self._og_search_thumbnail(webpage) or xpath_text(
133 video, './/cover
', 'cover
')
135 duration = int_or_none(xpath_text(video, './/time
', 'duration
'))
136 age_limit = int_or_none(xpath_text(video, './/age18
', 'age limit
'))
141 'description
': description,
142 'thumbnail
': thumbnail,
143 'duration
': duration,
144 'age_limit
': age_limit,