From 11c4209899444ff64467633785329493d71922dd Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sun, 10 Mar 2013 14:05:46 +0100 Subject: [PATCH] justin.tv: write an error message when we cant find any streams --- lib/svtplay/service/justin.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/lib/svtplay/service/justin.py b/lib/svtplay/service/justin.py index d6776cd..061032b 100644 --- a/lib/svtplay/service/justin.py +++ b/lib/svtplay/service/justin.py @@ -54,9 +54,11 @@ class Justin(): streams[int(i.find("video_height").text)] = stream except AttributeError: pass - - test = select_quality(options, streams) - options.other = "-j '%s' -W %s" % (test["token"], options.other) - options.resume = False - download_rtmp(options, test["url"]) - + if len(streams) > 0: + test = select_quality(options, streams) + options.other = "-j '%s' -W %s" % (test["token"], options.other) + options.resume = False + download_rtmp(options, test["url"]) + else: + log.error("Can't any streams") + sys.exit(2)