feat:适配专栏在某些移动端情况下无法解析的问题

This commit is contained in:
zhiyu1998 2024-10-27 18:56:47 +08:00
parent ff2913bd6d
commit 835ab12c6e

View File

@ -770,7 +770,7 @@ export class tools extends plugin {
return true; return true;
} }
// 处理专栏 // 处理专栏
if (e.msg !== undefined && e.msg.includes("read\/cv")) { if (e.msg !== undefined && e.msg.includes("read\/cv") || e.msg.includes("read\/mobile")) {
await this.biliArticle(e); await this.biliArticle(e);
this.linkShareSummary(e); this.linkShareSummary(e);
return true; return true;
@ -838,7 +838,7 @@ export class tools extends plugin {
* @returns {Promise<void>} * @returns {Promise<void>}
*/ */
async biliArticle(e) { async biliArticle(e) {
const cvid = e.msg.match(/read\/cv(\d+)/)?.[1]; const cvid = e.msg.match(/read\/cv(\d+)/)?.[1] || e.msg.match(/read\/mobile\?id=(\d+)/)?.[1];
const articleResp = await fetch(BILI_ARTICLE_INFO.replace("{}", cvid), { const articleResp = await fetch(BILI_ARTICLE_INFO.replace("{}", cvid), {
headers: { headers: {
...BILI_HEADER ...BILI_HEADER