[nrk:base] Fall back to another endpoint for season and episode number

Prevents some long-running series from returning `NA`
This commit is contained in:
Roxedus 2020-06-21 21:25:05 +02:00
parent 2be9bcaae6
commit 5063afc5df
Signed by: Roxedus
GPG Key ID: 9B4E311961C63639

View File

@ -148,6 +148,13 @@ class NRKBaseIE(InfoExtractor):
EPISODENUM_RE, _season_episode, 'episode number', EPISODENUM_RE, _season_episode, 'episode number',
default=None, group='episode')) default=None, group='episode'))
if not season_number or episode_number:
programs = self._download_json(
'http://%s/programs/%s' % (self._api_host, video_id),
video_id, 'Downloading programs manifest JSON')
season_number = int_or_none(programs.get('seasonNumber'))
episode_number = int_or_none(programs.get('episodeNumber'))
thumbnails = None thumbnails = None
images = data.get('images') images = data.get('images')
if images and isinstance(images, dict): if images and isinstance(images, dict):