stemit-cli 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/src/commands/setup.js +17 -2
- package/src/lib/splitter.js +18 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stemit-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "CLI tool to split audio into stems (vocals/drums/bass/other), analyze BPM & key, and mute/solo tracks",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -9,7 +9,8 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"bin/",
|
|
12
|
-
"src/"
|
|
12
|
+
"src/",
|
|
13
|
+
"README.md"
|
|
13
14
|
],
|
|
14
15
|
"engines": {
|
|
15
16
|
"node": ">=18"
|
package/src/commands/setup.js
CHANGED
|
@@ -102,18 +102,33 @@ async function ensureDemucsVenv(systemPython) {
|
|
|
102
102
|
|
|
103
103
|
if (demucsCheck.status !== 0) {
|
|
104
104
|
console.log(chalk.cyan(' Installing demucs (one-time setup, may take a minute) …'))
|
|
105
|
-
const install = spawnSync(VENV_PIP, ['install', 'demucs', 'soundfile', 'torchcodec'], {
|
|
105
|
+
const install = spawnSync(VENV_PIP, ['install', 'demucs', 'soundfile', 'torchcodec', 'certifi'], {
|
|
106
106
|
encoding: 'utf8',
|
|
107
107
|
stdio: 'inherit',
|
|
108
108
|
})
|
|
109
109
|
if (install.status !== 0) {
|
|
110
110
|
console.error(chalk.red(
|
|
111
111
|
'\n Failed to install demucs. Try manually:\n' +
|
|
112
|
-
' pip install demucs soundfile torchcodec'
|
|
112
|
+
' pip install demucs soundfile torchcodec certifi'
|
|
113
113
|
))
|
|
114
114
|
process.exit(1)
|
|
115
115
|
}
|
|
116
116
|
console.log(chalk.green(' ✔ demucs installed'))
|
|
117
|
+
|
|
118
|
+
// macOS: fix SSL certificate verification (common issue with python.org installer)
|
|
119
|
+
if (process.platform === 'darwin') {
|
|
120
|
+
const certScript = spawnSync(
|
|
121
|
+
VENV_PYTHON,
|
|
122
|
+
['-c', 'import certifi, ssl, urllib.request; urllib.request.install_opener(urllib.request.build_opener(urllib.request.HTTPSHandler(context=ssl.create_default_context(cafile=certifi.where()))))'],
|
|
123
|
+
{ encoding: 'utf8', stdio: 'pipe' }
|
|
124
|
+
)
|
|
125
|
+
if (certScript.status !== 0) {
|
|
126
|
+
console.log(chalk.yellow(
|
|
127
|
+
' ⚠ SSL cert fix skipped. If you see SSL errors, run:\n' +
|
|
128
|
+
' /Applications/Python\\ 3.x/Install\\ Certificates.command'
|
|
129
|
+
))
|
|
130
|
+
}
|
|
131
|
+
}
|
|
117
132
|
}
|
|
118
133
|
|
|
119
134
|
return VENV_PYTHON
|
package/src/lib/splitter.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { spawn } from 'child_process'
|
|
1
|
+
import { spawn, execFileSync } from 'child_process'
|
|
2
2
|
import path from 'path'
|
|
3
3
|
import fs from 'fs'
|
|
4
4
|
|
|
@@ -35,8 +35,24 @@ export function splitStems(
|
|
|
35
35
|
) {
|
|
36
36
|
return new Promise((resolve, reject) => {
|
|
37
37
|
const args = ['-m', 'demucs', '-n', model, '--out', outputDir, inputFile]
|
|
38
|
+
|
|
39
|
+
// Resolve certifi's CA bundle path from within the venv (fixes macOS SSL issues)
|
|
40
|
+
let sslCertFile = process.env.SSL_CERT_FILE
|
|
41
|
+
try {
|
|
42
|
+
const certPath = execFileSync(pythonPath, ['-c', 'import certifi; print(certifi.where())'], {
|
|
43
|
+
encoding: 'utf8',
|
|
44
|
+
}).trim()
|
|
45
|
+
if (certPath) sslCertFile = certPath
|
|
46
|
+
} catch {
|
|
47
|
+
// certifi not available — fall back to system SSL
|
|
48
|
+
}
|
|
49
|
+
|
|
38
50
|
const proc = spawn(pythonPath, args, {
|
|
39
|
-
env: {
|
|
51
|
+
env: {
|
|
52
|
+
...process.env,
|
|
53
|
+
TORCHAUDIO_BACKEND: 'soundfile',
|
|
54
|
+
...(sslCertFile ? { SSL_CERT_FILE: sslCertFile, REQUESTS_CA_BUNDLE: sslCertFile } : {}),
|
|
55
|
+
},
|
|
40
56
|
})
|
|
41
57
|
|
|
42
58
|
const stderrLines = []
|