mirror of
https://github.com/Dvorinka/SpotifyRecAlg.git
synced 2026-06-04 12:33:03 +00:00
first commit
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import mimetypes
|
||||
|
||||
|
||||
def guess_mime_type(filename: str):
|
||||
"""
|
||||
Guess the mime type of a file.
|
||||
"""
|
||||
type = mimetypes.guess_type(filename)[0]
|
||||
|
||||
if type is None:
|
||||
ext = filename.rsplit(".", maxsplit=1)[-1]
|
||||
return f"audio/{ext}"
|
||||
|
||||
return type
|
||||
Reference in New Issue
Block a user