From eb0b488b105e805203a55d7d5ff0618bdc27d36f Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Sun, 23 Dec 2012 18:04:10 +0100 Subject: [PATCH] svtplay: dont crash when it cant find any streams In some cases we cant download any videos. when they are only provided for flash users and not iOS users. --- svtplay_dl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/svtplay_dl.py b/svtplay_dl.py index 6cdce6d..53fbe99 100755 --- a/svtplay_dl.py +++ b/svtplay_dl.py @@ -888,7 +888,10 @@ class Svtplay(): stream["url"] = i["url"] streams[int(i["bitrate"])] = stream - if len(streams) == 1: + if len(streams) == 0: + log.error("Can't find any streams.") + sys.exit(2) + elif len(streams) == 1: test = streams[streams.keys()[0]] else: test = select_quality(self.options, streams)