Skip to content

Commit d24bcc5

Browse files
authored
Merge pull request #404 from onekey-sec/revert-magic-api
Remove `magic_file` config option
2 parents e26dc7c + 620cadd commit d24bcc5

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

unblob/processing.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ class ExtractionConfig:
6868
keep_extracted_chunks: bool = False
6969
extract_suffix: str = "_extract"
7070
handlers: Handlers = BUILTIN_HANDLERS
71-
magic_file: Optional[Path] = None
7271

7372
def get_extract_dir_for(self, path: Path) -> Path:
7473
"""Extraction dir under root with the name of path."""
@@ -212,12 +211,8 @@ def __init__(self, config: ExtractionConfig):
212211
# By enabling keep_going (which eventually enables MAGIC_CONTINUE) all matching patterns
213212
# will be included in the magic string at the cost of being a bit slower, but increasing
214213
# accuracy by no shadowing rules.
215-
self._get_magic = magic.Magic(
216-
keep_going=True, magic_file=config.magic_file
217-
).from_file
218-
self._get_mime_type = magic.Magic(
219-
mime=True, magic_file=config.magic_file
220-
).from_file
214+
self._get_magic = magic.Magic(keep_going=True).from_file
215+
self._get_mime_type = magic.Magic(mime=True).from_file
221216

222217
def process_task(self, task: Task) -> TaskResult:
223218
result = TaskResult(task)

0 commit comments

Comments
 (0)