Jianying Subtitle AI Fixer
What Problem Does It Solve?
CapCut's speech recognition is fast and free, but proper nouns (Agent, Claude Code, MCP, WorkBuddy…) are often misrecognized, requiring half an hour of manual corrections per video. This tool automates the process: decrypt draft → double-layer correction → re-encrypt and write back, leaving timelines and styles unchanged. After running, reopen CapCut and start editing right away.
Prerequisites (One-time – see references/setup.md)
- Place
jy-draftc.exein thetools/directory (download from GitHub wenshui330/jy-draftc) - CapCut desktop installed (auto-detected; or set
JY_INSTALL_DIRto the version directory containing videoeditor.dll) - ZhiPu API key (environment variable
ZHIPU_API_KEY; if you run Claude Code via ZhiPu, it can auto-read settings.json)
Standard Workflow
1. In CapCut: Create a new draft → add video → run "Text → Smart Subtitles" until recognition completes
2. Completely exit CapCut (including system tray) – the script checks this and refuses to write back if CapCut is open
3. Run the script (dry-run first to preview):
python scripts/fix_subtitles.py "DraftName" --dry-run
4. Show the user workspace/<DraftName>/changes.md comparison table and confirm changes
5. Write back for real (remove --dry-run)
6. User reopens CapCut → subtitles are fixed → manually trim / add speed changes → export
Command Templates
& "<skill-directory>/scripts/fix_subtitles.py" "DraftName" --dry-run # Preview
& "<skill-directory>/scripts/fix_subtitles.py" "DraftName" # Write back
& "<skill-directory>/scripts/fix_subtitles.py" "DraftName" --no-llm # Rule-only, instant
Parameters
| Parameter | Description |
|---|---|
--dry-run | Output comparison table + SRT without writing back (works even if CapCut is open) |
--no-llm | Only apply term table rule replacements, no API calls |
--batch N | Number of subtitles per LLM batch, default 30 |
Term Glossary Maintenance (Core! Gets Better with Use)
config/terms.json:
terms: Authoritative writing style (force-checked before write-back, e.g., api→API)fix: Certain "wrong → correct" mappings (e.g.,克劳德扣→Claude Code,engine→Agent)
After each run, if new misrecognitions are found, actively ask the user whether to add them to the glossary. The user is a content creator; terms in the same series of videos repeat heavily, making the glossary the most valuable asset. Note: Longer phrase mappings (e.g., "hand injection→hand-crafted Agent") may be overridden by shorter existing mappings ("hand→manual") – prefer adding a mapping for the target word itself (e.g., "injection→Agent").
Double-Layer Correction Mechanism
- Rule Layer (primary): Exact term table replacements – instant, zero cost, 100% controllable
- LLM Layer (fallback): Batch homophone/typo correction using glm-4-flash (30 subtitles per batch, 4 concurrent pipes). Before write-back, passes through term validation + length mutation detection (prevents hallucinated rewrites)
Safety Mechanisms
- Refuses to write back if CapCut is running; each run automatically creates a backup in
workspace/<DraftName>/backups/ - Only modifies text fields; timestamps, styles, and tracks remain untouched; rollback by overwriting
draft_content.jsonwith backup
Known Limitations
- Depends on jy-draftc's support for the CapCut version (currently supports versions 10.3–11.5; watch that project after major CapCut updates)
- Manually added title text in the draft will also be corrected (visible in comparison table; generally harmless)
- glm-4-flash occasionally makes minor oversteps (removes filler words/adds characters); the prompt enforces a "better to miss a fix than make a wrong fix" constraint; always verify with the comparison table.