From f5a43f57f06faf59b3600e677330d046abb7d085 Mon Sep 17 00:00:00 2001 From: abhiTronix Date: Sun, 23 Jun 2024 23:03:04 +0530 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=91=EF=B8=8F=20FFhelper:=20Added=20pat?= =?UTF-8?q?ch=20for=20regex=20expression=20bug=20in=20`get=5Fsupported=5Fd?= =?UTF-8?q?emuxers`=20method.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - ⏪️ Reverted debugging. --- deffcode/ffhelper.py | 13 ++----------- deffcode/sourcer.py | 7 ------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/deffcode/ffhelper.py b/deffcode/ffhelper.py index eda8361..e09c904 100644 --- a/deffcode/ffhelper.py +++ b/deffcode/ffhelper.py @@ -344,15 +344,14 @@ def get_supported_demuxers(path): """ demuxers = check_sp_output([path, "-hide_banner", "-demuxers"]) splitted = [x.decode("utf-8").strip() for x in demuxers.split(b"\n")] - logger.critical(splitted) split_index = [idx for idx, s in enumerate(splitted) if "--" in s][0] supported_demuxers = splitted[split_index + 1 : len(splitted) - 1] # compile regex - finder = re.compile(r"\s\s[a-z0-9_,-]+\s+") + finder = re.compile(r"[a-z0-9_,-]{2,}\s\s") # find all outputs outputs = finder.findall("\n".join(supported_demuxers)) # return output findings - return [o.strip() if not ("," in o) else o.split(",")[-1].strip() for o in outputs] + return [o.strip() for o in outputs] def extract_device_n_demuxer(path, machine_OS=None, verbose=False): @@ -395,14 +394,6 @@ def extract_device_n_demuxer(path, machine_OS=None, verbose=False): # log if specified verbose and logger.debug("Auto-Searching for valid devices...") - logger.critical( - "{} :: {} :: {}".format( - req_demuxer, - req_demuxer in get_supported_demuxers(path), - get_supported_demuxers(path), - ) - ) - # assert if demuxer is supported by provided ffmpeg. assert req_demuxer in get_supported_demuxers( path diff --git a/deffcode/sourcer.py b/deffcode/sourcer.py index 1f989a7..203995d 100644 --- a/deffcode/sourcer.py +++ b/deffcode/sourcer.py @@ -451,13 +451,6 @@ def __validate_source(self, source, source_demuxer=None, forced_validate=False): **Returns:** `True` if passed tests else `False`. """ - logger.critical( - "{} :: {} :: {}".format( - source_demuxer, - source_demuxer in get_supported_demuxers(self.__ffmpeg), - get_supported_demuxers(self.__ffmpeg), - ) - ) # validate source demuxer(if defined) if not (source_demuxer is None): # check if "auto" demuxer is specified