From d71bc476a88a5b5bbaeefd0e51bee303d58260f1 Mon Sep 17 00:00:00 2001 From: Roxedus Date: Sat, 20 Jun 2020 03:33:44 +0200 Subject: [PATCH] [nrk:episode] Fixes KeyError Get content of meta tag Inspired by, and closes #25594 --- youtube_dl/extractor/nrk.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/youtube_dl/extractor/nrk.py b/youtube_dl/extractor/nrk.py index 94115534b72a..dc3d18490602 100644 --- a/youtube_dl/extractor/nrk.py +++ b/youtube_dl/extractor/nrk.py @@ -427,7 +427,8 @@ def _real_extract(self, url): nrk_id = self._parse_json( self._search_regex(JSON_LD_RE, webpage, 'JSON-LD', group='json_ld'), - display_id)['@id'] + display_id).get('@id') or \ + self._html_search_meta('nrk:program-id', webpage) assert re.match(NRKTVIE._EPISODE_RE, nrk_id) return self.url_result(