diff --git a/nzbtomedia/__init__.py b/nzbtomedia/__init__.py index 445fad61..bf674444 100644 --- a/nzbtomedia/__init__.py +++ b/nzbtomedia/__init__.py @@ -280,15 +280,15 @@ def initialize(section=None): else: bitbucket = open('/dev/null') - FFMPEG = subprocess.Popen(['which', 'ffmpeg'], stdout=subprocess.PIPE).communicate()[0] - FFPROBE = subprocess.Popen(['which', 'ffprobe'], stdout=subprocess.PIPE).communicate()[0] + FFMPEG = subprocess.Popen(['which', 'ffmpeg'], stdout=subprocess.PIPE).communicate()[0].strip() + FFPROBE = subprocess.Popen(['which', 'ffprobe'], stdout=subprocess.PIPE).communicate()[0].strip() if not (FFMPEG or FFPROBE): # Auto-install FFMPEG and FFPROBE res = subprocess.call([joinPath(PROGRAM_DIR, 'getffmpeg.sh')], stdout=bitbucket, stderr=bitbucket) if res == 0: - FFMPEG = subprocess.Popen(['which', 'ffmpeg'], stdout=subprocess.PIPE).communicate()[0] - FFPROBE = subprocess.Popen(['which', 'ffprobe'], stdout=subprocess.PIPE).communicate()[0] + FFMPEG = subprocess.Popen(['which', 'ffmpeg'], stdout=subprocess.PIPE).communicate()[0].strip() + FFPROBE = subprocess.Popen(['which', 'ffprobe'], stdout=subprocess.PIPE).communicate()[0].strip() else: logger.error("Failed to install ffmpeg. Please install manually") FFMPEG = None