feat: 增加专栏总结

This commit is contained in:
zhiyu 2024-07-02 17:34:18 +08:00
parent 69150a6a6b
commit 95cb458122
2 changed files with 11 additions and 0 deletions

View File

@ -443,6 +443,11 @@ export class tools extends plugin {
if (matched) {
url = url.replace(matched[0].replace("\/", ""), av2BV(Number(matched[2])));
}
// 处理专栏
if (e.msg !== undefined && e.msg.includes("read\/cv")) {
this.linkShareSummary(e);
return true;
}
// 处理下载逻辑
if (e.msg !== undefined && e.msg.startsWith("下载")) {
// 检测是否扫码了,如果没有扫码数据终止下载

View File

@ -7,6 +7,7 @@ export function contentEstimator(link) {
const wxReg = /(?:https?:\/\/)?mp\.weixin\.qq\.com\/[A-Za-z\d._?%&+\-=\/#]*/;
const arxivReg = /(?:https?:\/\/)?arxiv.org\/[a-zA-Z\d._?%&+\-=\/#]*/;
const sspaiReg = /(?:https?:\/\/)?sspai.com\/[a-zA-Z\d._?%&+\-=\/#]*/;
const biliReadReg = /(?:https?:\/\/)?www\.bilibili\.com\/read\/[A-Za-z\d._?%&+\-=\/#]*/;
if (wxReg.test(link)) {
return {
name: '微信文章',
@ -22,6 +23,11 @@ export function contentEstimator(link) {
name: '少数派',
summaryLink: sspaiReg.exec(link)?.[0]
}
} else if (biliReadReg.test(link)) {
return {
name: '哔哩哔哩专栏',
summaryLink: biliReadReg.exec(link)?.[0]
}
} else {
logger.error("[R插件][总结模块] 内容评估出错...");
throw Error("内容评估出错...");