mirror of
https://codeberg.org/polarisfm/youtube-dl
synced 2024-11-22 16:44:32 +01:00
NDR subtitles: fixed compatibility with python 2.6, ensured that errors are non-fatal
This commit is contained in:
parent
e2d5f1cba6
commit
123519c328
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user