koishi-plugin-video-parser-all 1.1.4 → 1.1.5

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.
Files changed (2) hide show
  1. package/lib/index.js +4 -4
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -10,7 +10,7 @@ const promises_1 = __importDefault(require("fs/promises"));
10
10
  const path_1 = __importDefault(require("path"));
11
11
  const fs_1 = require("fs");
12
12
  const promises_2 = require("stream/promises");
13
- const lru_cache_1 = __importDefault(require("lru-cache"));
13
+ const LRUCache = require("lru-cache");
14
14
  exports.name = 'video-parser-all';
15
15
  exports.Config = koishi_1.Schema.intersect([
16
16
  koishi_1.Schema.object({
@@ -119,7 +119,7 @@ function debugLog(level, ...args) {
119
119
  }).join(' ')}`;
120
120
  logger.info(message);
121
121
  }
122
- const urlCache = new lru_cache_1.default({
122
+ const urlCache = new LRUCache({
123
123
  max: 500,
124
124
  ttl: 10 * 60 * 1000,
125
125
  updateAgeOnGet: false,
@@ -437,7 +437,7 @@ function getErrorMessage(error) {
437
437
  function apply(ctx, config) {
438
438
  debugEnabled = config.debug || false;
439
439
  debugLog('INFO', '插件初始化开始');
440
- const dedupCache = new lru_cache_1.default({
440
+ const dedupCache = new LRUCache({
441
441
  max: 1000,
442
442
  ttl: config.deduplicationInterval * 1000,
443
443
  });
@@ -481,7 +481,7 @@ function apply(ctx, config) {
481
481
  'Referer': 'https://www.baidu.com/',
482
482
  },
483
483
  validateStatus: (status) => status >= 200 && status < 400,
484
- }); // use any to bypass type check for possible missing maxRedirects
484
+ });
485
485
  const finalUrl = res.request?.res?.responseUrl || url;
486
486
  return cleanUrl(finalUrl);
487
487
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "koishi-plugin-video-parser-all",
3
3
  "description": "Koishi 全平台视频解析插件,支持抖音/快手/B站/微博/小红书/剪映/YouTube/TikTok等20+平台",
4
- "version": "1.1.4",
4
+ "version": "1.1.5",
5
5
  "main": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
7
7
  "files": [