Skip to content

fix: rewrite media paths when auto-deploying a draft to CapCut - #87

Open
Azulitoquintero wants to merge 1 commit into
sun-guannan:mainfrom
Azulitoquintero:fix/deployed-media-paths
Open

Azulitoquintero wants to merge 1 commit into
sun-guannan:mainfrom
Azulitoquintero:fix/deployed-media-paths

Conversation

@Azulitoquintero

Copy link
Copy Markdown

Problem

save_draft builds the draft in a temporary dfd_* folder and then copies it into CapCut's project directory. The media paths saved in draft_info.json still point to the temporary folder. If that folder is removed, CapCut opens the project with "material download failed".

Fix

After copying, rewrite the paths in the deployed project's JSON files so they point to the copy inside CapCut. The temporary folder is removed only when the program created it itself (no draft_folder given).

Tested

CapCut 9.5 on Windows with the capcut_legacy profile. A draft created through the MCP server (create_draft → add_video → add_text → save_draft) opens with its video in place.

Related to #83, a smaller version of the same fix.

🤖 Generated with Claude Code

save_draft builds the draft in a temporary dfd_* folder and copies it into
CapCut's project directory, but the media paths in the draft JSON still
point at the temporary folder. Once it is removed, CapCut reports
"material download failed".

After copying, rewrite those paths to the deployed copy, and remove the
intermediate folder only when it was created next to the code (no
draft_folder given).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant