Skip to content

Commit

Permalink
[ndr] Fix extraction (closes #24326)
Browse files Browse the repository at this point in the history
  • Loading branch information
dstftw committed Mar 13, 2020
1 parent 541fe3e commit 4cbce88
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions youtube_dl/extractor/ndr.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from ..utils import (
determine_ext,
int_or_none,
merge_dicts,
parse_iso8601,
qualities,
try_get,
Expand Down Expand Up @@ -87,21 +88,25 @@ class NDRIE(NDRBaseIE):

def _extract_embed(self, webpage, display_id):
embed_url = self._html_search_meta(
'embedURL', webpage, 'embed URL', fatal=True)
'embedURL', webpage, 'embed URL',
default=None) or self._search_regex(
r'\bembedUrl["\']\s*:\s*(["\'])(?P<url>(?:(?!\1).)+)\1', webpage,
'embed URL', group='url')
description = self._search_regex(
r'<p[^>]+itemprop="description">([^<]+)</p>',
webpage, 'description', default=None) or self._og_search_description(webpage)
timestamp = parse_iso8601(
self._search_regex(
r'<span[^>]+itemprop="(?:datePublished|uploadDate)"[^>]+content="([^"]+)"',
webpage, 'upload date', fatal=False))
return {
webpage, 'upload date', default=None))
info = self._search_json_ld(webpage, display_id, default={})
return merge_dicts({
'_type': 'url_transparent',
'url': embed_url,
'display_id': display_id,
'description': description,
'timestamp': timestamp,
}
}, info)


class NJoyIE(NDRBaseIE):
Expand Down

0 comments on commit 4cbce88

Please sign in to comment.