Optional parameter to check if the encoder exists

If `must_exists` is `False` when intializing `EncoderFFmpeg()`, skip
skip checking whether the FFmpeg binary exists.

Fixes #722.
This commit is contained in:
Ritiek Malhotra
2020-05-19 12:49:00 +05:30
parent 9c97f33aa2
commit debe7ee902
3 changed files with 8 additions and 8 deletions

View File

@@ -37,12 +37,12 @@ class EncoderBase(ABC):
"""
@abstractmethod
def __init__(self, encoder_path, loglevel, additional_arguments=[]):
def __init__(self, encoder_path, must_exist, loglevel, additional_arguments=[]):
"""
This method must make sure whether specified encoder
is available under PATH.
"""
if shutil.which(encoder_path) is None:
if must_exist and shutil.which(encoder_path) is None:
raise EncoderNotFoundError(
"{} executable does not exist or was not found in PATH.".format(
encoder_path