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

Print error msg if it cant find the stream

This commit is contained in:
Johan Andersson 2011-03-01 20:37:45 +01:00
parent 2c3bc7293e
commit de575ac3b8

View File

@ -11,11 +11,16 @@ def getdata(url):
argv = sys.argv[1] argv = sys.argv[1]
text = getdata(argv) text = getdata(argv)
m = re.search('dynamicStreams=(.*)\&amp\;background', text) m = re.search('dynamicStreams=(.*)\&amp\;background', text)
new = m.group(1) if m:
tmp = new.split("|") new = m.group(1)
m = re.search('url:(.*)\,',tmp[0]) tmp = new.split("|")
m = re.search('url:(.*)\,',tmp[0])
else:
m = re.search('pathflv=(.*)\&amp\;background',text)
if not m:
print "Err: cant find stream"
sys.exit(2)
stream = m.group(1) stream = m.group(1)
output = os.path.basename(stream) output = os.path.basename(stream)
command = ["/usr/bin/rtmpdump","-r",stream,"-o",output] command = ["/usr/bin/rtmpdump","-r",stream,"-o",output]
subprocess.call(command) subprocess.call(command)
print output