Fixed Broken Mimetype Detection
This commit is contained in:
parent
7b5375fd21
commit
8be32c6e5c
|
|
@ -3,7 +3,7 @@ from bot import aria2, LOGGER, DOWNLOAD_DIR
|
|||
import shutil
|
||||
import os
|
||||
import pathlib
|
||||
import mimetypes
|
||||
import mimelib
|
||||
|
||||
|
||||
def clean_download(path: str):
|
||||
|
|
@ -39,6 +39,7 @@ def tar(orig_path: str):
|
|||
|
||||
|
||||
def get_mime_type(file_path):
|
||||
mime_type = mimetypes.guess_type(file_path)[0]
|
||||
mime_type = mimelib.url(file_path).mime_type
|
||||
mime_type = mime_type if mime_type else "text/plain"
|
||||
return mime_type
|
||||
|
||||
|
|
|
|||
|
|
@ -9,3 +9,4 @@ pyasn1-modules>=0.2.1
|
|||
uritemplate>=3.0.0
|
||||
urllib3>=1.23
|
||||
aria2p>=0.3.0,<=0.5.0
|
||||
mimelib
|
||||
|
|
|
|||
Loading…
Reference in New Issue