Skip to content

Conversation

@gdibble
Copy link

@gdibble gdibble commented Oct 5, 2025

  1. (Update index.js FIlename draft_info.json gdibble/capcut-srt-export#1 (comment))
    CapCut now uses draft_info.json as the default filename. Let's use this for the web app runner. The local script should continue to work for Windows NT.
  2. (Update index.js Use process.platform gdibble/capcut-srt-export#2 (comment))
    The process.env.os is depreciated. Use process.platform instead. This may return different casing, as on Mac it returns 'darwin'. To be safe, using .toLowerCase() with the variable, and updated the three case statements for the lowercased values.

CapCut now uses draft_info.json as the default filename. Let's use this for the web app runner. The local script should continue to work for Windows NT.
The `process.env.os` is depreciated. Use `process.platform` instead. This may return different casing, as on Mac it returns 'darwin'. To be safe, using `.toLowerCase()` with the variable, and updated the three case statements for the lowercased values.
Update index.js FIlename draft_info.json
Update index.js Use process.platform
}:${seconds < 10 ? "0" + seconds : seconds},${ms}`;
}

var draftFileName = "draft_content.json";
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. (Update index.js FIlename draft_info.json gdibble/capcut-srt-export#1 (comment))
    CapCut now uses draft_info.json as the default filename. Let's use this for the web app runner. The local script should continue to work for Windows NT.

Comment on lines +23 to +31
let os = process.platform.toLowerCase();
switch (os) {
case "Windows_NT":
case "windows_nt":
draftFileName = "draft_content.json";
break;
case "Darwin":
case "darwin":
draftFileName = "draft_info.json";
break;
case "Linux":
case "linux":
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. (Update index.js Use process.platform gdibble/capcut-srt-export#2 (comment))
    The process.env.os is depreciated. Use process.platform instead. This may return different casing, as on Mac it returns 'darwin'. To be safe, using .toLowerCase() with the variable, and updated the three case statements for the lowercased values.

@gdibble
Copy link
Author

gdibble commented Oct 5, 2025

Hi @vogelcodes, first thanks for your web app to convert the json to srt. I noticed it wasn't selecting the newly named 'draft_info.json' and upon inspection, I thought this second os update per process.platform would help -- and lowercased it to ensure working on any platform. Hope this helps. Would you mind reviewing and deploying the update? Thanks :)

@vogelcodes
Copy link
Owner

I'm sorry for not responding. I'm not really used to deal with Merges e PR's.
I'll try to review it but I've been using Whisper instead of CapCut for sometime now, as it's more precise, and outputs the srt directly in the same folder as the media.
Check out this repo: Autosubs
I've been using it for one week and it's awsome, works with Davinci Resolve as well.

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.

2 participants