From 0aa9d9650d335dbb8991be3e853e98ea39dbf583 Mon Sep 17 00:00:00 2001 From: Moritz Barsnick Date: Mon, 3 Dec 2018 23:02:56 +0100 Subject: [PATCH] [nrktv] add additional URL scheme for episodes Series' episodes seem to have gained an additional URL scheme. This expands the valid URL for NRKTVEpisodeIE. A test was also added, but it fails due to a proper update of the EPISODE_RE. (The existing test also fails, so d'uh.) NRKTVSeriesIE may also need to be adapted. Fixes g3/youtube-dl#18304 --- youtube_dl/extractor/nrk.py | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/youtube_dl/extractor/nrk.py b/youtube_dl/extractor/nrk.py index a231735fb..ca7d341f8 100644 --- a/youtube_dl/extractor/nrk.py +++ b/youtube_dl/extractor/nrk.py @@ -366,8 +366,8 @@ class NRKTVIE(NRKBaseIE): class NRKTVEpisodeIE(InfoExtractor): - _VALID_URL = r'https?://tv\.nrk\.no/serie/(?P[^/]+/sesong/\d+/episode/\d+)' - _TEST = { + _VALID_URL = r'https?://tv\.nrk\.no/serie/(?P[^/]+/(sesong/\d+/episode/\d+|\d+/[a-zA-Z]{4}\d{8}))' + _TESTS = [{ 'url': 'https://tv.nrk.no/serie/backstage/sesong/1/episode/8', 'info_dict': { 'id': 'MSUI14000816AA', @@ -383,7 +383,24 @@ class NRKTVEpisodeIE(InfoExtractor): 'params': { 'skip_download': True, }, - } + }, + { + 'url': 'https://tv.nrk.no/serie/lindmo/2018/MUHU11006318/avspiller', + 'info_dict': { + 'id': 'MUHU11006318AA', + 'ext': 'mp4', + 'title': 'Lindmo 23.11.2018', + 'description': 'md5:370fb1fffa22cb0f47ab4b8453fc8070', + 'duration': 3024, + 'series': 'Lindmo', + 'season_number': 2018, + 'episode_number': None, + 'episode': '23. november', + }, + 'params': { + 'skip_download': True, + }, + }] def _real_extract(self, url): display_id = self._match_id(url)