feat: V1.5.6 新增皮皮虾解析

1. 【优化】更新X的解析匹配问题,防止匹配到皮皮虾的链接
2. 【新功能】新增通用解析的皮皮虾解析
3. 【精简插件】删除冷门功能,论文解析
This commit is contained in:
zhiyu1998 2024-03-15 20:17:51 +08:00
parent 1dd533b9fb
commit da274ab8d9
6 changed files with 15 additions and 33 deletions

View File

@ -97,7 +97,7 @@ export class tools extends plugin {
fnc: "bili", fnc: "bili",
}, },
{ {
reg: "(x.com)", reg: "https?:\\/\\/x.com\\/[0-9-a-zA-Z_]{1,20}\\/status\\/([0-9]*)",
fnc: "twitter_x", fnc: "twitter_x",
}, },
{ {
@ -112,10 +112,6 @@ export class tools extends plugin {
reg: "(instagram.com)", reg: "(instagram.com)",
fnc: "instagram", fnc: "instagram",
}, },
{
reg: "(doi.org)",
fnc: "literature",
},
{ {
reg: "^清理data垃圾$", reg: "^清理data垃圾$",
fnc: "clearTrash", fnc: "clearTrash",
@ -131,7 +127,7 @@ export class tools extends plugin {
fnc: "bodianMusic", fnc: "bodianMusic",
}, },
{ {
reg: "(kuaishou.com|ixigua.com|share.xiaochuankeji.cn)", reg: "(kuaishou.com|ixigua.com|share.xiaochuankeji.cn|h5.pipix.com)",
fnc: "general", fnc: "general",
}, },
{ {
@ -721,28 +717,6 @@ export class tools extends plugin {
return true; return true;
} }
// 文献解析
async literature(e) {
const litReg = /(http:|https:)\/\/doi.org\/[A-Za-z\d._?%&+\-=\/#@]*/;
const url = litReg.exec(e.msg.trim())[0];
const waitList = [
"https://sci-hub.se/",
"https://sci-hub.st/",
"https://sci-hub.do/",
"https://sci-hubtw.hkvisa.net/",
"https://sci-hub.ren/",
"https://sci-hub.ee/",
"https://sci-hub.ru/",
];
const flag = /doi.org\/(.*)/.exec(url)[1];
const newWaitList = waitList.map(item => {
return item + flag;
});
await Promise.any(newWaitList).then(resp => {
e.reply(resp);
});
}
// 清理垃圾文件 // 清理垃圾文件
async clearTrash(e) { async clearTrash(e) {
const dataDirectory = "./data/"; const dataDirectory = "./data/";
@ -1009,7 +983,7 @@ export class tools extends plugin {
async general(e) { async general(e) {
const linkAdapter = new GeneralLinkAdapter(e.msg); const linkAdapter = new GeneralLinkAdapter(e.msg);
const adapter = await linkAdapter.build(); const adapter = await linkAdapter.build();
logger.info(adapter.link) logger.mark(adapter.link)
e.reply(`识别:${adapter.name}`); e.reply(`识别:${adapter.name}`);
// 发送GET请求 // 发送GET请求
axios.get(adapter.link, { axios.get(adapter.link, {

View File

@ -71,9 +71,9 @@
- icon: zuiyou - icon: zuiyou
title: "最右(测试阶段)" title: "最右(测试阶段)"
desc: 最右分享实时下载 desc: 最右分享实时下载
- icon: literature - icon: pipi
title: "论文" title: "皮皮虾(测试阶段)"
desc: SCI论文实时解析 desc: 皮皮虾分享实时下载
- icon: bodian - icon: bodian
title: "波点音乐" title: "波点音乐"
desc: 波点云音乐点解析 desc: 波点云音乐点解析

View File

@ -1,7 +1,8 @@
- { - {
version: 1.5.5, version: 1.5.6,
data: data:
[ [
新增<span class="cmd">皮皮虾解析</span>功能,
新增<span class="cmd">Pixivision解析</span>功能, 新增<span class="cmd">Pixivision解析</span>功能,
新增<span class="cmd">微博解析</span>功能, 新增<span class="cmd">微博解析</span>功能,
新增<span class="cmd">最右解析</span>功能, 新增<span class="cmd">最右解析</span>功能,

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

BIN
resources/img/icon/pipi.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

View File

@ -14,6 +14,8 @@ class GeneralLinkAdapter {
this.#url = this.ks(link); this.#url = this.ks(link);
} else if (/ixigua.com/.test(link)) { } else if (/ixigua.com/.test(link)) {
this.#url = this.xigua(link); this.#url = this.xigua(link);
} else if (/h5.pipix.com/.test(link)) {
this.#url = this.pipixia(link);
} }
} }
@ -74,6 +76,11 @@ class GeneralLinkAdapter {
return {name: "西瓜", link: GENERAL_REQ_LINK.replace("{}", videoReq)}; return {name: "西瓜", link: GENERAL_REQ_LINK.replace("{}", videoReq)};
} }
async pipixia(link) {
const msg = /https:\/\/h5\.pipix\.com\/s\/[A-Za-z0-9]+/.exec(link)?.[0];
return {name: "皮皮虾", link: GENERAL_REQ_LINK.replace("{}", msg)};
}
async build() { async build() {
return this.#url; return this.#url;
} }