koishi-plugin-video-parser-all 1.4.4 → 1.4.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.
- package/lib/index.js +43 -25
- package/package.json +1 -1
- package/readme.md +34 -30
package/lib/index.js
CHANGED
|
@@ -298,46 +298,64 @@ function debugLog(level, ...args) {
|
|
|
298
298
|
}
|
|
299
299
|
const BUILTIN_LINK_RULES = [
|
|
300
300
|
{ pattern: /https?:\/\/(?:www\.)?bilibili\.com\/video\/([ab]v[0-9a-zA-Z_-]+)[^\s]*/gi, type: 'bilibili' },
|
|
301
|
-
{ pattern: /https?:\/\/b23\.tv\/[0-9a-zA-Z_
|
|
302
|
-
{ pattern: /https?:\/\/bili\d+\.cn\/[0-9a-zA-Z_
|
|
301
|
+
{ pattern: /https?:\/\/b23\.tv\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'bilibili' },
|
|
302
|
+
{ pattern: /https?:\/\/bili\d+\.cn\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'bilibili' },
|
|
303
|
+
{ pattern: /https?:\/\/b23\.wtf\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'bilibili' },
|
|
304
|
+
{ pattern: /https?:\/\/bili2233\.cn\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'bilibili' },
|
|
303
305
|
{ pattern: /https?:\/\/(?:www\.)?douyin\.com\/video\/\d{10,}[^\s]*/gi, type: 'douyin' },
|
|
304
|
-
{ pattern: /https?:\/\/v\.douyin\.com\/[0-9a-zA-Z_
|
|
305
|
-
{ pattern: /https?:\/\/(?:www\.)?kuaishou\.com\/short-video\/[0-9a-zA-Z_
|
|
306
|
-
{ pattern: /https?:\/\/v\.kuaishou\.com\/[0-9a-zA-Z_
|
|
307
|
-
{ pattern: /https?:\/\/(?:www\.)?
|
|
308
|
-
{ pattern: /https?:\/\/
|
|
309
|
-
{ pattern: /https?:\/\/
|
|
310
|
-
{ pattern: /https?:\/\/
|
|
306
|
+
{ pattern: /https?:\/\/v\.douyin\.com\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'douyin' },
|
|
307
|
+
{ pattern: /https?:\/\/(?:www\.)?kuaishou\.com\/short-video\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'kuaishou' },
|
|
308
|
+
{ pattern: /https?:\/\/v\.kuaishou\.com\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'kuaishou' },
|
|
309
|
+
{ pattern: /https?:\/\/(?:www\.)?kuaishou\.com\/f\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'kuaishou' },
|
|
310
|
+
{ pattern: /https?:\/\/(?:www\.)?xiaohongshu\.com\/discovery\/item\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'xiaohongshu' },
|
|
311
|
+
{ pattern: /https?:\/\/xhslink\.com\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'xiaohongshu' },
|
|
312
|
+
{ pattern: /https?:\/\/(?:www\.)?xiaohongshu\.com\/explore\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'xiaohongshu' },
|
|
313
|
+
{ pattern: /https?:\/\/(?:www\.)?xiaohongshu\.com\/board\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'xiaohongshu' },
|
|
314
|
+
{ pattern: /https?:\/\/weibo\.com\/\d+\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'weibo' },
|
|
315
|
+
{ pattern: /https?:\/\/video\.weibo\.com\/show\?fid=[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'weibo' },
|
|
316
|
+
{ pattern: /https?:\/\/t\.cn\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'weibo' },
|
|
317
|
+
{ pattern: /https?:\/\/m\.weibo\.cn\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'weibo' },
|
|
311
318
|
{ pattern: /https?:\/\/(?:www\.)?ixigua\.com\/\d{10,}[^\s]*/gi, type: 'xigua' },
|
|
312
319
|
{ pattern: /https?:\/\/(?:www\.)?youtube\.com\/watch\?v=[a-zA-Z0-9_-]{11}[^\s]*/gi, type: 'youtube' },
|
|
313
|
-
{ pattern: /https?:\/\/youtu\.be\/[
|
|
320
|
+
{ pattern: /https?:\/\/youtu\.be\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'youtube' },
|
|
321
|
+
{ pattern: /https?:\/\/(?:www\.)?youtube\.com\/shorts\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'youtube' },
|
|
314
322
|
{ pattern: /https?:\/\/(?:www\.)?tiktok\.com\/@[\w.]+\/video\/\d{10,}[^\s]*/gi, type: 'tiktok' },
|
|
315
|
-
{ pattern: /https?:\/\/vm\.tiktok\.com\/[0-9a-zA-Z_
|
|
323
|
+
{ pattern: /https?:\/\/vm\.tiktok\.com\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'tiktok' },
|
|
324
|
+
{ pattern: /https?:\/\/vt\.tiktok\.com\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'tiktok' },
|
|
316
325
|
{ pattern: /https?:\/\/(?:www\.)?acfun\.cn\/v\/ac\d{10,}[^\s]*/gi, type: 'acfun' },
|
|
317
326
|
{ pattern: /https?:\/\/(?:www\.)?zhihu\.com\/video\/\d{10,}[^\s]*/gi, type: 'zhihu' },
|
|
318
|
-
{ pattern: /https?:\/\/
|
|
319
|
-
{ pattern: /https?:\/\/
|
|
320
|
-
{ pattern: /https?:\/\/
|
|
327
|
+
{ pattern: /https?:\/\/(?:www\.|m\.)?zhihu\.com\/question\/\d+\/answer\/\d+[^\s]*/gi, type: 'zhihu' },
|
|
328
|
+
{ pattern: /https?:\/\/zhuanlan\.zhihu\.com\/p\/\d+[^\s]*/gi, type: 'zhihu' },
|
|
329
|
+
{ pattern: /https?:\/\/(?:www\.|m\.)?zhihu\.com\/zvideo\/\d+[^\s]*/gi, type: 'zhihu' },
|
|
330
|
+
{ pattern: /https?:\/\/weishi\.qq\.com\/weishi\/feed\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'weishi' },
|
|
331
|
+
{ pattern: /https?:\/\/(?:www\.)?huya\.com\/video\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'huya' },
|
|
332
|
+
{ pattern: /https?:\/\/haokan\.baidu\.com\/v\?vid=[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'haokan' },
|
|
321
333
|
{ pattern: /https?:\/\/(?:www\.)?meipai\.com\/media\/\d{10,}[^\s]*/gi, type: 'meipai' },
|
|
322
334
|
{ pattern: /https?:\/\/twitter\.com\/\w+\/status\/\d{10,}[^\s]*/gi, type: 'twitter' },
|
|
323
335
|
{ pattern: /https?:\/\/x\.com\/\w+\/status\/\d{10,}[^\s]*/gi, type: 'twitter' },
|
|
324
|
-
{ pattern: /https?:\/\/(?:www\.)?instagram\.com\/p\/[0-9a-zA-Z_
|
|
336
|
+
{ pattern: /https?:\/\/(?:www\.)?instagram\.com\/p\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'instagram' },
|
|
337
|
+
{ pattern: /https?:\/\/(?:www\.)?instagram\.com\/reel\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'instagram' },
|
|
338
|
+
{ pattern: /https?:\/\/(?:www\.)?instagram\.com\/share\/(?:reel|p)\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'instagram' },
|
|
325
339
|
{ pattern: /https?:\/\/(?:www\.)?doubao\.com\/video\/\d{10,}[^\s]*/gi, type: 'doubao' },
|
|
326
340
|
{ pattern: /https?:\/\/(?:www\.)?doubao\.com\/video-sharing\?[^\s]*/gi, type: 'doubao' },
|
|
327
341
|
{ pattern: /https?:\/\/(?:www\.)?doubao\.com\/thread\/[^\s]+/gi, type: 'doubao_image' },
|
|
328
|
-
{ pattern: /https?:\/\/(?:www\.)?
|
|
329
|
-
{ pattern: /https?:\/\/
|
|
330
|
-
{ pattern: /https?:\/\/
|
|
342
|
+
{ pattern: /https?:\/\/(?:www\.)?jimeng\.jianying\.com\/[^\s]*/gi, type: 'jimeng' },
|
|
343
|
+
{ pattern: /https?:\/\/(?:www\.)?jimeng\.cn\/[^\s]*/gi, type: 'jimeng' },
|
|
344
|
+
{ pattern: /https?:\/\/(?:www\.)?dreamina\.jianying\.com\/[^\s]*/gi, type: 'jimeng' },
|
|
345
|
+
{ pattern: /https?:\/\/(?:www\.)?dreamina\.capcut\.com\/[^\s]*/gi, type: 'jimeng' },
|
|
346
|
+
{ pattern: /https?:\/\/(?:www\.)?oasis\.weibo\.com\/v\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'oasis' },
|
|
347
|
+
{ pattern: /https?:\/\/channels\.weixin\.qq\.com\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'wechat_channel' },
|
|
348
|
+
{ pattern: /https?:\/\/weixin\.qq\.com\/sph\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'wechat_channel' },
|
|
331
349
|
{ pattern: /https?:\/\/(?:www\.)?pearvideo\.com\/video_\d+[^\s]*/gi, type: 'lishi' },
|
|
332
|
-
{ pattern: /https?:\/\/video\.li\/[0-9a-zA-Z_
|
|
333
|
-
{ pattern: /https?:\/\/(?:www\.)?quanmin\.tv
|
|
334
|
-
{ pattern: /https?:\/\/(?:www\.)?quanmintv\.cn
|
|
350
|
+
{ pattern: /https?:\/\/video\.li\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'lishi' },
|
|
351
|
+
{ pattern: /https?:\/\/(?:www\.)?quanmin\.tv\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'quanmin' },
|
|
352
|
+
{ pattern: /https?:\/\/(?:www\.)?quanmintv\.cn\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'quanmin' },
|
|
335
353
|
{ pattern: /https?:\/\/h5\.pipigx\.com\/pp\/post\/\d+[^\s]*/gi, type: 'pipigx' },
|
|
336
|
-
{ pattern: /https?:\/\/(?:www\.)?ippzone\.com
|
|
337
|
-
{ pattern: /https?:\/\/(?:h5|www)\.pipix\.com
|
|
338
|
-
{ pattern: /https?:\/\/(?:www\.)?pipixia\.com
|
|
354
|
+
{ pattern: /https?:\/\/(?:www\.)?ippzone\.com\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'pipigx' },
|
|
355
|
+
{ pattern: /https?:\/\/(?:h5|www)\.pipix\.com\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'pipixia' },
|
|
356
|
+
{ pattern: /https?:\/\/(?:www\.)?pipixia\.com\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'pipixia' },
|
|
339
357
|
{ pattern: /https?:\/\/share\.xiaochuankeji\.cn\/hybrid\/share\/post\?pid=\d+[^\s]*/gi, type: 'zuiyou' },
|
|
340
|
-
{ pattern: /https?:\/\/(?:h5|www)\.izuiyou\.com
|
|
358
|
+
{ pattern: /https?:\/\/(?:h5|www)\.izuiyou\.com\/[0-9a-zA-Z_\/-]+[^\s]*/gi, type: 'zuiyou' },
|
|
341
359
|
];
|
|
342
360
|
function buildCustomLinkRules(customPlatforms) {
|
|
343
361
|
if (!Array.isArray(customPlatforms) || customPlatforms.length === 0)
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
## 项目介绍 (Project Introduction)
|
|
4
4
|
|
|
5
5
|
### 中文
|
|
6
|
-
这是一个为 Koishi 机器人框架开发的**全平台视频/图集解析插件**,使用统一API接口,支持自动识别并解析抖音、快手、B
|
|
6
|
+
这是一个为 Koishi 机器人框架开发的**全平台视频/图集解析插件**,使用统一API接口,支持自动识别并解析抖音、快手、B站、小红书、微博、西瓜视频、YouTube、TikTok、AcFun(A站)、知乎、微视、虎牙、好看视频、美拍、Twitter/X、Instagram、豆包(视频/图集)、**即梦(AI视频/图片)**、绿洲、视频号、梨视频、全民直播、皮皮搞笑、皮皮虾、最右等**20+主流平台**的短视频/图集/实况链接。
|
|
7
7
|
|
|
8
8
|
### English
|
|
9
|
-
This is a **multi-platform video/image parsing plugin** developed for the Koishi bot framework, using a unified API interface to automatically recognize and parse short video/image/live photo links from 20+ mainstream platforms such as Douyin, Kuaishou, Bilibili, Xiaohongshu, Weibo, YouTube, TikTok,
|
|
9
|
+
This is a **multi-platform video/image parsing plugin** developed for the Koishi bot framework, using a unified API interface to automatically recognize and parse short video/image/live photo links from **20+ mainstream platforms** such as Douyin, Kuaishou, Bilibili, Xiaohongshu, Weibo, Xigua, YouTube, TikTok, AcFun, Zhihu, Weishi, Huya, Haokan, Meipai, Twitter/X, Instagram, Doubao (video/images), **Jimeng (AI video/image)**, Oasis, WeChat Channels, Lishi, Quanmin, Pipigx, Pipixia, Zuiyou and more.
|
|
10
10
|
|
|
11
11
|
## 项目仓库 (Repository)
|
|
12
12
|
- GitHub: `https://github.com/Minecraft-1314/koishi-plugin-video-parser-all`
|
|
@@ -143,34 +143,38 @@ This is a **multi-platform video/image parsing plugin** developed for the Koishi
|
|
|
143
143
|
若启用 `downloadEngine: 'downloads'`,请安装可选依赖 `koishi-plugin-downloads`,失败时回退到内置下载。
|
|
144
144
|
|
|
145
145
|
## 支持的平台 (Supported Platforms)
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
|
150
|
-
|
|
151
|
-
|
|
|
152
|
-
|
|
|
153
|
-
|
|
|
154
|
-
|
|
|
155
|
-
|
|
|
156
|
-
|
|
|
157
|
-
|
|
|
158
|
-
|
|
|
159
|
-
|
|
|
160
|
-
|
|
|
161
|
-
|
|
|
162
|
-
|
|
|
163
|
-
|
|
|
164
|
-
|
|
|
165
|
-
|
|
|
166
|
-
|
|
|
167
|
-
|
|
|
168
|
-
|
|
|
169
|
-
|
|
|
170
|
-
|
|
|
171
|
-
|
|
|
172
|
-
|
|
|
173
|
-
|
|
|
146
|
+
|
|
147
|
+
> 以下为插件内置链接匹配规则,可根据用户发送的链接自动识别。所有匹配规则同时支持 HTTP 和 HTTPS 协议,并兼容多级路径(如短链后带 `/` 子路径)。
|
|
148
|
+
|
|
149
|
+
| 平台名称 | 关键词识别(匹配的域名/路径模式) | 解析能力 |
|
|
150
|
+
|----------|----------------------------------|----------|
|
|
151
|
+
| 哔哩哔哩 (B站) | `bilibili.com/video/`, `b23.tv`, `bili*.cn`, `b23.wtf`, `bili2233.cn` | 视频 |
|
|
152
|
+
| 抖音 | `douyin.com/video/`, `v.douyin.com` | 短视频、图集、实况 |
|
|
153
|
+
| 快手 | `kuaishou.com/short-video/`, `v.kuaishou.com`, `kuaishou.com/f/` | 短视频、图集 |
|
|
154
|
+
| 小红书 | `xiaohongshu.com/discovery/item/`, `xhslink.com`(含多级路径), `xiaohongshu.com/explore/`, `xiaohongshu.com/board/` | 图文、视频 |
|
|
155
|
+
| 微博 | `weibo.com/数字/`, `video.weibo.com/show`, `t.cn`, `m.weibo.cn` | 视频、图集 |
|
|
156
|
+
| 西瓜视频 | `ixigua.com` | 短视频 |
|
|
157
|
+
| YouTube | `youtube.com/watch`, `youtu.be`, `youtube.com/shorts/` | 视频 |
|
|
158
|
+
| TikTok | `tiktok.com/@/video/`, `vm.tiktok.com`, `vt.tiktok.com` | 短视频 |
|
|
159
|
+
| AcFun(A站) | `acfun.cn/v/ac` | 视频 |
|
|
160
|
+
| 知乎 | `zhihu.com/video/`, `zhihu.com/question/xxx/answer/xxx`, `zhuanlan.zhihu.com/p/`, `zhihu.com/zvideo/` | 视频、回答中的视频 |
|
|
161
|
+
| 微视 | `weishi.qq.com/weishi/feed/` | 短视频 |
|
|
162
|
+
| 虎牙 | `huya.com/video/` | 直播回放、视频 |
|
|
163
|
+
| 好看视频 | `haokan.baidu.com/v?vid=` | 短视频 |
|
|
164
|
+
| 美拍 | `meipai.com/media/` | 短视频 |
|
|
165
|
+
| Twitter / X | `twitter.com/用户名/status/`, `x.com/用户名/status/` | 视频、图文 |
|
|
166
|
+
| Instagram | `instagram.com/p/`, `instagram.com/reel/`, `instagram.com/share/` | 图文、Reels |
|
|
167
|
+
| 豆包(视频) | `doubao.com/video/`, `doubao.com/video-sharing` | 视频 |
|
|
168
|
+
| 豆包(图集) | `doubao.com/thread/` | 图文 |
|
|
169
|
+
| **即梦 (Jimeng)** | `jimeng.jianying.com`, `jimeng.cn`, `dreamina.jianying.com`, `dreamina.capcut.com` | AI视频、AI图片 |
|
|
170
|
+
| 绿洲 (Oasis) | `oasis.weibo.com/v/` | 视频、图文 |
|
|
171
|
+
| 视频号 (WeChat Channels) | `channels.weixin.qq.com`, `weixin.qq.com/sph/` | 短视频 |
|
|
172
|
+
| 梨视频 | `pearvideo.com/video_`, `video.li` | 短视频 |
|
|
173
|
+
| 全民直播 | `quanmin.tv`, `quanmintv.cn` | 直播 |
|
|
174
|
+
| 皮皮搞笑 | `h5.pipigx.com/pp/post/`, `ippzone.com` | 短视频 |
|
|
175
|
+
| 皮皮虾 | `pipix.com`, `pipixia.com` | 短视频 |
|
|
176
|
+
| 最右 | `share.xiaochuankeji.cn/hybrid/share/post`, `izuiyou.com` | 短视频 |
|
|
177
|
+
| 🔧 自定义平台 | 通过 `customPlatforms` 配置添加 | 取决于提供的 API |
|
|
174
178
|
|
|
175
179
|
## 项目贡献者 (Contributors)
|
|
176
180
|
|