1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

svtplay: fix unboundlocal error for subtitle

this fixes #130
This commit is contained in:
Johan Andersson 2014-09-21 18:51:26 +02:00
parent 09b4a6816e
commit f249c3c406

View File

@ -48,11 +48,12 @@ class Svtplay(Service, OpenGraphThumbMixin):
options.live = False
if data["video"]["subtitleReferences"]:
subtitle = None
try:
subtitle = data["video"]["subtitleReferences"][0]["url"]
except KeyError:
pass
if len(subtitle) > 0:
if subtitle and len(subtitle) > 0:
yield subtitle_wsrt(subtitle)
if options.output_auto: