0
0
Fork 0
mirror of https://github.com/yt-dlp/yt-dlp.git synced 2024-11-22 02:15:12 +00:00

[Nrk] See desc (#1382)

* 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
This commit is contained in:
Alf Marius 2021-10-23 00:52:01 +02:00 committed by GitHub
parent 1117579b94
commit 93c7f3398d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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 = []