diff --git a/apps/neteasepro.js b/apps/neteasepro.js index a3f4fe4..2405539 100644 --- a/apps/neteasepro.js +++ b/apps/neteasepro.js @@ -31,16 +31,16 @@ export class neteasepro extends plugin { rule: [ { /** 命令正则匹配 */ - reg: "#网易云登录", + reg: "^#网易云登录$", /** 执行方法 */ fnc: "neteaseCloudLogin", }, { - reg: "#网易云每日推荐", + reg: "^#网易云每日推荐$", fnc: "neteaseDailyRecommend", }, { - reg: "#网易云听歌排行", + reg: "^#网易云听歌排行$", fnc: "neteaseListenRank", }, { diff --git a/apps/query.js b/apps/query.js index f60dfba..0841b94 100644 --- a/apps/query.js +++ b/apps/query.js @@ -33,11 +33,11 @@ export class query extends plugin { fnc: "cat", }, { - reg: "^#电脑软件推荐$" /** 执行方法 */, + reg: "^#电脑软件推荐$", fnc: "computerRecommended", }, { - reg: "^#安卓软件推荐$" /** 执行方法 */, + reg: "^#安卓软件推荐$", fnc: "androidRecommended", }, { diff --git a/apps/tools.js b/apps/tools.js index 0865dfc..fa9c31e 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -1,7 +1,7 @@ // 主库 import fetch from "node-fetch"; import fs from "node:fs"; -import { Gfs, segment } from "oicq"; +import { segment } from "oicq"; // 其他库 import md5 from "md5"; import axios from "axios"; @@ -65,6 +65,10 @@ export class tools extends plugin { fnc: "clearTrash", permission: "master", }, + { + reg: '^#波点音乐(.*)', + fnc: 'bodianMusic' + } ], }); // http://api.tuwei.space/girl @@ -638,6 +642,48 @@ export class tools extends plugin { } } + async bodianMusic(e) { + const msg = e.msg.replace("#波点音乐").trim() + const API = `https://xiaobai.klizi.cn/API/music/bodian.php?msg=${msg}&n=&max=` + // 获取列表 + const thisMethod = this; + await axios.get(API).then(resp => { + /** + * "songName": "山海", + * "artist": "草东没有派对", + * "coverUrl": "https://img3.kuwo.cn/wmvpic/324/78/55/3196258119.jpg", + * "highUrl": "http://other.player.nf03.sycdn.kuwo.cn/f7451ba7f02256b6b5d5ae8a74336502/64172260/resource/m2/55/56/3401786858.mp4?from=bodian", + * "lowUrl": "http://other.player.nf03.sycdn.kuwo.cn/47e753a5f8350140716e439f1c87dc1f/64172260/resource/m3/50/96/2318372432.mp4?from=bodian", + * "shortLowUrl": null + */ + e.reply("请选择一个要播放的视频:\n" + resp.data); + thisMethod.setContext("bodianMusicContext"); + }) + return true; + } + + /** + * @link bodianMusic 波点音乐上下文 + * @returns {Promise} + */ + async bodianMusicContext() { + // 当前消息 + const curMsg = this.e; + // 上一个消息 + const preMsg = await this.getContext().bodianMusicContext; + const msg = preMsg.msg.replace("#波点音乐", "").trim(); + const API = `https://xiaobai.klizi.cn/API/music/bodian.php?msg=${msg}&n=${Number(curMsg.msg)}&max=` + const thisMethod = this; + await axios.get(API).then(async res => { + const {songName, artist, coverUrl, highUrl, lowUrl, shortLowUrl} = res.data; + curMsg.reply([`${songName}-${artist}\n`, segment.image(coverUrl)]); + await thisMethod.downloadVideo(lowUrl).then(path => { + curMsg.reply(segment.video(path + "/temp.mp4")); + }) + thisMethod.finish("bodianMusicContext"); + }) + } + /** * 哔哩哔哩下载 * @param title @@ -791,7 +837,7 @@ export class tools extends plugin { res.data.pipe(writer); return new Promise((resolve, reject) => { - writer.on("finish", resolve); + writer.on("finish", () => resolve(groupPath)); writer.on("error", reject); }); } diff --git a/config/help.yaml b/config/help.yaml index 7575abc..25ca26d 100644 --- a/config/help.yaml +++ b/config/help.yaml @@ -56,8 +56,11 @@ - icon: netease title: "网易云音乐" desc: 网易云音乐解析 + - icon: bodian + title: "#波点音乐" + desc: 波点云音乐点MV - group: 其他指令 list: - icon: update title: "#R插件更新" - desc: "进行更新R插件" \ No newline at end of file + desc: "进行更新R插件" diff --git a/config/version.yaml b/config/version.yaml index 13ecd55..459a7a4 100644 --- a/config/version.yaml +++ b/config/version.yaml @@ -2,6 +2,7 @@ version: 1.1.0-rc0, data: [ + 新增#波点音乐MV点歌, 升级netease解析全面重构!, 适配bilibili小程序解析, 增加#搜书查询, @@ -9,4 +10,4 @@ 添加#R帮助获取插件帮助, 添加#R版本获取插件版本, ], -} \ No newline at end of file +} diff --git a/resources/img/icon/bodian.png b/resources/img/icon/bodian.png new file mode 100644 index 0000000..ac3c09d Binary files /dev/null and b/resources/img/icon/bodian.png differ