aboutsummaryrefslogtreecommitdiffstats
path: root/hypervideo_dl/extractor/nrk.py
diff options
context:
space:
mode:
Diffstat (limited to 'hypervideo_dl/extractor/nrk.py')
-rw-r--r--hypervideo_dl/extractor/nrk.py20
1 files changed, 8 insertions, 12 deletions
diff --git a/hypervideo_dl/extractor/nrk.py b/hypervideo_dl/extractor/nrk.py
index 4d723e8..88d08e5 100644
--- a/hypervideo_dl/extractor/nrk.py
+++ b/hypervideo_dl/extractor/nrk.py
@@ -1,22 +1,19 @@
-# coding: utf-8
-from __future__ import unicode_literals
-
import itertools
import random
import re
from .common import InfoExtractor
-from ..compat import compat_str
+from ..compat import compat_HTTPError, compat_str
from ..utils import (
- compat_HTTPError,
- determine_ext,
ExtractorError,
+ determine_ext,
int_or_none,
parse_duration,
+ parse_iso8601,
str_or_none,
try_get,
- urljoin,
url_or_none,
+ urljoin,
)
@@ -61,8 +58,7 @@ class NRKBaseIE(InfoExtractor):
return self._download_json(
urljoin('https://psapi.nrk.no/', path),
video_id, note or 'Downloading %s JSON' % item,
- fatal=fatal, query=query,
- headers={'Accept-Encoding': 'gzip, deflate, br'})
+ fatal=fatal, query=query)
class NRKIE(NRKBaseIE):
@@ -184,7 +180,6 @@ class NRKIE(NRKBaseIE):
'format_id': asset_format,
'vcodec': 'none',
})
- self._sort_formats(formats)
data = call_playback_api('metadata')
@@ -247,6 +242,7 @@ class NRKIE(NRKBaseIE):
'age_limit': age_limit,
'formats': formats,
'subtitles': subtitles,
+ 'timestamp': parse_iso8601(try_get(manifest, lambda x: x['availability']['onDemand']['from'], str))
}
if is_series:
@@ -738,7 +734,7 @@ class NRKTVSeriesIE(NRKTVSerieBaseIE):
entries, series_id, titles.get('title'), titles.get('subtitle'))
-class NRKTVDirekteIE(NRKTVIE):
+class NRKTVDirekteIE(NRKTVIE): # XXX: Do not subclass from concrete IE
IE_DESC = 'NRK TV Direkte and NRK Radio Direkte'
_VALID_URL = r'https?://(?:tv|radio)\.nrk\.no/direkte/(?P<id>[^/?#&]+)'
@@ -797,7 +793,7 @@ class NRKPlaylistBaseIE(InfoExtractor):
for video_id in re.findall(self._ITEM_RE, webpage)
]
- playlist_title = self. _extract_title(webpage)
+ playlist_title = self._extract_title(webpage)
playlist_description = self._extract_description(webpage)
return self.playlist_result(