Where did I get this magic module from initially?

This commit is contained in:
Geoffrey Frogeye 2021-06-13 11:42:37 +02:00
parent 59aaf63d4a
commit fb6cfce656
Signed by: geoffrey
GPG key ID: C72403E7F82E6AD8
2 changed files with 10 additions and 11 deletions

View file

@ -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: