zcontent.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:csirtg-smrt-py 作者: csirtgadgets 项目源码 文件源码
def get_mimetype(f):
    try:
        ftype = magic.from_file(f, mime=True)
    except AttributeError:
        try:
            mag = magic.open(magic.MAGIC_MIME)
            mag.load()
            ftype = mag.file(f)
        except AttributeError as e:
            raise RuntimeError('unable to detect cached file type')

    if PYVERSION < 3:
        ftype = ftype.decode('utf-8')

    return ftype
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号