From 6c171b32a1ee7073fa98997f177fd4af7fe9e220 Mon Sep 17 00:00:00 2001 From: ikechan8370 Date: Mon, 16 Oct 2023 16:57:52 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dtts=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- utils/tts.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/utils/tts.js b/utils/tts.js index 0888db2..ee81009 100644 --- a/utils/tts.js +++ b/utils/tts.js @@ -2,14 +2,8 @@ import { Config } from './config.js' import fetch from 'node-fetch' import _ from 'lodash' import { wrapTextByLanguage } from './common.js' -let proxy -if (Config.proxy) { - try { - proxy = (await import('https-proxy-agent')).default - } catch (e) { - console.warn('未安装https-proxy-agent,请在插件目录下执行pnpm add https-proxy-agent') - } -} +import { getProxy } from './proxy.js' +let proxy = getProxy() const newFetch = (url, options = {}) => { const defaultOptions = Config.proxy