CodeVetter
← All unpacks
CodeVetter · Repo Unpack evidence

harry0703/MoneyPrinterTurbo

Scanned commit 3d5f4e4219 dated 2026-09-21 — last upstream commit. Generated by codevetter 1.12.0 on 2026-09-22.

github.com/harry0703/MoneyPrinterTurbo ↗ · 177 files · 3.2 MB

MoneyPrinterTurbo 💸 一站式 AI 短视频生成工具 只需提供视频 主题 或 关键词 ,即可自动生成视频脚本、匹配素材、生成字幕和背景音乐,并合成高清短视频。 简体中文 | English | 日本語 | 版本发布 | 问题反馈 界面预览 🖥️ WebUI API --- 特别感谢 ❤️ 感谢 Kimi 赞助本项目!Kimi K3 是 Moonshot AI 迄今能力最强的模型,也是全球首个开源 3T 级模型,拥有原生视觉能力与 100 万 Token 上下文,在知识工作、推理和长周期任务中展现

Deep analysis by swe-2 via the devin CLI on 2026-09-22 (runtime not recorded) — every claim below links to its cited source files.

Overview

MoneyPrinterTurbo v1.3.7 is a Python 3.11+ application that generates finished short videos end-to-end: an LLM writes a script and material search terms, a TTS engine produces the voiceover, subtitles are built from TTS cues or Whisper, stock or AI-generated clips are downloaded per keyword, and MoviePy/FFmpeg renders final MP4s that can optionally be cross-posted to TikTok/Instagram/YouTube. It ships three frontends — a FastAPI service (port 8080), a Streamlit WebUI (port 8501), and a batch-capable argparse CLI — that all converge on one shared pipeline in app/services/task.py. Its distinctive traits are a very large provider matrix (~20 LLM providers via a registry, ~11 TTS engines, ~10 material sources including several paid text-to-video APIs with explicit charge-confirmation flags) and heavy hardening around config locking, path confinement, and task-state consistency for what is fundamentally a single-user local tool.

System map

The system is a single-process Python app with three entrypoints that share one orchestration layer. main.py starts uvicorn serving the FastAPI app built in app/asgi.py; webui.sh/webui.bat/Dockerfile start `streamlit run webui/Main.py`; cli.py runs the pipeline synchronously and prints JSON. All routes under /api/v1 are registered in app/router.py and guarded by an optional x-api-key check. Task state lives in an in-memory dict or Redis depending on config, task scheduling in a bounded thread-backed queue, and artifacts on disk under storage/tasks/<task_id>. Deployment is a single Docker image exposing either the WebUI (8501) or API (8080).

All 13 system map claims →

Feature catalog

Features span a REST API for video/subtitle/audio generation and task management, a full Streamlit WebUI, and a CLI with batch mode. The provider surface is the headline: ~20 LLM providers, ~11 TTS engines, ~10 video material sources (three stock-footage search APIs, six paid text-to-video generators, an OpenAI-compatible image endpoint, and local files), two subtitle engines, three BGM modes plus two AI music services, and Upload-Post cross-posting. Supporting features include BGM/material upload endpoints, range-streaming and download endpoints, a 24h material search cache, Whisper transcription, i18n, task history, and an update checker.

All 15 feature catalog claims →

Data flow

A request becomes a pydantic VideoParams, gets a UUID task_id, a state record, and a storage/tasks/<task_id> workspace. The pipeline transforms subject→script→terms→audio→subtitle→materials→final MP4, writing intermediate files (script.json, audio.mp3, subtitle.srt, combined-N.mp4, final-N.mp4) into the task dir and progress/state into MemoryState or RedisState. Outputs leave via the /tasks static mount, /stream, /download, or cross-posting to upload-post.com. Configuration flows the other direction: config.toml → section dicts, with WebUI runtime writes funneled through a non-blocking pending-update queue and atomic file saves.

Behavior traces

Three flows were traced end-to-end. API startup goes main.py → asgi app construction → lifespan recovery. The primary action (video generation) is identical across frontends: a state record is created before scheduling, _run_pipeline walks preflight→script→terms→audio→subtitle→materials→video, and cross-posting is scheduled only after the task is COMPLETE. Persistence flows through two channels — task state (memory dict or Redis hashes) and task artifacts (atomic JSON writes into storage/tasks/<id>) — plus config.toml for settings.

Testing signals

Testing is unusually thorough for this genre: ~70 test files under test/ mixing pytest functions and unittest.TestCase, executed by pytest in CI on Python 3.11 and 3.13 with a real Redis service, plus a Windows smoke job. Branch coverage over app/, cli.py, main.py, webui/, and docs/skill/ is gated at ≥70%. Ruff lint runs in CI (3.11 only) and compileall checks every source tree. Live provider calls are opt-in via MPT_RUN_INTEGRATION_TESTS, so CI coverage is unit/integration-level with mocks rather than true end-to-end renders.

Risk map

The largest risk is the default-open posture: empty api_key means no authentication while listen_host defaults to 0.0.0.0, exposing task creation, file uploads, and artifact downloads to the LAN. Redis state uses ast.literal_eval on stored values inside a documented trust boundary. Several code paths shell out (ffmpeg probing of uploaded media, the claude_code provider spawning the local claude CLI). Paid text-to-video providers create billable remote tasks — guarded by CLI confirm flags but only a config/api-key check on the API path. The 8k-line webui/Main.py and duplicated requirements.txt are maintainability hotspots.

Extension points

The codebase is deliberately registry/dispatch oriented. New LLM providers plug into LLM_PROVIDER_REGISTRY plus (only for non-OpenAI-compatible protocols) an adapter branch in llm._generate_response. New video material sources extend the download_videos dispatch plus the CLI's _CLI_VIDEO_SOURCES and mpt_agent's SUPPORTED_SOURCES. New AI-music providers slot into _VIDEO_MUSIC_PROVIDERS. New TTS engines add is_*_voice detectors and a _single_tts branch. State and queue backends are subclassable, routes extend via new_router, and UI strings via i18n JSON files.

Contributor handoff

Start at app/services/task.py (_run_pipeline is the shared spine), app/models/schema.py (VideoParams), and app/config/config.py (global config + locking). All three frontends must stay behaviorally identical — comments throughout document past drift bugs where a value list or check existed in only one entrypoint. Tests run via uv + pytest with a 70% branch-coverage floor; ruff lints the same file set as coverage. Preserve the security invariants: path confinement, optional auth, no secrets in logs, and never resurrecting deleted task records.

All 13 contributor handoff claims →

Languages

LanguageFilesShare of source
Python12197%
JSON17docs/config
YAML9docs/config
Markdown6docs/config
TOML32%
CSS1docs/config
HTML1docs/config
Shell11%

Start reading here

Probable source entrypoint: main.py — inferred from the directory tree and manifest, not the upstream docs.

Source roots

app/ (47 files)

Source layout — app/

PathFiles
app/config/2
app/controllers/8
app/models/5
app/services/26
app/utils/3
app/__init__.py1
app/asgi.py1
app/router.py1

Repository structure

Top-level pathFiles
test/72
app/47
webui/17
docs/12
.github/6
resource/1

Docs found: README.mddocs/skill/SKILL.md

Package

pyproject.toml — moneyprinterturbo v1.3.7, 6 declared dependencies.

###twelvelabstwelvelabs>=1.2.8"]

CI & config entrypoints

Structural health signals

Average score 6.4/10 across 96 analyzed source files; 45 hotspots surfaced.

These are deterministic review leads — size, churn, and structural signals — not proof of a bug in this project.

Recent history