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:
parent
2c3bc7293e
commit
de575ac3b8
13
svtplay-dl
13
svtplay-dl
@ -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=(.*)\&\;background', text)
|
m = re.search('dynamicStreams=(.*)\&\;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=(.*)\&\;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
|
|
||||||
|
Loading…
Reference in New Issue
Block a user