From b8f6fcb635d0351455ee94f442d2451a72e86b03 Mon Sep 17 00:00:00 2001 From: zhiyu1998 <542716863@qq.com> Date: Sat, 11 May 2024 17:48:05 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=A6=84=20refactor:=20=E6=96=B0=E5=A2=9Eam?= =?UTF-8?q?=E5=AF=B9=E5=9B=BD=E5=86=85=E6=9C=8D=E5=8A=A1=E5=99=A8=E7=9A=84?= =?UTF-8?q?=E6=94=AF=E6=8C=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/apps/tools.js b/apps/tools.js index f932c9c..923e177 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -1440,6 +1440,30 @@ export class tools extends plugin { // 获取信息 const { title, album, artist } = await this.parseFreyrLog(result.toString()); e.reply(`识别:Apple Music,${ title }--${ artist }\n${ album }`); + // 判断是否是海外服务器 + const isOversea = await this.isOverseasServer(); + // 国内服务器解决方案 + if (!isOversea && !(await testProxy(this.proxyAddr, this.proxyPort))) { + // 临时接口 + const vipMusicData = await axios.get(`https://www.hhlqilongzhu.cn/api/dg_wyymusic.php?gm=${ title }&n=1&type=json`, { + headers: { + "User-Agent": + "Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.25 Mobile Safari/537.36", + }, + }); + const url = vipMusicData.data.music_url; + // 下载音乐 + downloadMp3(url, this.getCurDownloadPath(e), title, 'follow').then(async path => { + // 发送语音 + // e.reply(segment.record(path)); + // 判断是不是icqq + await this.uploadGroupFile(e, path); + await checkAndRemoveFile(path); + }).catch(err => { + logger.error(`下载音乐失败,错误信息为: ${ err.message }`); + }); + return true; + } // 检查目录是否存在 const musicPath = currentWorkingDirectory + "/am/" + artist + "/" + album; const that = this;