1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-22 16:44:32 +01:00

Work around vtt subtitle not announced in nrk JSON

This commit is contained in:
alarig 2018-05-12 00:52:02 +02:00
parent 0ec9d4e565
commit 56f37a64e0

View File

@ -75,8 +75,9 @@ class NRKBaseIE(InfoExtractor):
entry_id, entry_title = video_id_and_title(num)
duration = parse_duration(asset.get('duration'))
subtitles = {}
for subtitle in ('webVtt', 'timedText'):
subtitle_url = asset.get('%sSubtitlesUrl' % subtitle)
subtitle_base = asset.get('timedTextSubtitlesUrl')
for subtitle in ('ttml', 'vtt'):
subtitle_url = re.sub(r"ttml$", subtitle, subtitle_base)
if subtitle_url:
subtitles.setdefault('no', []).append({
'url': compat_urllib_parse_unquote(subtitle_url)