From 189812915ac6f3b49fe8143f454671897a6d740c Mon Sep 17 00:00:00 2001 From: zhiyu1998 Date: Sun, 12 Mar 2023 02:47:17 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9E=20fix:=20=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E7=BD=91=E6=98=93=E4=BA=91=E8=A7=A3=E6=9E=90=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/tools.js b/apps/tools.js index 668d442..01d30d5 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -644,8 +644,7 @@ export class tools extends plugin { async netease(e) { const message = e.msg === undefined ? e.message.shift().data.replaceAll("\\", "") : e.msg.trim(); const musicUrlReg = /(http:|https:)\/\/music.163.com\/song\/media\/outer\/url\?id=(\d+)/; - const realMusicUrl = musicUrlReg.exec(message)[0]; - const id = musicUrlReg.exec(message)[2]; + const id = /id=(\d+)/.exec(message)[1] || musicUrlReg.exec(message)[2]; console.log(id); fetch(`https://api.vvhan.com/api/music?id=${id}&type=song&media=netease`, { headers: {