added support for playing MP3 files from URL using the streams tab

This commit is contained in:
Erhard 2017-11-11 01:29:19 +01:00
parent e6107bdfe3
commit a11b74f120

View File

@ -39,9 +39,13 @@ def index(sound=None, text=None, video=None):
video = request.args.get("video")
if video is not None:
url = subprocess.check_output(["youtube-dl", "-g", "-f", "mp4", video]).decode()
subprocess.Popen(["omxplayer", url.split("\n")[1]])
subprocess.Popen(["omxplayer", "-b", url.split("\n")[0]])
if video[-4:] is ".mp3":
subprocess.Popen(["omxplayer", video], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
else:
url = subprocess.check_output(["youtube-dl", "-g", "-f", "mp4", video]).decode()
subprocess.Popen(["omxplayer", url.split("\n")[1]])
subprocess.Popen(["omxplayer", "-b", url.split("\n")[0]])
killvideo = request.args.get("killvideo")