1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

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.
This commit is contained in:
Johan Andersson 2021-09-22 20:43:53 +02:00
parent 1c9642c0bf
commit adcaa73210

View File

@ -1,7 +1,9 @@
import logging import logging
import os import os
import pathlib
import platform import platform
import re import re
import sys
from json import dumps from json import dumps
from random import sample from random import sample
from shutil import which from shutil import which
@ -24,6 +26,10 @@ class postprocess:
self.detect = which(i) self.detect = which(i)
if self.detect: if self.detect:
break 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): def merge(self):
if self.detect is None: if self.detect is None: