Skip to content

Commit

Permalink
[nrk:episode] Fixes KeyError
Browse files Browse the repository at this point in the history
Get content of meta tag
Inspired by, and closes #25594
  • Loading branch information
Roxedus committed Jun 20, 2020
1 parent 2391941 commit d71bc47
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion youtube_dl/extractor/nrk.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit d71bc47

Please sign in to comment.