1 from .common
import InfoExtractor
2 from ..utils
import traverse_obj
5 class Screen9IE(InfoExtractor
):
6 _VALID_URL
= r
'https?://(?:\w+\.screen9\.(?:tv|com)|play\.su\.se)/(?:embed|media)/(?P<id>[^?#/]+)'
9 'url': 'https://api.screen9.com/embed/8kTNEjvoXGM33dmWwF0uDA',
10 'md5': 'd60d23f8980583b930724b01fa6ddb41',
12 'id': '8kTNEjvoXGM33dmWwF0uDA',
14 'title': 'Östersjön i förändrat klimat',
15 'thumbnail': r
're:^https?://.+\.jpg',
19 'url': 'https://folkhogskolekanalen.screen9.tv/media/gy35PKLHe-5K29RYHga2bw/ett-starkare-samhalle-en-snabbguide-om-sveriges-folkhogskolor',
20 'md5': 'c9389806e78573ea34fc48b6f94465dc',
22 'id': 'gy35PKLHe-5K29RYHga2bw',
24 'title': 'Ett starkare samhälle - en snabbguide om Sveriges folkhögskolor',
25 'thumbnail': r
're:^https?://.+\.jpg',
29 'url': 'https://play.su.se/media/H1YA0EYNCxiesrSU1kaRBQ/baltic-breakfast',
30 'md5': '2b817647c3058002526269deff4c0683',
32 'id': 'H1YA0EYNCxiesrSU1kaRBQ',
34 'title': 'Baltic Breakfast',
35 'thumbnail': r
're:^https?://.+\.jpg',
40 def _real_extract(self
, url
):
41 video_id
= self
._match
_id
(url
)
42 webpage
= self
._download
_webpage
(f
'https://api.screen9.com/embed/{video_id}', video_id
)
43 config
= self
._search
_json
(r
'var\s+config\s*=', webpage
, 'config', video_id
)
44 formats
, subtitles
= self
._extract
_m
3u8_formats
_and
_subtitles
(
45 traverse_obj(config
, ('src', lambda _
, v
: v
['type'] == 'application/x-mpegURL', 'src'), get_all
=False),
48 'url': traverse_obj(config
, ('src', lambda _
, v
: v
['type'] == 'video/mp4', 'src'), get_all
=False),
54 'title': traverse_obj(
56 ('plugins', (('title', 'title'), ('googleAnalytics', 'title'), ('share', 'mediaTitle'))),
58 'description': traverse_obj(config
, ('plugins', 'title', 'description')),
59 'thumbnail': traverse_obj(config
, ('poster')),
61 'subtitles': subtitles
,