]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/pladform.py
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
17 class PladformIE(InfoExtractor
):
22 out\.pladform\.ru/player|
23 static\.pladform\.ru/player\.swf
26 video\.pladform\.ru/catalog/video/videoid/
31 'url': 'http://out.pladform.ru/player?pl=18079&type=html5&videoid=100231282',
33 'id': '6216d548e755edae6e8280667d774791',
35 'timestamp': 1406117012,
36 'title': 'Гарик Мартиросян и Гарик Харламов - Кастинг на концерт ко Дню милиции',
38 'upload_date': '20140723',
43 'uploader_id': '12082',
44 'uploader': 'Comedy Club',
47 'expected_warnings': ['HTTP Error 404: Not Found']
49 'url': 'https://out.pladform.ru/player?pl=64471&videoid=3777899&vk_puid15=0&vk_puid34=0',
50 'md5': '53362fac3a27352da20fa2803cc5cd6f',
54 'title': 'СТУДИЯ СОЮЗ • Шоу Студия Союз, 24 выпуск (01.02.2018) Нурлан Сабуров и Слава Комиссаренко',
55 'description': 'md5:05140e8bf1b7e2d46e7ba140be57fd95',
56 'thumbnail': r
're:^https?://.*\.jpg$',
60 'url': 'http://static.pladform.ru/player.swf?pl=21469&videoid=100183293&vkcid=0',
61 'only_matching': True,
63 'url': 'http://video.pladform.ru/catalog/video/videoid/100183293/vkcid/0',
64 'only_matching': True,
68 def _extract_url(webpage
):
70 r
'<iframe[^>]+src=(["\'])(?P
<url
>(?
:https?
:)?
//out\
.pladform\
.ru
/player
\?.+?
)\
1', webpage)
72 return mobj.group('url
')
74 def _real_extract(self, url):
75 video_id = self._match_id(url)
78 pl = qs.get('pl
', ['1'])[0]
80 video = self._download_xml(
81 'http
://out
.pladform
.ru
/getVideo
', video_id, query={
88 '%s returned error
: %s' % (self.IE_NAME, text),
92 targetUrl = self._request_webpage(url, video_id, note='Resolving final URL
').geturl()
94 raise ExtractorError('Can
\'t parse page
')
95 return self.url_result(targetUrl)
97 if video.tag == 'error
':
100 quality = qualities(('ld
', 'sd
', 'hd
'))
103 for src in video.findall('./src
'):
106 format_url = src.text
109 if src.get('type') == 'hls
' or determine_ext(format_url) == 'm3u8
':
110 formats.extend(self._extract_m3u8_formats(
111 format_url, video_id, 'mp4
', entry_protocol='m3u8_native
',
112 m3u8_id='hls
', fatal=False))
116 'format_id
': src.get('quality
'),
117 'quality
': quality(src.get('quality
')),
121 error = xpath_text(video, './cap
', 'error
', default=None)
125 self._sort_formats(formats)
127 webpage = self._download_webpage(
128 'http
://video
.pladform
.ru
/catalog
/video
/videoid
/%s' % video_id,
131 title = self._og_search_title(webpage, fatal=False) or xpath_text(
132 video, './/title
', 'title
', fatal=True)
133 description = self._search_regex(
134 r'</h3
>\s
*<p
>([^
<]+)</p
>', webpage, 'description
', fatal=False)
135 thumbnail = self._og_search_thumbnail(webpage) or xpath_text(
136 video, './/cover
', 'cover
')
138 duration = int_or_none(xpath_text(video, './/time
', 'duration
'))
139 age_limit = int_or_none(xpath_text(video, './/age18
', 'age limit
'))
144 'description
': description,
145 'thumbnail
': thumbnail,
146 'duration
': duration,
147 'age_limit
': age_limit,