mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
↩ revert: 退回版本
This commit is contained in:
parent
da105f4f81
commit
e65c8244db
@ -644,13 +644,14 @@ export class tools extends plugin {
|
|||||||
async netease(e) {
|
async netease(e) {
|
||||||
const message = e.msg === undefined ? e.message.shift().data.replaceAll("\\", "") : e.msg.trim();
|
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 musicUrlReg = /(http:|https:)\/\/music.163.com\/song\/media\/outer\/url\?id=(\d+)/;
|
||||||
const musicUrl = musicUrlReg.exec(message)
|
|
||||||
const musicDownloadUrl = musicUrl?.[0]
|
|
||||||
// 如果存在直接内容
|
// 如果存在直接内容
|
||||||
if (musicDownloadUrl) {
|
const musicJson = JSON.parse(message)
|
||||||
const musicJson = JSON.parse(message)
|
const {musicUrl, preview, title, desc} = musicJson.meta.music
|
||||||
const {musicUrl, preview, title, desc} = musicJson.meta.music
|
// 如果没有下载地址跳出if
|
||||||
console.log(111);
|
if (_.isNull(musicUrl) || _.isUndefined(musicUrl)) {
|
||||||
|
e.reply(`识别:网易云音乐,官方解析失败,开始执行第三方解析!`);
|
||||||
|
} else {
|
||||||
|
// 反之解析官方地址
|
||||||
e.reply([`识别:网易云音乐,${title}--${desc}`, segment.image(preview)]);
|
e.reply([`识别:网易云音乐,${title}--${desc}`, segment.image(preview)]);
|
||||||
await this.downloadMp3(musicUrl, 'follow').then(path => {
|
await this.downloadMp3(musicUrl, 'follow').then(path => {
|
||||||
Bot.acquireGfs(e.group_id).upload(fs.readFileSync(path), '/', `${title.replace(/[\/\?<>\\:\*\|".… ]/g, '')}.mp3`)
|
Bot.acquireGfs(e.group_id).upload(fs.readFileSync(path), '/', `${title.replace(/[\/\?<>\\:\*\|".… ]/g, '')}.mp3`)
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
- {
|
- {
|
||||||
version: 1.0.10,
|
version: 1.0.9,
|
||||||
data:
|
data:
|
||||||
[
|
[
|
||||||
新增<span class="cmd">网易云小程序解析</span>,
|
适配<span class="cmd">bilibili小程序解析</span>查询,
|
||||||
适配<span class="cmd">bilibili小程序解析</span>,
|
|
||||||
增加<span class="cmd">#搜书</span>查询,
|
增加<span class="cmd">#搜书</span>查询,
|
||||||
|
增加<span class="cmd">#青年大学习</span>查询,
|
||||||
适配<span class="cmd">锅巴</span>插件,方便查看和修改配置,
|
适配<span class="cmd">锅巴</span>插件,方便查看和修改配置,
|
||||||
添加<span class="cmd">#R帮助</span>获取插件帮助,
|
添加<span class="cmd">#R帮助</span>获取插件帮助,
|
||||||
添加<span class="cmd">#R版本</span>获取插件版本,
|
添加<span class="cmd">#R版本</span>获取插件版本,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user