Repository navigation
fix: rewrite media paths when auto-deploying a draft to CapCut - #87
Open
Azulitoquintero wants to merge 1 commit into
Open
Azulitoquintero wants to merge 1 commit into
Azulitoquintero wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
save_draftbuilds the draft in a temporarydfd_*folder and then copies it into CapCut's project directory. The media paths saved indraft_info.jsonstill 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_foldergiven).Tested
CapCut 9.5 on Windows with the
capcut_legacyprofile. 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