fix subtitle language

This commit is contained in:
j 2019-08-01 20:54:04 +02:00
parent b49acd47dc
commit 23a641189c

View file

@ -296,13 +296,17 @@ def ffprobe(filename):
elif s.get('codec_type') == 'subtitle': elif s.get('codec_type') == 'subtitle':
info['subtitles'] = info.get('subtitles', []) info['subtitles'] = info.get('subtitles', [])
stream = {} stream = {}
if language and language != 'und':
stream['language'] = language
for key in ( for key in (
'codec_name', 'language' 'codec_name',
'language',
'width',
'height',
): ):
if key in s: if key in s:
stream[{ stream[{
'codec_name': 'codec', 'codec_name': 'codec',
}.get(key, key)] = s[key] }.get(key, key)] = s[key]
info['subtitles'].append(stream) info['subtitles'].append(stream)
else: else: