mirror of
https://github.com/soimort/you-get.git
synced 2025-02-03 08:43:58 +03:00
Merge pull request #1294 from cnbeining/fix-os-system-windows
[Processor] Fix rtmpdump not portable under Windows
This commit is contained in:
commit
92911cef0b
@ -41,16 +41,32 @@ def download_rtmpdump_stream(url, title, ext,params={},output_dir='.'):
|
||||
subprocess.call(cmdline)
|
||||
return
|
||||
|
||||
#
|
||||
#To be refactor
|
||||
#To the future myself: Remember to refactor the same function in ffmpeg.py
|
||||
#
|
||||
def play_rtmpdump_stream(player, url, params={}):
|
||||
cmdline="rtmpdump -r '%s' "%url
|
||||
|
||||
#construct left side of pipe
|
||||
cmdline = [RTMPDUMP, '-r']
|
||||
cmdline.append(url)
|
||||
|
||||
#append other params if exist
|
||||
for key in params.keys():
|
||||
cmdline+=key+" "+params[key] if params[key]!=None else ""+" "
|
||||
cmdline+=" -o - | %s -"%player
|
||||
print(cmdline)
|
||||
os.system(cmdline)
|
||||
cmdline.append(key)
|
||||
if params[key]!=None:
|
||||
cmdline.append(params[key])
|
||||
|
||||
cmdline.append('-o')
|
||||
cmdline.append('-')
|
||||
|
||||
#pipe start
|
||||
cmdline.append('|')
|
||||
cmdline.append(player)
|
||||
cmdline.append('-')
|
||||
|
||||
#logging
|
||||
print("Call rtmpdump:\n"+" ".join(cmdline)+"\n")
|
||||
|
||||
#call RTMPDump!
|
||||
subprocess.call(cmdline)
|
||||
|
||||
# os.system("rtmpdump -r '%s' -y '%s' -o - | %s -" % (url, playpath, player))
|
||||
return
|
||||
|
Loading…
Reference in New Issue
Block a user