From e5d9050fa7ddb7bfc78d2bbf0c23c9d4c8c71cf0 Mon Sep 17 00:00:00 2001 From: spl0k Date: Sun, 11 Mar 2018 21:29:17 +0100 Subject: [PATCH] Improved transcoding configuration parsing --- supysonic/api/media.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/supysonic/api/media.py b/supysonic/api/media.py index 564610c..9fe30fe 100644 --- a/supysonic/api/media.py +++ b/supysonic/api/media.py @@ -11,6 +11,7 @@ import codecs import mimetypes import os.path import requests +import shlex import subprocess from flask import request, Response, send_file @@ -28,7 +29,7 @@ from .exceptions import GenericError, MissingParameter, NotFound, ServerError, U def prepare_transcoding_cmdline(base_cmdline, input_file, input_format, output_format, output_bitrate): if not base_cmdline: return None - ret = base_cmdline.split() + ret = shlex.split(base_cmdline) ret = [ part.replace('%srcpath', input_file).replace('%srcfmt', input_format).replace('%outfmt', output_format).replace('%outrate', str(output_bitrate)) for part in ret