1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-11-26 02:14:32 +01:00

NDR subtitles: fixed compatibility with python 2.6, ensured that errors are non-fatal

This commit is contained in:
Vyacheslav Karpukhin 2020-05-29 00:54:05 +02:00
parent e2d5f1cba6
commit 123519c328

View File

@ -239,7 +239,11 @@ class NDREmbedBaseIE(InfoExtractor):
'preference': quality_key(thumbnail.get('quality')),
})
subs = {it['srclang']: [{'url': urljoin(url, it['src']), 'ext': 'ttml'}] for it in config.get('tracks', [])}
try:
subs = dict((it['srclang'], [{'url': urljoin(url, it['src']), 'ext': 'ttml'}]) for it in config['tracks'])
except Exception as e:
subs = {}
self.report_warning("Extracting subtitles resulted in an error: " + str(e), video_id)
return {
'id': video_id,