]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/extractor/nrk.py
Don't download entire video when no matching `--download-sections`
[yt-dlp.git] / yt_dlp / extractor / nrk.py
index 4d723e886888bb8a0fdd9c36ab6b8db97a0b2090..fcbafe4188cf5dedb16289b27389c0bd18b9a6ed 100644 (file)
@@ -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,
 )
 
 
@@ -247,6 +244,7 @@ def call_playback_api(item, query=None):
             'age_limit': age_limit,
             'formats': formats,
             'subtitles': subtitles,
+            'timestamp': parse_iso8601(try_get(manifest, lambda x: x['availability']['onDemand']['from'], str))
         }
 
         if is_series:
@@ -797,7 +795,7 @@ def _real_extract(self, url):
             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(