From ec8fe2a5b9b35b162f4bd41f2ea5226563311c61 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Wed, 15 Jan 2014 19:21:05 +0100 Subject: [PATCH] tv4play: print error message when there is no streams --- lib/svtplay_dl/service/tv4play.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/svtplay_dl/service/tv4play.py b/lib/svtplay_dl/service/tv4play.py index a065d04..00d9ad9 100644 --- a/lib/svtplay_dl/service/tv4play.py +++ b/lib/svtplay_dl/service/tv4play.py @@ -60,7 +60,10 @@ class Tv4play(Service): streams[int(i.find("bitrate").text)] = stream elif i.find("mediaFormat").text == "smi": subtitle = i.find("url").text - if len(streams) == 1: + if len(streams) == 0: + log.error("Can't find any streams") + sys.exit(2) + elif len(streams) == 1: test = streams[list(streams.keys())[0]] else: test = select_quality(options, streams)