diff options
author | Sergey M․ <dstftw@gmail.com> | 2020-03-14 04:58:24 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2020-03-14 04:58:24 +0700 |
commit | 4cbce88f8b44ab17d55fe1b7615e37a2c1f142d7 (patch) | |
tree | 24384fd9fd948dd55658ee968f1c76b5be8f9c4f | |
parent | 541fe3eaff579f72ccc14f97009a8904f739368f (diff) |
[ndr] Fix extraction (closes #24326)
-rw-r--r-- | youtube_dl/extractor/ndr.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/youtube_dl/extractor/ndr.py b/youtube_dl/extractor/ndr.py index 9c8bf05af..2447c812e 100644 --- a/youtube_dl/extractor/ndr.py +++ b/youtube_dl/extractor/ndr.py @@ -7,6 +7,7 @@ from .common import InfoExtractor from ..utils import ( determine_ext, int_or_none, + merge_dicts, parse_iso8601, qualities, try_get, @@ -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): |