summaryrefslogtreecommitdiff
path: root/server
diff options
context:
space:
mode:
authorskybldev <skybluehexapon@outlook.com>2022-08-05 21:31:27 -0400
committerShyam Sunder <sgsunder1@gmail.com>2023-04-17 11:36:44 -0400
commit8a03015349c3d9642c4d83472dbe76b072dd05a1 (patch)
treef99200a48f571c2a0c6bfb927dcf2436ecbc3f8f /server
parent6c3b50d287a8b8ba67d2bb4cf3cffe25bcd3b4e6 (diff)
client+server: added quicktime upload support
Diffstat (limited to 'server')
-rw-r--r--server/szurubooru/func/mime.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/szurubooru/func/mime.py b/server/szurubooru/func/mime.py
index 3be43f7..4aa9c3d 100644
--- a/server/szurubooru/func/mime.py
+++ b/server/szurubooru/func/mime.py
@@ -39,6 +39,9 @@ def get_mime_type(content: bytes) -> str:
if content[4:12] in (b"ftypisom", b"ftypiso5", b"ftypmp42", b"ftypM4V "):
return "video/mp4"
+ if content[4:12] in (b"ftypqt "):
+ return "video/quicktime"
+
return "application/octet-stream"
@@ -54,6 +57,7 @@ def get_extension(mime_type: str) -> Optional[str]:
"image/heif": "heif",
"image/heic": "heic",
"video/mp4": "mp4",
+ "video/quicktime": "mov",
"video/webm": "webm",
"application/octet-stream": "dat",
}
@@ -65,7 +69,7 @@ def is_flash(mime_type: str) -> bool:
def is_video(mime_type: str) -> bool:
- return mime_type.lower() in ("application/ogg", "video/mp4", "video/webm")
+ return mime_type.lower() in ("application/ogg", "video/mp4", "video/quicktime", "video/webm")
def is_image(mime_type: str) -> bool: