From 95cb458122aa3f914d9f9d3c8439fae087f435ee Mon Sep 17 00:00:00 2001 From: zhiyu <542716863@qq.com> Date: Tue, 2 Jul 2024 17:34:18 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E5=A2=9E=E5=8A=A0=E4=B8=93?= =?UTF-8?q?=E6=A0=8F=E6=80=BB=E7=BB=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/tools.js | 5 +++++ utils/link-share-summary-util.js | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/apps/tools.js b/apps/tools.js index 3352140..083c9fe 100644 --- a/apps/tools.js +++ b/apps/tools.js @@ -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("下载")) { // 检测是否扫码了,如果没有扫码数据终止下载 diff --git a/utils/link-share-summary-util.js b/utils/link-share-summary-util.js index 293e2a9..0cf0370 100644 --- a/utils/link-share-summary-util.js +++ b/utils/link-share-summary-util.js @@ -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("内容评估出错...");