mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-10 19:30:39 +00:00
Merge branch 'wdr-subtitles' of https://github.com/mrtnmtth/youtube-dl into mrtnmtth-wdr-subtitles
This commit is contained in:
commit
47b9774231
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user