From 5122028a4bcac4ae577ef7fbd55ccad5cb34ef5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs?= Date: Mon, 18 Oct 2021 15:24:21 -0500 Subject: update from upstream --- hypervideo_dl/extractor/wdr.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'hypervideo_dl/extractor/wdr.py') diff --git a/hypervideo_dl/extractor/wdr.py b/hypervideo_dl/extractor/wdr.py index 2903d18..f54aa6f 100644 --- a/hypervideo_dl/extractor/wdr.py +++ b/hypervideo_dl/extractor/wdr.py @@ -44,17 +44,25 @@ class WDRIE(InfoExtractor): tracker_data = metadata['trackerData'] title = tracker_data['trackerClipTitle'] - media_resource = metadata['mediaResource'] formats = [] + subtitles = {} # check if the metadata contains a direct URL to a file for kind, media in media_resource.items(): - if not isinstance(media, dict): + if kind == 'captionsHash': + for ext, url in media.items(): + subtitles.setdefault('de', []).append({ + 'url': url, + 'ext': ext, + }) continue + if kind not in ('dflt', 'alt'): continue + if not isinstance(media, dict): + continue for tag_name, medium_url in media.items(): if tag_name not in ('videoURL', 'audioURL'): @@ -86,7 +94,6 @@ class WDRIE(InfoExtractor): self._sort_formats(formats) - subtitles = {} caption_url = media_resource.get('captionURL') if caption_url: subtitles['de'] = [{ @@ -233,7 +240,7 @@ class WDRPageIE(InfoExtractor): ] def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) + mobj = self._match_valid_url(url) display_id = mobj.group('display_id') webpage = self._download_webpage(url, display_id) @@ -335,7 +342,7 @@ class WDRMobileIE(InfoExtractor): } def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) + mobj = self._match_valid_url(url) return { 'id': mobj.group('id'), 'title': mobj.group('title'), -- cgit v1.2.3