1 from .common
import InfoExtractor
2 from ..utils
import update_url
5 class KommunetvIE(InfoExtractor
):
6 _VALID_URL
= r
'https?://\w+\.kommunetv\.no/archive/(?P<id>\w+)'
8 'url': 'https://oslo.kommunetv.no/archive/921',
9 'md5': '5f102be308ee759be1e12b63d5da4bbc',
12 'title': 'Bystyremøte',
17 def _real_extract(self
, url
):
18 video_id
= self
._match
_id
(url
)
20 'Accept': 'application/json',
22 data
= self
._download
_json
(f
'https://oslo.kommunetv.no/api/streams?streamType=1&id={video_id}', video_id
, headers
=headers
)
23 title
= data
['stream']['title']
24 file = data
['playlist'][0]['playlist'][0]['file']
25 url
= update_url(file, query
=None, fragment
=None)
26 formats
= self
._extract
_m
3u8_formats
(url
, video_id
, ext
='mp4', entry_protocol
='m3u8_native', m3u8_id
='hls', fatal
=False)