利用 AI 大模型和自动化工作流,根据主题或关键词一键生成高清短视频。Generate HD short videos from a topic or keyword with an automated AI workflow.
Python ai-video-generatorcontent-creationffmpeginstagram-reelsllmpythonshort-videosubtitlestext-to-speechtiktokvideo-automationvideo-workflowworkflow-automationyoutube-shorts
docs(config): document [ui] subtitle/voice defaults in example config
c02062743910ab6de8d
diff --git a/config.example.toml b/config.example.tomlindex 9a5ffef3..ec5e2631 100644--- a/config.example.toml+++ b/config.example.toml@@ -627,6 +627,7 @@ open_task_folder_on_completion = true# video_count = 1# tts_server = "azure-tts-v1"# voice_name = ""+# voice_mode = "tts" # "tts", "upload", or "none"# voice_volume = 1.0# voice_rate = 1.0# bgm_type = "random"@@ -635,6 +636,8 @@ open_task_folder_on_completion = true# sonilo_bgm_prompt = ""# elevenlabs_music_prompt = ""# subtitle_enabled = true+# subtitle_display_mode = "sentence" # "sentence" or "word_by_word"+# subtitle_animation = "none" # "none" or "pop_spring"# font_name = "MicrosoftYaHeiBold.ttc"# font_size = 60# text_fore_color = "#FFFFFF"diff --git a/test/services/test_config.py b/test/services/test_config.pyindex 40a7272a..3821093d 100644--- a/test/services/test_config.py+++ b/test/services/test_config.py@@ -1,4 +1,5 @@import errno+import reimport threadingimport timeimport tomllib@@ -95,6 +96,33 @@ class TestConfigPersistence:for field in provider.extra_fields:assert provider.config_key(field.config_suffix) in app_config+ def test_example_ui_block_documents_every_pinnable_default(self):+ """[ui] 注释块必须列出代码真正会从 [ui] 读取的每个键。++ 该块是用户手工固定初始默认值的唯一入口,因此只列出部分键会让设置+ 静默失效:用户照着示例写了 [ui].subtitle_display_mode,却因为示例+ 没提而根本不知道它存在。断言从源码里推导,新增可固定字段时会先失败。+ """+ project_root = Path(__file__).resolve().parents[2]+ ui_block = (project_root / "config.example.toml").read_text(+ encoding="utf-8"+ ).split("[ui]", 1)[1]+ documented = set(re.findall(r"^#\s*([a-z_]+)\s*=", ui_block, re.MULTILINE))++ schema_text = (project_root / "app/models/schema.py").read_text(+ encoding="utf-8"+ )+ pinnable = set(re.findall(r'config\.ui\.get\(\s*"([a-z_]+)"', schema_text))+ pinnable |= set(+ re.findall(r'_get_valid_ui_choice\(\s*"([a-z_]+)"', schema_text)+ )+ cli_text = (project_root / "cli.py").read_text(encoding="utf-8")+ pinnable |= set(+ re.findall(r'_ui_config_value\(\s*\w+\s*,\s*"([a-z_]+)"', cli_text)+ )++ assert pinnable <= documented, sorted(pinnable - documented)+def test_load_config_accepts_repeated_utf8_bom_without_rewriting_file(self):"""重复 BOM 不应阻止 Windows 用户启动,也不能改写已有配置。"""with TemporaryDirectory() as temp_dir: