mirror of
https://github.com/Jerryplusy/rc-plugin.git
synced 2025-10-14 16:19:18 +00:00
✨ feat: 添加哔哩哔哩不加https的支持 [#I6SFIU]
This commit is contained in:
parent
611b297556
commit
e6f3f5c049
@ -280,7 +280,7 @@ export class tools extends plugin {
|
|||||||
|
|
||||||
// bilibi解析
|
// bilibi解析
|
||||||
async bili(e) {
|
async bili(e) {
|
||||||
const urlRex = /(http:|https:)\/\/www.bilibili.com\/[A-Za-z\d._?%&+\-=\/#]*/g;
|
const urlRex = /(?:https?:\/\/)?www\.bilibili\.com\/[A-Za-z\d._?%&+\-=\/#]*/g;
|
||||||
const bShortRex = /(http:|https:)\/\/b23.tv\/[A-Za-z\d._?%&+\-=\/#]*/g;
|
const bShortRex = /(http:|https:)\/\/b23.tv\/[A-Za-z\d._?%&+\-=\/#]*/g;
|
||||||
let url = e.msg === undefined ? e.message.shift().data.replaceAll("\\", "") : e.msg.trim();
|
let url = e.msg === undefined ? e.message.shift().data.replaceAll("\\", "") : e.msg.trim();
|
||||||
// 短号处理
|
// 短号处理
|
||||||
@ -292,6 +292,9 @@ export class tools extends plugin {
|
|||||||
} else if (url.includes("www.bilibili.com")) {
|
} else if (url.includes("www.bilibili.com")) {
|
||||||
url = urlRex.exec(url)[0];
|
url = urlRex.exec(url)[0];
|
||||||
}
|
}
|
||||||
|
// 补充https
|
||||||
|
url = url.startsWith("https://") ? url : "https://" + url;
|
||||||
|
logger.info(url)
|
||||||
// av处理
|
// av处理
|
||||||
const matched = url.match(/(av|AV)(\w+)/);
|
const matched = url.match(/(av|AV)(\w+)/);
|
||||||
if (matched) {
|
if (matched) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user