Repository: yt-dlp/yt-dlp
File: yt_dlp/extractor/nrk.py (Python)

Code before:
            'age_limit': 6,
        },
        'params': {
            'skip_download': True,
        },
    }, {
        'url': 'https://tv.nrk.no/serie/backstage/sesong/1/episode/8',
        'info_dict': {
            'id': 'MSUI14000816',
            'ext': 'mp4',
            'title': 'Backstage - 8. episode',
            'description': 'md5:de6ca5d5a2d56849e4021f2bf2850df4',
            'duration': 1320,
            'series': 'Backstage',
            'season_number': 1,
            'episode_number': 8,
            'episode': '8. episode',
            'age_limit': 0,
        },
        'params': {
            'skip_download': True,
        },
        'skip': 'ProgramRightsHasExpired',
    }]

    def _real_extract(self, url):
        display_id, season_number, episode_number = self._match_valid_url(url).group(
            'id', 'season_number', 'episode_number')
        webpage, urlh = self._download_webpage_handle(url, display_id)

        if NRKTVIE.suitable(urlh.url):
            nrk_id = NRKTVIE._match_id(urlh.url)
        else:
            nrk_id = self._search_json(
                r'<script\b[^>]+\bid="pageData"[^>]*>', webpage,
                'page data', display_id)['initialState']['selectedEpisodePrfId']
            if not re.fullmatch(NRKTVIE._EPISODE_RE, nrk_id):
                raise ExtractorError('Unable to extract NRK ID')

        return self.url_result(
            f'nrk:{nrk_id}', NRKIE, nrk_id,
            season_number=int(season_number),
            episode_number=int(episode_number))


class NRKTVSerieBaseIE(NRKBaseIE):
    def _extract_entries(self, entry_list):
        if not isinstance(entry_list, list):
            return []
        entries = []
        for episode in entry_list:

Review comment (bug):
The working test-case could have this entry, say after the `'url'` line. It indicates that the test-case is expected to fail if any IE (key) in the list is not `_WORKING`:   
```py
        'add_ie': [NRKIE.ie_key()],
```

Code after:
            'episode': '2. Kro, krig og kjærlighet',
            'age_limit': 6,
        },
        'params': {
            'skip_download': True,
        },
    }, {
        'url': 'https://tv.nrk.no/serie/backstage/sesong/1/episode/8',
        'info_dict': {
            'id': 'MSUI14000816',
            'ext': 'mp4',
            'title': 'Backstage - 8. episode',
            'description': 'md5:de6ca5d5a2d56849e4021f2bf2850df4',
            'duration': 1320,
            'series': 'Backstage',
            'season_number': 1,
            'episode_number': 8,
            'episode': '8. episode',
            'age_limit': 0,
        },
        'params': {
            'skip_download': True,
        },
        'skip': 'ProgramRightsHasExpired',
    }]

    def _real_extract(self, url):
        display_id, season_number, episode_number = self._match_valid_url(url).group(
            'id', 'season_number', 'episode_number')
        webpage, urlh = self._download_webpage_handle(url, display_id)

        if NRKTVIE.suitable(urlh.url):
            nrk_id = NRKTVIE._match_id(urlh.url)
        else:
            nrk_id = self._search_json(
                r'<script\b[^>]+\bid="pageData"[^>]*>', webpage,
                'page data', display_id)['initialState']['selectedEpisodePrfId']
            if not re.fullmatch(NRKTVIE._EPISODE_RE, nrk_id):
                raise ExtractorError('Unable to extract NRK ID')

        return self.url_result(
            f'nrk:{nrk_id}', NRKIE, nrk_id,
            season_number=int(season_number),
            episode_number=int(episode_number))


class NRKTVSerieBaseIE(NRKBaseIE):
    def _extract_entries(self, entry_list):
        if not isinstance(entry_list, list):
            return []
        entries = []