def guess_mime_type_from_file_contents(file_path): """ Get type from file magic bytes. """ mt = magic.from_file(file_path, mime=True) if mt: return mt