handly empty subs

This commit is contained in:
j 2014-07-20 11:20:31 +02:00
parent 5e2b3cf448
commit 2bd1c7d657

View file

@ -105,12 +105,13 @@ def info(id, timeout=cache_timeout):
if not duration:
duration = '2'
end = start + float(duration)
text = t.firstChild.data
subs.append({
'in': start,
'out': end,
'value': ox.decode_html(text),
})
if t.firstChild:
text = t.firstChild.data
subs.append({
'in': start,
'out': end,
'value': ox.decode_html(text),
})
info['subtitles'][language] = subs
return info