1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 04:05:39 +01:00

urplay: Check how many items we have in subtitles

This fixes #235
This commit is contained in:
Johan Andersson 2015-05-06 10:33:24 +02:00
parent 7950e06e0d
commit 620cbf9b43

View File

@ -36,7 +36,8 @@ class Urplay(Service, OpenGraphThumbMixin):
data = match.group(1)
jsondata = json.loads(data)
yield subtitle(copy.copy(options), "tt", jsondata["subtitles"][0]["file"].split(",")[0])
if len(jsondata["subtitles"]) > 0:
yield subtitle(copy.copy(options), "tt", jsondata["subtitles"][0]["file"].split(",")[0])
basedomain = jsondata["streaming_config"]["streamer"]["redirect"]
http = "http://%s/%s" % (basedomain, jsondata["file_http"])
hd = None