koishi-plugin-bilibili-videolink-analysis 0.6.1 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -112,6 +112,13 @@ exports.Config = Schema.intersect([
112
112
  function apply(ctx, config) {
113
113
  const bilibiliVideo = ctx.BiliBiliVideo;
114
114
  ctx.middleware(async (session, next) => {
115
+ // 如果允许解析 BV 号,则进行解析
116
+ if (config.BVnumberParsing) {
117
+ const bvUrls = convertBVToUrl(session.content);
118
+ if (bvUrls.length > 0) {
119
+ session.content += '\n' + bvUrls.join('\n');
120
+ }
121
+ }
115
122
  const links = await isProcessLinks(session, config, ctx, lastProcessedUrls, logger); // 判断是否需要解析
116
123
  if (links) {
117
124
  const ret = await extractLinks(session, config, ctx, lastProcessedUrls, logger); // 提取链接
@@ -259,18 +266,8 @@ function apply(ctx, config) {
259
266
 
260
267
  //判断是否需要解析
261
268
  async function isProcessLinks(session, config, ctx, lastProcessedUrls, logger) {
262
- let content = session.content;
263
-
264
- // 如果允许解析 BV 号,则进行解析
265
- if (config.BVnumberParsing) {
266
- const bvUrls = convertBVToUrl(content);
267
- if (bvUrls.length > 0) {
268
- content += '\n' + bvUrls.join('\n');
269
- }
270
- }
271
-
272
269
  // 解析内容中的链接
273
- const links = link_type_parser(content);
270
+ const links = link_type_parser(session.content);
274
271
  if (links.length === 0) {
275
272
  return false; // 如果没有找到链接,返回 false
276
273
  }
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "koishi-plugin-bilibili-videolink-analysis",
3
3
  "description": "[<ruby>Bilibili视频解析<rp>(</rp><rt>点我查看食用方法</rt><rp>)</rp></ruby>](https://www.npmjs.com/package/koishi-plugin-bilibili-videolink-analysis)解析B站链接(支持小程序卡片)支持搜索点播功能!灵感来自强大的 [iirose-media-request](/market?keyword=iirose-media-request) 以及完美的 [bili-parser](/market?keyword=bili-parser) ,十分感谢这两个优秀的项目!",
4
4
  "license": "MIT",
5
- "version": "0.6.1",
5
+ "version": "0.6.3",
6
6
  "main": "lib/index.js",
7
7
  "typings": "lib/index.d.ts",
8
8
  "files": [
@@ -10,7 +10,7 @@
10
10
  "dist"
11
11
  ],
12
12
  "scripts": {},
13
- "homepage": "https://github.com/shangxueink/koishi-shangxue-apps/tree/main/%40shangxueink/koishi-plugin-content-guard",
13
+ "homepage": "https://github.com/shangxueink/koishi-shangxue-apps/tree/main/",
14
14
  "bugs": {
15
15
  "url": "https://github.com/shangxueink/koishi-shangxue-apps/issues"
16
16
  },
package/readme.md CHANGED
@@ -178,6 +178,10 @@ https://www.bilibili.com/video/BV1ii421Q7oj
178
178
  <details>
179
179
  <summary>点击此处 可查看更新日志</summary>
180
180
 
181
+ - **0.6.3**
182
+ - 修复单独的bv号解析报错
183
+ - 0.6.2更新了点播,忘写了
184
+
181
185
  - **0.6.1**
182
186
  - 支持点播功能,使用puppeteer进行网页截图,并且加以渲染序号,以便选择
183
187
  - 模块化中间件部分内容,方便调用