Where did I get this magic module from initially?
This commit is contained in:
parent
59aaf63d4a
commit
fb6cfce656
2 changed files with 10 additions and 11 deletions
|
@ -7,7 +7,6 @@ import logging
|
|||
import magic
|
||||
import typing
|
||||
import coloredlogs
|
||||
import enum
|
||||
|
||||
# TODO Able to ignore extensions everywhere
|
||||
|
||||
|
@ -139,7 +138,7 @@ class TreeExtractor:
|
|||
filepath = os.path.join(real_root, name)
|
||||
with open(filepath, "rb") as filedesc:
|
||||
header = filedesc.read(1024)
|
||||
mime = magic.from_buffer(header, mime=True)
|
||||
mime = magic.detect_from_content(header).mime_type
|
||||
|
||||
archive_type = None
|
||||
for archtyp in self.ARCHIVE_TYPES:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue