1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +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]
text = getdata(argv)
m = re.search('dynamicStreams=(.*)\&amp\;background', text)
if m:
new = m.group(1)
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)
output = os.path.basename(stream)
command = ["/usr/bin/rtmpdump","-r",stream,"-o",output]
subprocess.call(command)
print output