forked from server/soundboard
added support for playing MP3 files from URL using the streams tab
This commit is contained in:
parent
e6107bdfe3
commit
a11b74f120
@ -39,9 +39,13 @@ def index(sound=None, text=None, video=None):
|
|||||||
video = request.args.get("video")
|
video = request.args.get("video")
|
||||||
|
|
||||||
if video is not None:
|
if video is not None:
|
||||||
url = subprocess.check_output(["youtube-dl", "-g", "-f", "mp4", video]).decode()
|
|
||||||
subprocess.Popen(["omxplayer", url.split("\n")[1]])
|
if video[-4:] is ".mp3":
|
||||||
subprocess.Popen(["omxplayer", "-b", url.split("\n")[0]])
|
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")
|
killvideo = request.args.get("killvideo")
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user