mirror of
https://github.com/yt-dlp/yt-dlp
synced 2025-01-13 20:01:57 +01:00
[nrk] Always use 'eea-portability' parameter on API calls
This commit is contained in:
parent
7ab6662997
commit
0468489e2d
1 changed files with 3 additions and 2 deletions
|
@ -61,7 +61,8 @@ class NRKBaseIE(InfoExtractor):
|
||||||
message = data.get('endUserMessage') or MESSAGES.get(message_type, message_type)
|
message = data.get('endUserMessage') or MESSAGES.get(message_type, message_type)
|
||||||
raise ExtractorError(f'{self.IE_NAME} said: {message}', expected=True)
|
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(
|
return self._download_json(
|
||||||
urljoin('https://psapi.nrk.no/', path),
|
urljoin('https://psapi.nrk.no/', path),
|
||||||
video_id, note or f'Downloading {item} JSON',
|
video_id, note or f'Downloading {item} JSON',
|
||||||
|
@ -203,7 +204,7 @@ class NRKIE(NRKBaseIE):
|
||||||
alt_title = titles.get('subtitle')
|
alt_title = titles.get('subtitle')
|
||||||
|
|
||||||
description = preplay.get('description')
|
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)
|
duration = parse_duration(playable.get('duration')) or parse_duration(data.get('duration')) or self._extract_m3u8_vod_duration(formats[0]['url'], video_id)
|
||||||
|
|
||||||
thumbnails = []
|
thumbnails = []
|
||||||
|
|
Loading…
Reference in a new issue