Skip to content

Commit

Permalink
🚑️ FFhelper: Added patch for regex expression bug in `get_supported_d…
Browse files Browse the repository at this point in the history
…emuxers` method.

- ⏪️ Reverted debugging.
  • Loading branch information
abhiTronix committed Jun 23, 2024
1 parent 2456382 commit f5a43f5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
13 changes: 2 additions & 11 deletions deffcode/ffhelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down
7 changes: 0 additions & 7 deletions deffcode/sourcer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f5a43f5

Please sign in to comment.