Skip to content

利用 AI 大模型和自动化工作流,根据主题或关键词一键生成高清短视频。Generate HD short videos from a topic or keyword with an automated AI workflow.

feat: improve file extension parsing using pathlib

harry97c631e696d6
diff --git a/app/utils/utils.py b/app/utils/utils.py
index 06726813..7efb521a 100644
--- a/app/utils/utils.py
+++ b/app/utils/utils.py
@@ -1,6 +1,7 @@
import json
import locale
import os
+from pathlib import Path
import threading
from typing import Any
from uuid import uuid4
@@ -226,4 +227,4 @@ def load_locales(i18n_dir):
def parse_extension(filename):
- return os.path.splitext(filename)[1].strip().lower().replace(".", "")
+ return Path(filename).suffix.lower().lstrip('.')