[nrk] Always use 'eea-portability' parameter on API calls

This commit is contained in:
MrDemocracy 2024-12-08 17:34:51 +01:00 committed by GitHub
parent 7ab6662997
commit 0468489e2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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