From adcaa73210dda94f40e24d83f2020360c4b83919 Mon Sep 17 00:00:00 2001 From: Johan Andersson Date: Wed, 22 Sep 2021 20:43:53 +0200 Subject: [PATCH] postprocess: support for finding ffmpeg in same directory this will be helpful on windows if you dont have ffmpeg in your PATH. it will look for ffmpeg in same directory as svtplay-dl.exe. --- lib/svtplay_dl/postprocess/__init__.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/svtplay_dl/postprocess/__init__.py b/lib/svtplay_dl/postprocess/__init__.py index 811495c..648301a 100644 --- a/lib/svtplay_dl/postprocess/__init__.py +++ b/lib/svtplay_dl/postprocess/__init__.py @@ -1,7 +1,9 @@ import logging import os +import pathlib import platform import re +import sys from json import dumps from random import sample from shutil import which @@ -24,6 +26,10 @@ class postprocess: self.detect = which(i) if self.detect: break + if self.detect is None and platform.system() == "Windows": + path = pathlib.Path(sys.executable).parent / "ffmpeg.exe" + if path.is_file: + self.detect = path def merge(self): if self.detect is None: