[cleanup] Misc (#11574)
[yt-dlp3.git] / yt_dlp / extractor / vodplatform.py
blob703854bc8776d55446ab96e5760bbad15132700c
1 from .common import InfoExtractor
2 from ..utils import unescapeHTML
5 class VODPlatformIE(InfoExtractor):
6 _VALID_URL = r'https?://(?:(?:www\.)?vod-platform\.net|embed\.kwikmotion\.com)/[eE]mbed/(?P<id>[^/?#]+)'
7 _EMBED_REGEX = [r'<iframe[^>]+src=(["\'])(?P<url>(?:https?:)?//(?:(?:www\.)?vod-platform\.net|embed\.kwikmotion\.com)/[eE]mbed/.+?)\1']
8 _TESTS = [{
9 # from http://www.lbcgroup.tv/watch/chapter/29143/52844/%D8%A7%D9%84%D9%86%D8%B5%D8%B1%D8%A9-%D9%81%D9%8A-%D8%B6%D9%8A%D8%A7%D9%81%D8%A9-%D8%A7%D9%84%D9%80-cnn/ar
10 'url': 'http://vod-platform.net/embed/RufMcytHDolTH1MuKHY9Fw',
11 'md5': '1db2b7249ce383d6be96499006e951fc',
12 'info_dict': {
13 'id': 'RufMcytHDolTH1MuKHY9Fw',
14 'ext': 'mp4',
15 'title': 'LBCi News_ النصرة في ضيافة الـ "سي.أن.أن"',
17 }, {
18 'url': 'http://embed.kwikmotion.com/embed/RufMcytHDolTH1MuKHY9Fw',
19 'only_matching': True,
22 def _real_extract(self, url):
23 video_id = self._match_id(url)
24 webpage = self._download_webpage(url, video_id)
26 title = unescapeHTML(self._og_search_title(webpage))
27 hidden_inputs = self._hidden_inputs(webpage)
29 formats = self._extract_wowza_formats(
30 hidden_inputs.get('HiddenmyhHlsLink') or hidden_inputs['HiddenmyDashLink'], video_id, skip_protocols=['f4m', 'smil'])
32 return {
33 'id': video_id,
34 'title': title,
35 'thumbnail': hidden_inputs.get('HiddenThumbnail') or self._og_search_thumbnail(webpage),
36 'formats': formats,