]> jfr.im git - yt-dlp.git/commitdiff
[Nrk] See desc (#1382)
authorAlf Marius <redacted>
Fri, 22 Oct 2021 22:52:01 +0000 (00:52 +0200)
committerGitHub <redacted>
Fri, 22 Oct 2021 22:52:01 +0000 (04:22 +0530)
* Endpoint has changed. Currently the old one redirects to the new one, but this may change
* Descriptions use \r instead of \n. So translate it

Authored by: fractalf

yt_dlp/extractor/nrk.py

index b556bc6aa42dace21d271637493c5145126c723c..49d58a685b3b3b87531c13ccadaee15f3a33e68b 100644 (file)
@@ -147,7 +147,7 @@ class NRKIE(NRKBaseIE):
     def _real_extract(self, url):
         video_id = self._match_id(url).split('/')[-1]
 
-        path_templ = 'playback/%s/' + video_id
+        path_templ = 'playback/%s/program/' + video_id
 
         def call_playback_api(item, query=None):
             return self._call_api(path_templ % item, video_id, item, query=query)
@@ -188,7 +188,7 @@ def call_playback_api(item, query=None):
         title = titles['title']
         alt_title = titles.get('subtitle')
 
-        description = preplay.get('description')
+        description = try_get(preplay, lambda x: x['description'].replace('\r', '\n'))
         duration = parse_duration(playable.get('duration')) or parse_duration(data.get('duration'))
 
         thumbnails = []