1 from .common
import InfoExtractor
2 from ..utils
import js_to_json
, urljoin
5 class DaystarClipIE(InfoExtractor
):
6 IE_NAME
= 'daystar:clip'
7 _VALID_URL
= r
'https?://player\.daystar\.tv/(?P<id>\w+)'
9 'url': 'https://player.daystar.tv/0MTO2ITM',
13 'title': 'The Dark World of COVID Pt. 1 | Aaron Siri',
14 'description': 'a420d320dda734e5f29458df3606c5f4',
15 'thumbnail': r
're:^https?://.+\.jpg',
19 def _real_extract(self
, url
):
20 video_id
= self
._match
_id
(url
)
21 webpage
= self
._download
_webpage
(url
, video_id
)
23 src_iframe
= self
._search
_regex
(r
'\<iframe[^>]+src="([^"]+)"', webpage
, 'src iframe')
24 webpage_iframe
= self
._download
_webpage
(
25 src_iframe
.replace('player.php', 'config2.php'), video_id
, headers
={'Referer': src_iframe
})
27 sources
= self
._parse
_json
(self
._search
_regex
(
28 r
'sources\:\s*(\[.*?\])', webpage_iframe
, 'm3u8 source'), video_id
, transform_source
=js_to_json
)
30 formats
, subtitles
= [], {}
31 for source
in sources
:
32 file = source
.get('file')
33 if file and source
.get('type') == 'm3u8':
34 fmts
, subs
= self
._extract
_m
3u8_formats
_and
_subtitles
(
35 urljoin('https://www.lightcast.com/embed/', file),
36 video_id
, 'mp4', fatal
=False, headers
={'Referer': src_iframe
})
38 subtitles
= self
._merge
_subtitles
(subtitles
, subs
)
42 'title': self
._html
_search
_meta
(['og:title', 'twitter:title'], webpage
),
43 'description': self
._html
_search
_meta
(['og:description', 'twitter:description'], webpage
),
44 'thumbnail': self
._search
_regex
(r
'image:\s*"([^"]+)', webpage_iframe
, 'thumbnail'),
46 'subtitles': subtitles
,