From 0468489e2d8b7211f3b98d9aff38d95d84564527 Mon Sep 17 00:00:00 2001 From: MrDemocracy Date: Sun, 8 Dec 2024 17:34:51 +0100 Subject: [PATCH] [nrk] Always use 'eea-portability' parameter on API calls --- yt_dlp/extractor/nrk.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/yt_dlp/extractor/nrk.py b/yt_dlp/extractor/nrk.py index 1982b681c8..8ae0de10fe 100644 --- a/yt_dlp/extractor/nrk.py +++ b/yt_dlp/extractor/nrk.py @@ -61,7 +61,8 @@ class NRKBaseIE(InfoExtractor): message = data.get('endUserMessage') or MESSAGES.get(message_type, message_type) raise ExtractorError(f'{self.IE_NAME} said: {message}', expected=True) - def _call_api(self, path, video_id, item=None, note=None, fatal=True, query=None): + def _call_api(self, path, video_id, item=None, note=None, fatal=True, query={}): + query['eea-portability'] = 'true' return self._download_json( urljoin('https://psapi.nrk.no/', path), video_id, note or f'Downloading {item} JSON', @@ -203,7 +204,7 @@ class NRKIE(NRKBaseIE): alt_title = titles.get('subtitle') description = preplay.get('description') - # Use m3u8 vod dueration for NRKSkoleIE because of incorrect duration in metadata + # Use m3u8 vod duration for NRKSkoleIE because of incorrect duration in metadata duration = parse_duration(playable.get('duration')) or parse_duration(data.get('duration')) or self._extract_m3u8_vod_duration(formats[0]['url'], video_id) thumbnails = []