koishi-plugin-video-parser-all 0.7.5 → 0.7.6
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 +5 -31
- package/package.json +2 -3
- package/readme.md +1 -2
package/lib/index.js
CHANGED
|
@@ -31,18 +31,7 @@ exports.Config = koishi_1.Schema.intersect([
|
|
|
31
31
|
收藏:${'${收藏数}'}
|
|
32
32
|
转发:${'${转发数}'}
|
|
33
33
|
播放:${'${播放数}'}
|
|
34
|
-
评论:${'${评论数}'}
|
|
35
|
-
IP属地:${'${IP属地}'}
|
|
36
|
-
发布时间:${'${发布时间}'}
|
|
37
|
-
粉丝数:${'${粉丝数}'}
|
|
38
|
-
在线人数:${'${在线人数}'}
|
|
39
|
-
关注数:${'${关注数}'}
|
|
40
|
-
文件大小:${'${文件大小}'}
|
|
41
|
-
直播间地址:${'${直播间地址}'}
|
|
42
|
-
直播间ID:${'${直播间ID}'}
|
|
43
|
-
直播间状态:${'${直播间状态}'}
|
|
44
|
-
图片数量:${'${图片数量}'}
|
|
45
|
-
作者ID:${'${作者ID}'}`).description('统一消息格式'),
|
|
34
|
+
评论:${'${评论数}'}`).description('统一消息格式'),
|
|
46
35
|
}).description('统一消息格式'),
|
|
47
36
|
koishi_1.Schema.object({
|
|
48
37
|
showImageText: koishi_1.Schema.boolean().default(true).description('显示图文内容'),
|
|
@@ -80,7 +69,6 @@ const logger = new koishi_1.Logger(exports.name);
|
|
|
80
69
|
const PLATFORM_KEYWORDS = {
|
|
81
70
|
bilibili: ['bilibili', 'b23', 'B站', 'www.bilibili.com', 'm.bilibili.com', '哔哩哔哩', 'bilibili.com/opus', 'bilibili.com/video', 'b23.tv', 't.bilibili.com', 'bilibili.com/bangumi'],
|
|
82
71
|
kuaishou: ['kuaishou', '快手', 'v.kuaishou.com', 'www.kuaishou.com', 'kwimgs.com', 'kuaishou.com/app'],
|
|
83
|
-
xiaohongshu: ['xiaohongshu', '小红书', 'xhslink.com', 'xiaohongshu.com', 'xhscdn.com', 'xiaohongshu.com/explore', 'xhslink.com/', 'xiaohongshu.com/discovery/item'],
|
|
84
72
|
weibo: ['weibo', '微博', 'weibo.com', 'video.weibo.com', 'm.weibo.cn', 'weibo.com/tv/show', 'weibo.com/feed'],
|
|
85
73
|
toutiao: ['toutiao', '今日头条', 'm.toutiao.com', 'toutiao.com', 'ixigua.com', 'toutiao.com/video', 'ixigua.com/i'],
|
|
86
74
|
pipigx: ['pipigx', '皮皮搞笑', 'h5.pipigx.com', 'ippzone.com', 'pipigx.com/share'],
|
|
@@ -92,7 +80,6 @@ const API_CONFIG = {
|
|
|
92
80
|
bilibili: 'https://api.xingzhige.com/API/b_parse',
|
|
93
81
|
douyin: 'https://api.xingzhige.com/API/douyin/',
|
|
94
82
|
kuaishou: 'https://api.bugpk.com/api/ksjx',
|
|
95
|
-
xiaohongshu: 'https://api.bugpk.com/api/xhsjx',
|
|
96
83
|
weibo: 'https://api.bugpk.com/api/weibo',
|
|
97
84
|
toutiao: 'https://api.bugpk.com/api/toutiao',
|
|
98
85
|
pipigx: 'https://api.bugpk.com/api/pipigx',
|
|
@@ -264,8 +251,6 @@ function getPlatformType(url) {
|
|
|
264
251
|
return 'bilibili';
|
|
265
252
|
if (PLATFORM_KEYWORDS.kuaishou.some(k => lower.includes(k)))
|
|
266
253
|
return 'kuaishou';
|
|
267
|
-
if (PLATFORM_KEYWORDS.xiaohongshu.some(k => lower.includes(k)))
|
|
268
|
-
return 'xiaohongshu';
|
|
269
254
|
if (PLATFORM_KEYWORDS.weibo.some(k => lower.includes(k)))
|
|
270
255
|
return 'weibo';
|
|
271
256
|
if (PLATFORM_KEYWORDS.toutiao.some(k => lower.includes(k)))
|
|
@@ -284,9 +269,6 @@ function cleanUrl(url) {
|
|
|
284
269
|
try {
|
|
285
270
|
url = url.replace(/&/g, '&');
|
|
286
271
|
const urlObj = new URL(url);
|
|
287
|
-
if (urlObj.hostname.includes('xiaohongshu.com') || urlObj.hostname.includes('xhslink.com')) {
|
|
288
|
-
return urlObj.href;
|
|
289
|
-
}
|
|
290
272
|
if (urlObj.hostname.includes('douyin.com') || urlObj.hostname.includes('v.douyin.com')) {
|
|
291
273
|
urlObj.searchParams.delete('source');
|
|
292
274
|
urlObj.searchParams.delete('share_type');
|
|
@@ -601,18 +583,10 @@ function apply(ctx, config) {
|
|
|
601
583
|
for (let i = 0; i <= retryTimes; i++) {
|
|
602
584
|
try {
|
|
603
585
|
const params = { url };
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
});
|
|
609
|
-
}
|
|
610
|
-
else {
|
|
611
|
-
res = await http.get(API_CONFIG[platform], {
|
|
612
|
-
params,
|
|
613
|
-
timeout: config.timeout
|
|
614
|
-
});
|
|
615
|
-
}
|
|
586
|
+
const res = await http.get(API_CONFIG[platform], {
|
|
587
|
+
params,
|
|
588
|
+
timeout: config.timeout
|
|
589
|
+
});
|
|
616
590
|
return res.data;
|
|
617
591
|
}
|
|
618
592
|
catch (error) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "koishi-plugin-video-parser-all",
|
|
3
|
-
"description": "Koishi 全平台视频解析插件,支持抖音/快手/B
|
|
4
|
-
"version": "0.7.
|
|
3
|
+
"description": "Koishi 全平台视频解析插件,支持抖音/快手/B站/微博/今日头条/皮皮搞笑/皮皮虾/最右视频链接解析",
|
|
4
|
+
"version": "0.7.6",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"typings": "lib/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -26,7 +26,6 @@
|
|
|
26
26
|
"bv",
|
|
27
27
|
"douyin",
|
|
28
28
|
"kuaishou",
|
|
29
|
-
"xiaohongshu",
|
|
30
29
|
"weibo",
|
|
31
30
|
"toutiao",
|
|
32
31
|
"pipigx",
|
package/readme.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
## 项目介绍 (Project Introduction)
|
|
4
4
|
|
|
5
5
|
### 中文
|
|
6
|
-
这是一个为 Koishi 机器人框架开发的**多平台视频/图集解析插件**,支持自动识别并解析抖音、快手、B
|
|
6
|
+
这是一个为 Koishi 机器人框架开发的**多平台视频/图集解析插件**,支持自动识别并解析抖音、快手、B站、微博、今日头条、皮皮搞笑、皮皮虾、最右等主流平台的短视频/图集链接。核心特性:
|
|
7
7
|
- 🚀 自动识别多平台链接,无需手动指定平台
|
|
8
8
|
- 🎨 自定义解析结果格式,支持丰富的变量替换
|
|
9
9
|
- ⚡ 内置防重复解析、接口重试、自动缓存清理等实用功能
|
|
@@ -119,7 +119,6 @@ This is a **multi-platform video/image parsing plugin** developed for the Koishi
|
|
|
119
119
|
| 哔哩哔哩 (B站) | bilibili、b23、B站 | 视频、番剧、直播、图集 |
|
|
120
120
|
| 抖音 | douyin、v.douyin.com | 短视频、图集、直播 |
|
|
121
121
|
| 快手 | kuaishou、v.kuaishou.com | 短视频、图集 |
|
|
122
|
-
| 小红书 | xiaohongshu、xhslink.com | 笔记、图集、视频 |
|
|
123
122
|
| 微博 | weibo、video.weibo.com | 视频、图集 |
|
|
124
123
|
| 今日头条 | toutiao、ixigua.com | 短视频 |
|
|
125
124
|
| 皮皮搞笑 | pipigx、h5.pipigx.com | 短视频 |
|