mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
🐞 fix: 修复微视
This commit is contained in:
parent
927b4a69fe
commit
4408001aa3
@ -171,7 +171,7 @@ export class tools extends plugin {
|
|||||||
fnc: "pixivision"
|
fnc: "pixivision"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
reg: "(isee.weishi.qq.com)",
|
reg: "(weishi.qq.com)",
|
||||||
fnc: "weishi"
|
fnc: "weishi"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -1452,15 +1452,17 @@ export class tools extends plugin {
|
|||||||
|
|
||||||
// 微视
|
// 微视
|
||||||
async weishi(e) {
|
async weishi(e) {
|
||||||
// 拦截恶意链接 【后续如果有小程序检测可以删除这个逻辑】
|
let url = e.msg;
|
||||||
if (!e.msg.includes('https://isee.weishi.qq.com/ws/app-pages/share/index.html')) {
|
const urlRegex = /https?:\/\/video\.weishi\.qq\.com\/\S+/g;
|
||||||
e.reply("识别:微视,但无法完整检测到视频ID");
|
// 执行匹配
|
||||||
// 打个日志 方便后面出bug知道位置
|
url = url.match(urlRegex)[0];
|
||||||
logger.error("[R插件][微视] 无法检测链接")
|
// 消除短链接
|
||||||
return true;
|
await fetch(url, {
|
||||||
}
|
method: "HEAD"
|
||||||
|
}).then(resp => {
|
||||||
|
url = resp.url;
|
||||||
|
});
|
||||||
|
|
||||||
const url = e.msg;
|
|
||||||
try {
|
try {
|
||||||
const idMatch = url.match(/id=(.*)&spid/);
|
const idMatch = url.match(/id=(.*)&spid/);
|
||||||
if (!idMatch || idMatch.length !== 2) {
|
if (!idMatch || idMatch.length !== 2) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user