diff --git a/ox/web/youtube.py b/ox/web/youtube.py index ecc1739..89acd5c 100644 --- a/ox/web/youtube.py +++ b/ox/web/youtube.py @@ -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