From ebd33f1869563f9e6778540297d65fd6f7d8eb6a Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Mon, 2 Mar 2020 20:34:54 -0500 Subject: [PATCH 1/2] use os.path.join instead of string addition when searching for file analysis binaries --- lbry/file_analysis.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lbry/file_analysis.py b/lbry/file_analysis.py index 80d56dbb4..0a5360ffc 100644 --- a/lbry/file_analysis.py +++ b/lbry/file_analysis.py @@ -23,8 +23,10 @@ class VideoFileAnalyzer: async def _execute(self, command, arguments): args = shlex.split(arguments) - process = await asyncio.create_subprocess_exec(self._conf.ffmpeg_folder + command, *args, - stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE) + process = await asyncio.create_subprocess_exec( + os.path.join(self._conf.ffmpeg_folder, command), *args, + stdout=asyncio.subprocess.PIPE, stderr=asyncio.subprocess.PIPE + ) stdout, stderr = await process.communicate() # returns when the streams are closed return stdout.decode(errors='replace') + stderr.decode(errors='replace'), process.returncode From 1b850b8a2b665cb1d102ecdd36edb584167afb2e Mon Sep 17 00:00:00 2001 From: Lex Berezhny Date: Mon, 2 Mar 2020 21:11:11 -0500 Subject: [PATCH 2/2] dont prepend path when doing which ffmpeg --- lbry/file_analysis.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lbry/file_analysis.py b/lbry/file_analysis.py index 0a5360ffc..59abafa1c 100644 --- a/lbry/file_analysis.py +++ b/lbry/file_analysis.py @@ -47,7 +47,7 @@ class VideoFileAnalyzer: return await self._verify_executable("ffprobe") version = await self._verify_executable("ffmpeg") - self._which = shutil.which(f"{self._conf.ffmpeg_folder}ffmpeg") + self._which = shutil.which("ffmpeg") self._ffmpeg_installed = True log.debug("Using %s at %s", version.splitlines()[0].split(" Copyright")[0], self._which)