feat: 新增波点音乐点mv

This commit is contained in:
zhiyu1998 2023-03-20 00:57:16 +08:00
parent 44216cf71d
commit d601617268
6 changed files with 59 additions and 9 deletions

View File

@ -31,16 +31,16 @@ export class neteasepro extends plugin {
rule: [ rule: [
{ {
/** 命令正则匹配 */ /** 命令正则匹配 */
reg: "#网易云登录", reg: "^#网易云登录$",
/** 执行方法 */ /** 执行方法 */
fnc: "neteaseCloudLogin", fnc: "neteaseCloudLogin",
}, },
{ {
reg: "#网易云每日推荐", reg: "^#网易云每日推荐$",
fnc: "neteaseDailyRecommend", fnc: "neteaseDailyRecommend",
}, },
{ {
reg: "#网易云听歌排行", reg: "^#网易云听歌排行$",
fnc: "neteaseListenRank", fnc: "neteaseListenRank",
}, },
{ {

View File

@ -33,11 +33,11 @@ export class query extends plugin {
fnc: "cat", fnc: "cat",
}, },
{ {
reg: "^#电脑软件推荐$" /** 执行方法 */, reg: "^#电脑软件推荐$",
fnc: "computerRecommended", fnc: "computerRecommended",
}, },
{ {
reg: "^#安卓软件推荐$" /** 执行方法 */, reg: "^#安卓软件推荐$",
fnc: "androidRecommended", fnc: "androidRecommended",
}, },
{ {

View File

@ -1,7 +1,7 @@
// 主库 // 主库
import fetch from "node-fetch"; import fetch from "node-fetch";
import fs from "node:fs"; import fs from "node:fs";
import { Gfs, segment } from "oicq"; import { segment } from "oicq";
// 其他库 // 其他库
import md5 from "md5"; import md5 from "md5";
import axios from "axios"; import axios from "axios";
@ -65,6 +65,10 @@ export class tools extends plugin {
fnc: "clearTrash", fnc: "clearTrash",
permission: "master", permission: "master",
}, },
{
reg: '^#波点音乐(.*)',
fnc: 'bodianMusic'
}
], ],
}); });
// http://api.tuwei.space/girl // 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<void>}
*/
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 * @param title
@ -791,7 +837,7 @@ export class tools extends plugin {
res.data.pipe(writer); res.data.pipe(writer);
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
writer.on("finish", resolve); writer.on("finish", () => resolve(groupPath));
writer.on("error", reject); writer.on("error", reject);
}); });
} }

View File

@ -56,8 +56,11 @@
- icon: netease - icon: netease
title: "网易云音乐" title: "网易云音乐"
desc: 网易云音乐解析 desc: 网易云音乐解析
- icon: bodian
title: "#波点音乐"
desc: 波点云音乐点MV
- group: 其他指令 - group: 其他指令
list: list:
- icon: update - icon: update
title: "#R插件更新" title: "#R插件更新"
desc: "进行更新R插件" desc: "进行更新R插件"

View File

@ -2,6 +2,7 @@
version: 1.1.0-rc0, version: 1.1.0-rc0,
data: data:
[ [
新增<span class="cmd">#波点音乐</span>MV点歌,
升级<span class="cmd">netease解析</span>全面重构!, 升级<span class="cmd">netease解析</span>全面重构!,
适配<span class="cmd">bilibili小程序解析</span>, 适配<span class="cmd">bilibili小程序解析</span>,
增加<span class="cmd">#搜书</span>查询, 增加<span class="cmd">#搜书</span>查询,
@ -9,4 +10,4 @@
添加<span class="cmd">#R帮助</span>获取插件帮助, 添加<span class="cmd">#R帮助</span>获取插件帮助,
添加<span class="cmd">#R版本</span>获取插件版本, 添加<span class="cmd">#R版本</span>获取插件版本,
], ],
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB