Skip to content

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

fix: address PR review feedback for CLI workflow

kevin.zhange35f2530ef65
diff --git a/README-en.md b/README-en.md
index 54bdd268..43b59868 100644
--- a/README-en.md
+++ b/README-en.md
@@ -253,7 +253,7 @@ You can also provide local materials and control the stop stage:
uv run python cli.py \
--video-subject "The Role of Money" \
--video-source local \
- --video-materials "storage/local_videos/1.mp4,storage/local_videos/2.mp4" \
+ --video-materials "1.mp4,2.mp4" \
--stop-at video
```
diff --git a/README.md b/README.md
index a8b8eaa8..67fd513b 100644
--- a/README.md
+++ b/README.md
@@ -259,7 +259,7 @@ uv run python cli.py --video-subject "金钱的作用"
uv run python cli.py \
--video-subject "金钱的作用" \
--video-source local \
- --video-materials "storage/local_videos/1.mp4,storage/local_videos/2.mp4" \
+ --video-materials "1.mp4,2.mp4" \
--stop-at video
```
diff --git a/cli.py b/cli.py
index 6c950c23..611e2b08 100644
--- a/cli.py
+++ b/cli.py
@@ -26,7 +26,7 @@ def parse_args(argv: Sequence[str] | None = None) -> argparse.Namespace:
parser.add_argument(
"--video-source",
default="pexels",
- choices=["pexels", "pixabay", "local"],
+ choices=["pexels", "pixabay", "coverr", "local"],
help="video material source",
)
parser.add_argument(
@@ -45,7 +45,12 @@ def parse_args(argv: Sequence[str] | None = None) -> argparse.Namespace:
)
parser.add_argument("--video-aspect", default="9:16", help="video aspect ratio")
parser.add_argument("--voice-name", default="", help="tts voice name")
- parser.add_argument("--subtitle-enabled", action="store_true")
+ parser.add_argument(
+ "--subtitle-enabled",
+ default=True,
+ action=argparse.BooleanOptionalAction,
+ help="enable subtitles (default: enabled, use --no-subtitle-enabled to disable)",
+ )
parser.add_argument("--task-id", default="", help="custom task id")
return parser.parse_args(argv)
diff --git a/test/services/test_cli.py b/test/services/test_cli.py
index addb060a..d5187d8c 100644
--- a/test/services/test_cli.py
+++ b/test/services/test_cli.py
@@ -55,6 +55,21 @@ class TestCli(unittest.TestCase):
self.assertEqual(code, 1)
log_error.assert_called_once()
+ def test_subtitle_enabled_by_default(self):
+ args = cli.parse_args(["--video-subject", "test"])
+ params = cli.build_video_params(args)
+ self.assertTrue(params.subtitle_enabled)
+
+ def test_subtitle_disabled_with_no_flag(self):
+ args = cli.parse_args(["--video-subject", "test", "--no-subtitle-enabled"])
+ params = cli.build_video_params(args)
+ self.assertFalse(params.subtitle_enabled)
+
+ def test_coverr_video_source_accepted(self):
+ args = cli.parse_args(["--video-subject", "test", "--video-source", "coverr"])
+ params = cli.build_video_params(args)
+ self.assertEqual(params.video_source, "coverr")
+
if __name__ == "__main__":
unittest.main()