diff options
author | mrtnmtth <mrtn.mtth@gmx.de> | 2019-10-15 22:22:57 +0200 |
---|---|---|
committer | mrtnmtth <mrtn.mtth@gmx.de> | 2019-10-15 22:22:57 +0200 |
commit | 6de54568d4eca99fead004845cdfe2b88752a485 (patch) | |
tree | 03587888701010b6392b774217c6310cc1fb97f5 | |
parent | 974311b5aa1a53564a00915b9228af30e2a5b40d (diff) | |
download | hypervideo-pre-6de54568d4eca99fead004845cdfe2b88752a485.tar.lz hypervideo-pre-6de54568d4eca99fead004845cdfe2b88752a485.tar.xz hypervideo-pre-6de54568d4eca99fead004845cdfe2b88752a485.zip |
[wdr] fix subtitle extraction
-rw-r--r-- | youtube_dl/extractor/wdr.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/youtube_dl/extractor/wdr.py b/youtube_dl/extractor/wdr.py index cf6f7c7ed..44d4a13ca 100644 --- a/youtube_dl/extractor/wdr.py +++ b/youtube_dl/extractor/wdr.py @@ -45,9 +45,18 @@ class WDRIE(InfoExtractor): media_resource = metadata['mediaResource'] formats = [] + subtitles = {} # check if the metadata contains a direct URL to a file for kind, media_resource in media_resource.items(): + if kind == 'captionsHash': + for ext, url in media_resource.items(): + subtitles.setdefault('de', []).append({ + 'url': url, + 'ext': ext, + }) + continue + if kind not in ('dflt', 'alt'): continue @@ -81,14 +90,6 @@ class WDRIE(InfoExtractor): self._sort_formats(formats) - subtitles = {} - caption_url = media_resource.get('captionURL') - if caption_url: - subtitles['de'] = [{ - 'url': caption_url, - 'ext': 'ttml', - }] - title = tracker_data['trackerClipTitle'] return { |