From de575ac3b89f70623462d3a5f4bceccefe9a3338 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Tue, 1 Mar 2011 20:37:45 +0100 Subject: [PATCH] Print error msg if it cant find the stream --- svtplay-dl | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/svtplay-dl b/svtplay-dl index 89035f9..0e9be66 100755 --- a/svtplay-dl +++ b/svtplay-dl @@ -11,11 +11,16 @@ def getdata(url): argv = sys.argv[1] text = getdata(argv) m = re.search('dynamicStreams=(.*)\&\;background', text) -new = m.group(1) -tmp = new.split("|") -m = re.search('url:(.*)\,',tmp[0]) +if m: + new = m.group(1) + tmp = new.split("|") + m = re.search('url:(.*)\,',tmp[0]) +else: + m = re.search('pathflv=(.*)\&\;background',text) + if not m: + print "Err: cant find stream" + sys.exit(2) stream = m.group(1) output = os.path.basename(stream) command = ["/usr/bin/rtmpdump","-r",stream,"-o",output] subprocess.call(command) -print output