koishi-plugin-video-parser-all 1.3.4 → 1.3.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.d.ts +166 -20
- package/lib/index.js +457 -272
- package/package.json +19 -5
- package/readme.md +80 -59
package/lib/index.d.ts
CHANGED
|
@@ -1,10 +1,43 @@
|
|
|
1
1
|
import { Context, Schema } from 'koishi';
|
|
2
|
+
declare module 'koishi' {
|
|
3
|
+
interface Context {
|
|
4
|
+
downloads?: {
|
|
5
|
+
download(url: string, dest: string, options?: Record<string, unknown>): Promise<string>;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
}
|
|
2
9
|
export declare const name = "video-parser-all";
|
|
3
10
|
export declare const Config: Schema<{
|
|
4
11
|
enable?: boolean | null | undefined;
|
|
5
12
|
botName?: string | null | undefined;
|
|
6
13
|
showWaitingTip?: boolean | null | undefined;
|
|
7
14
|
debug?: boolean | null | undefined;
|
|
15
|
+
platformEnabled?: ({
|
|
16
|
+
bilibili?: boolean | null | undefined;
|
|
17
|
+
douyin?: boolean | null | undefined;
|
|
18
|
+
kuaishou?: boolean | null | undefined;
|
|
19
|
+
xiaohongshu?: boolean | null | undefined;
|
|
20
|
+
weibo?: boolean | null | undefined;
|
|
21
|
+
xigua?: boolean | null | undefined;
|
|
22
|
+
youtube?: boolean | null | undefined;
|
|
23
|
+
tiktok?: boolean | null | undefined;
|
|
24
|
+
acfun?: boolean | null | undefined;
|
|
25
|
+
zhihu?: boolean | null | undefined;
|
|
26
|
+
weishi?: boolean | null | undefined;
|
|
27
|
+
huya?: boolean | null | undefined;
|
|
28
|
+
haokan?: boolean | null | undefined;
|
|
29
|
+
meipai?: boolean | null | undefined;
|
|
30
|
+
twitter?: boolean | null | undefined;
|
|
31
|
+
instagram?: boolean | null | undefined;
|
|
32
|
+
doubao?: boolean | null | undefined;
|
|
33
|
+
oasis?: boolean | null | undefined;
|
|
34
|
+
wechat_channel?: boolean | null | undefined;
|
|
35
|
+
lishi?: boolean | null | undefined;
|
|
36
|
+
quanmin?: boolean | null | undefined;
|
|
37
|
+
pipigx?: boolean | null | undefined;
|
|
38
|
+
pipixia?: boolean | null | undefined;
|
|
39
|
+
zuiyou?: boolean | null | undefined;
|
|
40
|
+
} & import("cosmokit").Dict) | null | undefined;
|
|
8
41
|
} & import("cosmokit").Dict & {
|
|
9
42
|
unifiedMessageFormat?: string | null | undefined;
|
|
10
43
|
} & {
|
|
@@ -12,17 +45,24 @@ export declare const Config: Schema<{
|
|
|
12
45
|
showCoverImage?: boolean | null | undefined;
|
|
13
46
|
showMusicCover?: boolean | null | undefined;
|
|
14
47
|
showImageFile?: boolean | null | undefined;
|
|
15
|
-
forceDownloadImage?: boolean | null | undefined;
|
|
16
|
-
imageDownloadTimeout?: number | null | undefined;
|
|
17
|
-
imageTempDir?: string | null | undefined;
|
|
18
|
-
maxImageSize?: number | null | undefined;
|
|
19
48
|
showVideoFile?: boolean | null | undefined;
|
|
49
|
+
forceDownloadImage?: boolean | null | undefined;
|
|
20
50
|
forceDownloadVideo?: boolean | null | undefined;
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
51
|
+
} & {
|
|
52
|
+
showMusicVoice?: boolean | null | undefined;
|
|
53
|
+
showMusicVoiceFile?: boolean | null | undefined;
|
|
54
|
+
forceDownloadMusicVoice?: boolean | null | undefined;
|
|
55
|
+
} & {
|
|
24
56
|
maxDescLength?: number | null | undefined;
|
|
25
57
|
maxConcurrent?: number | null | undefined;
|
|
58
|
+
downloadConcurrency?: number | null | undefined;
|
|
59
|
+
mediaDownloadTimeout?: number | null | undefined;
|
|
60
|
+
maxMediaSize?: number | null | undefined;
|
|
61
|
+
downloadEngine?: "internal" | "aria2" | null | undefined;
|
|
62
|
+
aria2Host?: string | null | undefined;
|
|
63
|
+
aria2Port?: number | null | undefined;
|
|
64
|
+
aria2Secret?: string | null | undefined;
|
|
65
|
+
resumeDownload?: boolean | null | undefined;
|
|
26
66
|
} & {
|
|
27
67
|
timeout?: number | null | undefined;
|
|
28
68
|
videoSendTimeout?: number | null | undefined;
|
|
@@ -45,14 +85,19 @@ export declare const Config: Schema<{
|
|
|
45
85
|
ignoreSendError?: boolean | null | undefined;
|
|
46
86
|
retryTimes?: number | null | undefined;
|
|
47
87
|
retryInterval?: number | null | undefined;
|
|
48
|
-
} & {
|
|
49
88
|
enableForward?: boolean | null | undefined;
|
|
50
89
|
} & {
|
|
51
90
|
deduplicationInterval?: number | null | undefined;
|
|
52
91
|
cacheTTL?: number | null | undefined;
|
|
92
|
+
cacheDir?: string | null | undefined;
|
|
53
93
|
} & {
|
|
54
94
|
primaryApiUrl?: string | null | undefined;
|
|
55
95
|
backupApiUrl?: string | null | undefined;
|
|
96
|
+
apiKeys?: ({
|
|
97
|
+
key?: string | null | undefined;
|
|
98
|
+
weight?: number | null | undefined;
|
|
99
|
+
} & import("cosmokit").Dict)[] | null | undefined;
|
|
100
|
+
rotationMode?: "sequential" | "load_balance" | null | undefined;
|
|
56
101
|
platformDedicatedFirst?: ({
|
|
57
102
|
bilibili?: boolean | null | undefined;
|
|
58
103
|
douyin?: boolean | null | undefined;
|
|
@@ -71,18 +116,42 @@ export declare const Config: Schema<{
|
|
|
71
116
|
twitter?: boolean | null | undefined;
|
|
72
117
|
instagram?: boolean | null | undefined;
|
|
73
118
|
doubao?: boolean | null | undefined;
|
|
74
|
-
doubao_chat?: boolean | null | undefined;
|
|
75
119
|
oasis?: boolean | null | undefined;
|
|
76
120
|
wechat_channel?: boolean | null | undefined;
|
|
121
|
+
lishi?: boolean | null | undefined;
|
|
122
|
+
quanmin?: boolean | null | undefined;
|
|
123
|
+
pipigx?: boolean | null | undefined;
|
|
124
|
+
pipixia?: boolean | null | undefined;
|
|
125
|
+
zuiyou?: boolean | null | undefined;
|
|
77
126
|
} & import("cosmokit").Dict) | null | undefined;
|
|
78
127
|
customApis?: ({
|
|
79
|
-
platform?: "bilibili" | "douyin" | "kuaishou" | "xiaohongshu" | "weibo" | "xigua" | "youtube" | "tiktok" | "acfun" | "zhihu" | "weishi" | "huya" | "haokan" | "meipai" | "twitter" | "instagram" | "doubao" | "
|
|
128
|
+
platform?: "bilibili" | "douyin" | "kuaishou" | "xiaohongshu" | "weibo" | "xigua" | "youtube" | "tiktok" | "acfun" | "zhihu" | "weishi" | "huya" | "haokan" | "meipai" | "twitter" | "instagram" | "doubao" | "oasis" | "wechat_channel" | null | undefined;
|
|
80
129
|
apiUrl?: string | null | undefined;
|
|
81
130
|
apiKey?: string | null | undefined;
|
|
82
131
|
authHeaderType?: "Bearer" | "X-API-Key" | "Custom" | null | undefined;
|
|
83
132
|
customHeaderName?: string | null | undefined;
|
|
84
133
|
fieldMapping?: string | null | undefined;
|
|
85
134
|
} & import("cosmokit").Dict)[] | null | undefined;
|
|
135
|
+
customPlatforms?: ({
|
|
136
|
+
name?: string | null | undefined;
|
|
137
|
+
exampleUrl?: string | null | undefined;
|
|
138
|
+
keywords?: string | null | undefined;
|
|
139
|
+
apiUrl?: string | null | undefined;
|
|
140
|
+
apiKey?: string | null | undefined;
|
|
141
|
+
authHeaderType?: "Bearer" | "X-API-Key" | "Custom" | null | undefined;
|
|
142
|
+
customHeaderName?: string | null | undefined;
|
|
143
|
+
fieldMapping?: string | null | undefined;
|
|
144
|
+
proxy?: ({
|
|
145
|
+
enabled?: boolean | null | undefined;
|
|
146
|
+
protocol?: "http" | "https" | null | undefined;
|
|
147
|
+
host?: string | null | undefined;
|
|
148
|
+
port?: number | null | undefined;
|
|
149
|
+
auth?: ({
|
|
150
|
+
username?: string | null | undefined;
|
|
151
|
+
password?: string | null | undefined;
|
|
152
|
+
} & import("cosmokit").Dict) | null | undefined;
|
|
153
|
+
} & import("cosmokit").Dict) | null | undefined;
|
|
154
|
+
} & import("cosmokit").Dict)[] | null | undefined;
|
|
86
155
|
globalFieldMapping?: string | null | undefined;
|
|
87
156
|
} & {
|
|
88
157
|
waitingTipText?: string | null | undefined;
|
|
@@ -95,6 +164,32 @@ export declare const Config: Schema<{
|
|
|
95
164
|
botName: string;
|
|
96
165
|
showWaitingTip: boolean;
|
|
97
166
|
debug: boolean;
|
|
167
|
+
platformEnabled: Schemastery.ObjectT<{
|
|
168
|
+
bilibili: Schema<boolean, boolean>;
|
|
169
|
+
douyin: Schema<boolean, boolean>;
|
|
170
|
+
kuaishou: Schema<boolean, boolean>;
|
|
171
|
+
xiaohongshu: Schema<boolean, boolean>;
|
|
172
|
+
weibo: Schema<boolean, boolean>;
|
|
173
|
+
xigua: Schema<boolean, boolean>;
|
|
174
|
+
youtube: Schema<boolean, boolean>;
|
|
175
|
+
tiktok: Schema<boolean, boolean>;
|
|
176
|
+
acfun: Schema<boolean, boolean>;
|
|
177
|
+
zhihu: Schema<boolean, boolean>;
|
|
178
|
+
weishi: Schema<boolean, boolean>;
|
|
179
|
+
huya: Schema<boolean, boolean>;
|
|
180
|
+
haokan: Schema<boolean, boolean>;
|
|
181
|
+
meipai: Schema<boolean, boolean>;
|
|
182
|
+
twitter: Schema<boolean, boolean>;
|
|
183
|
+
instagram: Schema<boolean, boolean>;
|
|
184
|
+
doubao: Schema<boolean, boolean>;
|
|
185
|
+
oasis: Schema<boolean, boolean>;
|
|
186
|
+
wechat_channel: Schema<boolean, boolean>;
|
|
187
|
+
lishi: Schema<boolean, boolean>;
|
|
188
|
+
quanmin: Schema<boolean, boolean>;
|
|
189
|
+
pipigx: Schema<boolean, boolean>;
|
|
190
|
+
pipixia: Schema<boolean, boolean>;
|
|
191
|
+
zuiyou: Schema<boolean, boolean>;
|
|
192
|
+
}>;
|
|
98
193
|
} & import("cosmokit").Dict & {
|
|
99
194
|
unifiedMessageFormat: string;
|
|
100
195
|
} & {
|
|
@@ -102,17 +197,24 @@ export declare const Config: Schema<{
|
|
|
102
197
|
showCoverImage: boolean;
|
|
103
198
|
showMusicCover: boolean;
|
|
104
199
|
showImageFile: boolean;
|
|
105
|
-
forceDownloadImage: boolean;
|
|
106
|
-
imageDownloadTimeout: number;
|
|
107
|
-
imageTempDir: string;
|
|
108
|
-
maxImageSize: number;
|
|
109
200
|
showVideoFile: boolean;
|
|
201
|
+
forceDownloadImage: boolean;
|
|
110
202
|
forceDownloadVideo: boolean;
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
203
|
+
} & {
|
|
204
|
+
showMusicVoice: boolean;
|
|
205
|
+
showMusicVoiceFile: boolean;
|
|
206
|
+
forceDownloadMusicVoice: boolean;
|
|
207
|
+
} & {
|
|
114
208
|
maxDescLength: number;
|
|
115
209
|
maxConcurrent: number;
|
|
210
|
+
downloadConcurrency: number;
|
|
211
|
+
mediaDownloadTimeout: number;
|
|
212
|
+
maxMediaSize: number;
|
|
213
|
+
downloadEngine: "internal" | "aria2";
|
|
214
|
+
aria2Host: string;
|
|
215
|
+
aria2Port: number;
|
|
216
|
+
aria2Secret: string;
|
|
217
|
+
resumeDownload: boolean;
|
|
116
218
|
} & {
|
|
117
219
|
timeout: number;
|
|
118
220
|
videoSendTimeout: number;
|
|
@@ -138,14 +240,19 @@ export declare const Config: Schema<{
|
|
|
138
240
|
ignoreSendError: boolean;
|
|
139
241
|
retryTimes: number;
|
|
140
242
|
retryInterval: number;
|
|
141
|
-
} & {
|
|
142
243
|
enableForward: boolean;
|
|
143
244
|
} & {
|
|
144
245
|
deduplicationInterval: number;
|
|
145
246
|
cacheTTL: number;
|
|
247
|
+
cacheDir: string;
|
|
146
248
|
} & {
|
|
147
249
|
primaryApiUrl: string;
|
|
148
250
|
backupApiUrl: string;
|
|
251
|
+
apiKeys: Schemastery.ObjectT<{
|
|
252
|
+
key: Schema<string, string>;
|
|
253
|
+
weight: Schema<number, number>;
|
|
254
|
+
}>[];
|
|
255
|
+
rotationMode: "sequential" | "load_balance";
|
|
149
256
|
platformDedicatedFirst: Schemastery.ObjectT<{
|
|
150
257
|
bilibili: Schema<boolean, boolean>;
|
|
151
258
|
douyin: Schema<boolean, boolean>;
|
|
@@ -164,18 +271,57 @@ export declare const Config: Schema<{
|
|
|
164
271
|
twitter: Schema<boolean, boolean>;
|
|
165
272
|
instagram: Schema<boolean, boolean>;
|
|
166
273
|
doubao: Schema<boolean, boolean>;
|
|
167
|
-
doubao_chat: Schema<boolean, boolean>;
|
|
168
274
|
oasis: Schema<boolean, boolean>;
|
|
169
275
|
wechat_channel: Schema<boolean, boolean>;
|
|
276
|
+
lishi: Schema<boolean, boolean>;
|
|
277
|
+
quanmin: Schema<boolean, boolean>;
|
|
278
|
+
pipigx: Schema<boolean, boolean>;
|
|
279
|
+
pipixia: Schema<boolean, boolean>;
|
|
280
|
+
zuiyou: Schema<boolean, boolean>;
|
|
170
281
|
}>;
|
|
171
282
|
customApis: Schemastery.ObjectT<{
|
|
172
|
-
platform: Schema<"bilibili" | "douyin" | "kuaishou" | "xiaohongshu" | "weibo" | "xigua" | "youtube" | "tiktok" | "acfun" | "zhihu" | "weishi" | "huya" | "haokan" | "meipai" | "twitter" | "instagram" | "doubao" | "
|
|
283
|
+
platform: Schema<"bilibili" | "douyin" | "kuaishou" | "xiaohongshu" | "weibo" | "xigua" | "youtube" | "tiktok" | "acfun" | "zhihu" | "weishi" | "huya" | "haokan" | "meipai" | "twitter" | "instagram" | "doubao" | "oasis" | "wechat_channel", "bilibili" | "douyin" | "kuaishou" | "xiaohongshu" | "weibo" | "xigua" | "youtube" | "tiktok" | "acfun" | "zhihu" | "weishi" | "huya" | "haokan" | "meipai" | "twitter" | "instagram" | "doubao" | "oasis" | "wechat_channel">;
|
|
173
284
|
apiUrl: Schema<string, string>;
|
|
174
285
|
apiKey: Schema<string, string>;
|
|
175
286
|
authHeaderType: Schema<"Bearer" | "X-API-Key" | "Custom", "Bearer" | "X-API-Key" | "Custom">;
|
|
176
287
|
customHeaderName: Schema<string, string>;
|
|
177
288
|
fieldMapping: Schema<string, string>;
|
|
178
289
|
}>[];
|
|
290
|
+
customPlatforms: Schemastery.ObjectT<{
|
|
291
|
+
name: Schema<string, string>;
|
|
292
|
+
exampleUrl: Schema<string, string>;
|
|
293
|
+
keywords: Schema<string, string>;
|
|
294
|
+
apiUrl: Schema<string, string>;
|
|
295
|
+
apiKey: Schema<string, string>;
|
|
296
|
+
authHeaderType: Schema<"Bearer" | "X-API-Key" | "Custom", "Bearer" | "X-API-Key" | "Custom">;
|
|
297
|
+
customHeaderName: Schema<string, string>;
|
|
298
|
+
fieldMapping: Schema<string, string>;
|
|
299
|
+
proxy: Schema<Schemastery.ObjectS<{
|
|
300
|
+
enabled: Schema<boolean, boolean>;
|
|
301
|
+
protocol: Schema<"http" | "https", "http" | "https">;
|
|
302
|
+
host: Schema<string, string>;
|
|
303
|
+
port: Schema<number, number>;
|
|
304
|
+
auth: Schema<Schemastery.ObjectS<{
|
|
305
|
+
username: Schema<string, string>;
|
|
306
|
+
password: Schema<string, string>;
|
|
307
|
+
}>, Schemastery.ObjectT<{
|
|
308
|
+
username: Schema<string, string>;
|
|
309
|
+
password: Schema<string, string>;
|
|
310
|
+
}>>;
|
|
311
|
+
}>, Schemastery.ObjectT<{
|
|
312
|
+
enabled: Schema<boolean, boolean>;
|
|
313
|
+
protocol: Schema<"http" | "https", "http" | "https">;
|
|
314
|
+
host: Schema<string, string>;
|
|
315
|
+
port: Schema<number, number>;
|
|
316
|
+
auth: Schema<Schemastery.ObjectS<{
|
|
317
|
+
username: Schema<string, string>;
|
|
318
|
+
password: Schema<string, string>;
|
|
319
|
+
}>, Schemastery.ObjectT<{
|
|
320
|
+
username: Schema<string, string>;
|
|
321
|
+
password: Schema<string, string>;
|
|
322
|
+
}>>;
|
|
323
|
+
}>>;
|
|
324
|
+
}>[];
|
|
179
325
|
globalFieldMapping: string;
|
|
180
326
|
} & {
|
|
181
327
|
waitingTipText: string;
|