mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2025-08-22 14:24:03 -07:00
Apply suggestions from code review
Co-authored-by: dirkf <fieldhouse@gmx.net>
This commit is contained in:
parent
7d1ca28fba
commit
0cef9940a0
1 changed files with 4 additions and 1 deletions
|
@ -3,6 +3,8 @@ from __future__ import unicode_literals
|
|||
|
||||
from .common import InfoExtractor
|
||||
|
||||
from ..utils import base_url
|
||||
|
||||
|
||||
class KommunetvIE(InfoExtractor):
|
||||
_VALID_URL = r'https://(\w+).kommunetv.no/archive/(?P<id>\w+)'
|
||||
|
@ -24,8 +26,9 @@ class KommunetvIE(InfoExtractor):
|
|||
data = self._download_json('https://oslo.kommunetv.no/api/streams?streamType=1&id=%s' % video_id, video_id, headers=headers)
|
||||
title = data['stream']['title']
|
||||
file = data['playlist'][0]['playlist'][0]['file']
|
||||
url = self._search_regex(r'(^[^\?]*)', file, 'url')
|
||||
url = base_url(file)
|
||||
formats = self._extract_m3u8_formats(url, video_id, ext='mp4', entry_protocol='m3u8_native', m3u8_id='hls', fatal=False)
|
||||
self._sort_formats(formats)
|
||||
return {
|
||||
'id': video_id,
|
||||
'formats': formats,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue