@oxiaom/adoremix 1.0.48 → 1.0.50
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 +1 -1
- package/tts/providers/audio8.js +36 -6
package/package.json
CHANGED
package/tts/providers/audio8.js
CHANGED
|
@@ -298,12 +298,42 @@ function install(opts) {
|
|
|
298
298
|
}
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
-
// git clone
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
301
|
+
// 拉 Audio8_TTS 源码:先试 git clone(多个镜像),全失败再走 codeload tarball(最后备选)
|
|
302
|
+
const MIRRORS = [
|
|
303
|
+
AUDIO8_REPO, // 官方 https
|
|
304
|
+
'https://ghproxy.cn/https://github.com/Audio8-AI/Audio8_TTS.git', // 国内代理
|
|
305
|
+
'https://hub.fastgit.xyz/Audio8-AI/Audio8_TTS.git' // fastgit 镜像
|
|
306
|
+
];
|
|
307
|
+
let cloned = false;
|
|
308
|
+
for (let attempt = 1; attempt <= 2; attempt++) {
|
|
309
|
+
for (const url of MIRRORS) {
|
|
310
|
+
try {
|
|
311
|
+
logger.log(`=== 克隆 Audio8_TTS(第 ${attempt} 次尝试): ${url} ===`);
|
|
312
|
+
execSync(`rm -rf ~/audio8_temp && git clone --depth=1 "${url}" ~/audio8_temp 2>&1 | tail -3`, { stdio: 'inherit', shell: '/bin/bash' });
|
|
313
|
+
execSync(`sh -c "cd ~/audio8_temp && (shopt -s dotglob; mv -- * ~/audio8/ 2>/dev/null || true)"`, { stdio: 'inherit', shell: '/bin/bash' });
|
|
314
|
+
execSync('rm -rf ~/audio8_temp', { stdio: 'ignore', shell: '/bin/bash' });
|
|
315
|
+
cloned = true;
|
|
316
|
+
break;
|
|
317
|
+
} catch (e) {
|
|
318
|
+
logger.warn(`克隆失败(${url.slice(0, 60)}...): ${String(e.message).slice(0, 100)}`);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
if (cloned) break;
|
|
322
|
+
execSync('sleep 5', { stdio: 'ignore', shell: '/bin/bash' });
|
|
323
|
+
}
|
|
324
|
+
// 备选:codeload 直接下 master 分支 tarball(绕过 git,HTTP 而已,国内更稳定)
|
|
325
|
+
if (!cloned) {
|
|
326
|
+
try {
|
|
327
|
+
logger.log('=== 备选:codeload github tarball ===');
|
|
328
|
+
execSync(`rm -rf ~/audio8 && mkdir -p ~/audio8 && cd /tmp && curl -fL --retry 3 --connect-timeout 10 https://codeload.github.com/Audio8-AI/Audio8_TTS/tar.gz/master -o audio8.tar.gz && tar xzf audio8.tar.gz --strip-components=1 -C ~/audio8 && rm -f audio8.tar.gz && ls ~/audio8 | head -3`, { stdio: 'inherit', shell: '/bin/bash' });
|
|
329
|
+
cloned = true;
|
|
330
|
+
} catch (e) {
|
|
331
|
+
logger.error('codeload 也失败:' + String(e.message).slice(0, 200));
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
if (!cloned) {
|
|
335
|
+
logger.error('所有镜像和重试都失败,无法克隆 Audio8_TTS 仓库');
|
|
336
|
+
logger.warn('解决:手动在 ~/audio8 下放好 Audio8_TTS 源码再重试 install(跳过 git clone 步骤)');
|
|
307
337
|
return 1;
|
|
308
338
|
}
|
|
309
339
|
|