diff --git a/soundboard.py b/soundboard.py index 8c1b380..5002bba 100644 --- a/soundboard.py +++ b/soundboard.py @@ -72,12 +72,12 @@ def index(sound=None, text=None, video=None): video = request.args.get("video") if video is not None: - if video[-4:] == ".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]]) + if video[-4:] == ".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") diff --git a/soundboard.wsgi b/soundboard.wsgi index dffa811..b4b35e0 100644 --- a/soundboard.wsgi +++ b/soundboard.wsgi @@ -5,6 +5,6 @@ sys.path.insert(0, '/var/www/soundboard') activate_this = '/var/www/soundboard/py/bin/activate_this.py' with open(activate_this) as file_: - exec(file_.read(), dict(__file__=activate_this)) + exec(file_.read(), dict(__file__=activate_this)) from soundboard import app as application