Skip to content

Commit

Permalink
[nrk] Always use 'eea-portability' parameter on API calls
Browse files Browse the repository at this point in the history
  • Loading branch information
MrDemocracy authored Dec 8, 2024
1 parent 7ab6662 commit 0468489
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions yt_dlp/extractor/nrk.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ def _raise_error(self, data):
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',
Expand Down Expand Up @@ -203,7 +204,7 @@ def _real_extract(self, url):
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 = []
Expand Down

0 comments on commit 0468489

Please sign in to comment.