@ikenxuan/amagi 4.5.2 → 5.0.0

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.
@@ -1,766 +0,0 @@
1
- import { L as DouyinMethodType, ar as TypeMode, as as ExtendedDouyinOptions, at as ApiResponse, au as ConditionalReturnType, D as DouyinDataOptionsMap, J as BilibiliMethodType, av as ExtendedBilibiliOptions, B as BilibiliDataOptionsMap, M as KuaishouMethodType, aw as ExtendedKuaishouOptions, K as KuaishouDataOptionsMap, a3 as DyVideoWork, X as DyImageAlbumWork, _ as DySlidesWork, a4 as DyWorkComments, a0 as DyUserInfo, V as DyEmojiList, W as DyEmojiProList, a2 as DyUserPostVideos, Y as DyMusicWork, $ as DySuggestWords, Z as DySearchInfo, a1 as DyUserLiveVideos, v as douyinSign, u as douyinApiUrls, ag as BiliOneWork, ak as BiliVideoPlayurlIsLogin, an as BiliBiliVideoPlayurlNoLogin, al as BiliWorkComments, aj as BiliUserProfile, ah as BiliUserDynamic, ab as BiliEmojiList, a6 as BiliBangumiVideoInfo, a7 as BiliBangumiVideoPlayurlIsLogin, am as BiliBangumiVideoPlayurlNoLogin, aa as BiliDynamicInfo, a9 as BiliDynamicCard, ad as BiliLiveRoomDetail, ac as BiliLiveRoomDef, af as BiliNewLoginQrcode, ae as BiliCheckQrcode, ai as BiliUserFullView, a5 as BiliAv2Bv, a8 as BiliBv2AV, w as wbi_sign, o as av2bv, p as bv2av, m as bilibiliApiUrls, ap as KsOneWork, aq as KsWorkComments, ao as KsEmojiList, A as kuaishouApiUrls, d as douyinUtils, e as bilibiliUtils, k as kuaishouUtils, ax as getDouyinData, ay as getBilibiliData, az as getKuaishouData } from './index-2b526zmm.js';
2
- export { U as APIErrorType, aA as BaseResponse, bb as BilibiliAv2BvParams, bp as BilibiliAv2BvParamsSchema, b4 as BilibiliBangumiInfoParams, bi as BilibiliBangumiInfoParamsSchema, b5 as BilibiliBangumiStreamParams, bj as BilibiliBangumiStreamParamsSchema, bc as BilibiliBv2AvParams, bq as BilibiliBv2AvParamsSchema, b1 as BilibiliCommentParams, bf as BilibiliCommentParamsSchema, b as BilibiliDataOptions, b6 as BilibiliDynamicParams, bk as BilibiliDynamicParamsSchema, b3 as BilibiliEmojiParams, bh as BilibiliEmojiParamsSchema, b7 as BilibiliLiveParams, bl as BilibiliLiveParamsSchema, b8 as BilibiliLoginParams, bm as BilibiliLoginParamsSchema, G as BilibiliMethodOptionsMap, b9 as BilibiliQrcodeParams, bn as BilibiliQrcodeParamsSchema, ba as BilibiliQrcodeStatusParams, bo as BilibiliQrcodeStatusParamsSchema, b2 as BilibiliUserParams, bg as BilibiliUserParamsSchema, P as BilibiliValidationSchemas, b0 as BilibiliVideoDownloadParams, be as BilibiliVideoDownloadParamsSchema, a$ as BilibiliVideoParams, bd as BilibiliVideoParamsSchema, t as BoundBilibiliApi, z as BoundDouyinApi, F as BoundKuaishouApi, aJ as DouyinCommentParams, aT as DouyinCommentParamsSchema, aL as DouyinCommentReplyParams, aV as DouyinCommentReplyParamsSchema, a as DouyinDataOptions, aQ as DouyinEmojiListParams, aZ as DouyinEmojiListParamsSchema, aR as DouyinEmojiProParams, a_ as DouyinEmojiProParamsSchema, aO as DouyinLiveRoomParams, H as DouyinMethodOptionsMap, aN as DouyinMusicParams, aX as DouyinMusicParamsSchema, aP as DouyinQrcodeParams, aY as DouyinQrcodeParamsSchema, aK as DouyinSearchParams, aU as DouyinSearchParamsSchema, aM as DouyinUserParams, aW as DouyinUserParamsSchema, Q as DouyinValidationSchemas, aI as DouyinWorkParams, aS as DouyinWorkParamsSchema, aC as ErrorResponse, bs as KuaishouCommentParams, bv as KuaishouCommentParamsSchema, c as KuaishouDataOptions, bt as KuaishouEmojiParams, bw as KuaishouEmojiParamsSchema, I as KuaishouMethodOptionsMap, R as KuaishouValidationSchemas, br as KuaishouVideoParams, bu as KuaishouVideoParamsSchema, N as Networks, O as NetworksConfigType, S as OmitMethodType, aB as SuccessResponse, T as TypeControl, r as bilibili, n as bilibiliErrorCodeMap, g as createBilibiliRoutes, s as createBoundBilibiliApi, y as createBoundDouyinApi, E as createBoundKuaishouApi, f as createDouyinRoutes, aH as createErrorResponse, h as createKuaishouRoutes, aG as createSuccessResponse, x as douyin, i as httpLogger, C as kuaishou, j as logMiddleware, l as logger, q as qtparam, aE as validateBilibiliParams, aD as validateDouyinParams, aF as validateKuaishouParams } from './index-2b526zmm.js';
3
- import * as express from 'express';
4
- import express__default from 'express';
5
- import { z } from 'zod';
6
- import 'chalk';
7
- import 'axios';
8
-
9
- /**
10
- * Cookie配置选项接口
11
- */
12
- type CookieOptions = {
13
- /** 抖音Cookie */
14
- douyin?: string;
15
- /** B站Cookie */
16
- bilibili?: string;
17
- /** 快手Cookie */
18
- kuaishou?: string;
19
- };
20
- /**
21
- * 创建Amagi客户端实例
22
- * @param options - Cookie配置选项
23
- * @returns 包含数据获取方法、服务器启动方法、绑定Cookie的平台工具集和API对象的对象
24
- */
25
- declare const createAmagiClient: (options?: CookieOptions) => {
26
- /** 启动本地HTTP服务 */
27
- startServer: (port?: number) => express__default.Application;
28
- /** @deprecated 此方法已废弃,请使用 startServer 方法代替 */
29
- startClient: (port?: number) => express__default.Application;
30
- getDouyinData: <T extends DouyinMethodType, M extends TypeMode>(methodType: T, options?: ExtendedDouyinOptions<T> & {
31
- typeMode?: M;
32
- }) => Promise<ApiResponse<ConditionalReturnType<DouyinDataOptionsMap[T]["data"], M>>>;
33
- getBilibiliData: <T extends BilibiliMethodType, M extends TypeMode>(methodType: T, options?: ExtendedBilibiliOptions<T> & {
34
- typeMode?: M;
35
- }) => Promise<ApiResponse<ConditionalReturnType<BilibiliDataOptionsMap[T]["data"], M>>>;
36
- getKuaishouData: <T extends KuaishouMethodType, M extends TypeMode>(methodType: T, options?: ExtendedKuaishouOptions<T> & {
37
- typeMode?: M;
38
- }) => Promise<ApiResponse<ConditionalReturnType<KuaishouDataOptionsMap[T]["data"], M>>>;
39
- douyin: {
40
- /** 绑定了cookie的抖音API对象,调用时不需要传递cookie */
41
- api: {
42
- getWorkInfo: <M extends TypeMode>(options: Omit<{
43
- methodType: "\u89C6\u9891\u4F5C\u54C1\u6570\u636E" | "\u56FE\u96C6\u4F5C\u54C1\u6570\u636E" | "\u5408\u8F91\u4F5C\u54C1\u6570\u636E" | "\u805A\u5408\u89E3\u6790";
44
- aweme_id: string;
45
- }, "methodType"> & {
46
- typeMode?: TypeMode;
47
- } & {
48
- typeMode?: M | undefined;
49
- }) => Promise<ApiResponse<ConditionalReturnType<DyVideoWork | DyImageAlbumWork | DySlidesWork, M>>>;
50
- getVideoWorkInfo: <M extends TypeMode>(options: Omit<{
51
- methodType: "\u89C6\u9891\u4F5C\u54C1\u6570\u636E";
52
- aweme_id: string;
53
- }, "methodType"> & {
54
- typeMode?: TypeMode;
55
- } & {
56
- typeMode?: M | undefined;
57
- }) => Promise<ApiResponse<ConditionalReturnType<DyVideoWork, M>>>;
58
- getImageAlbumWorkInfo: <M extends TypeMode>(options: Omit<{
59
- methodType: "\u56FE\u96C6\u4F5C\u54C1\u6570\u636E";
60
- aweme_id: string;
61
- }, "methodType"> & {
62
- typeMode?: TypeMode;
63
- } & {
64
- typeMode?: M | undefined;
65
- }) => Promise<ApiResponse<ConditionalReturnType<DyImageAlbumWork, M>>>;
66
- getSlidesWorkInfo: <M extends TypeMode>(options: Omit<{
67
- methodType: "\u5408\u8F91\u4F5C\u54C1\u6570\u636E";
68
- aweme_id: string;
69
- }, "methodType"> & {
70
- typeMode?: TypeMode;
71
- } & {
72
- typeMode?: M | undefined;
73
- }) => Promise<ApiResponse<ConditionalReturnType<DySlidesWork, M>>>;
74
- getComments: <M extends TypeMode>(options: Omit<{
75
- methodType: "\u8BC4\u8BBA\u6570\u636E";
76
- aweme_id: string;
77
- number?: number;
78
- cursor?: number;
79
- }, "methodType"> & {
80
- typeMode?: TypeMode;
81
- } & {
82
- typeMode?: M | undefined;
83
- }) => Promise<ApiResponse<ConditionalReturnType<DyWorkComments, M>>>;
84
- getCommentReplies: <M extends TypeMode>(options: Omit<{
85
- methodType: "\u6307\u5B9A\u8BC4\u8BBA\u56DE\u590D\u6570\u636E";
86
- aweme_id: string;
87
- comment_id: string;
88
- number?: number;
89
- cursor?: number;
90
- }, "methodType"> & {
91
- typeMode?: TypeMode;
92
- } & {
93
- typeMode?: M | undefined;
94
- }) => Promise<ApiResponse<ConditionalReturnType<any, M>>>;
95
- getUserProfile: <M extends TypeMode>(options: Omit<{
96
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u89C6\u9891\u5217\u8868\u6570\u636E" | "\u76F4\u64AD\u95F4\u4FE1\u606F\u6570\u636E";
97
- sec_uid: string;
98
- }, "methodType"> & {
99
- typeMode?: TypeMode;
100
- } & {
101
- typeMode?: M | undefined;
102
- }) => Promise<ApiResponse<ConditionalReturnType<DyUserInfo, M>>>;
103
- getEmojiList: <M extends TypeMode>(options: Omit<{
104
- methodType: "Emoji\u6570\u636E";
105
- }, "methodType"> & {
106
- typeMode?: TypeMode;
107
- } & {
108
- typeMode?: M | undefined;
109
- }) => Promise<ApiResponse<ConditionalReturnType<DyEmojiList, M>>>;
110
- getEmojiProList: <M extends TypeMode>(options: Omit<{
111
- methodType: "\u52A8\u6001\u8868\u60C5\u6570\u636E";
112
- }, "methodType"> & {
113
- typeMode?: TypeMode;
114
- } & {
115
- typeMode?: M | undefined;
116
- }) => Promise<ApiResponse<ConditionalReturnType<DyEmojiProList, M>>>;
117
- getUserVideos: <M extends TypeMode>(options: Omit<{
118
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u89C6\u9891\u5217\u8868\u6570\u636E" | "\u76F4\u64AD\u95F4\u4FE1\u606F\u6570\u636E";
119
- sec_uid: string;
120
- }, "methodType"> & {
121
- typeMode?: TypeMode;
122
- } & {
123
- typeMode?: M | undefined;
124
- }) => Promise<ApiResponse<ConditionalReturnType<DyUserPostVideos, M>>>;
125
- getMusicInfo: <M extends TypeMode>(options: Omit<{
126
- methodType: "\u97F3\u4E50\u6570\u636E";
127
- music_id: string;
128
- }, "methodType"> & {
129
- typeMode?: TypeMode;
130
- } & {
131
- typeMode?: M | undefined;
132
- }) => Promise<ApiResponse<ConditionalReturnType<DyMusicWork, M>>>;
133
- getSuggestWords: <M extends TypeMode>(options: Omit<{
134
- methodType: "\u70ED\u70B9\u8BCD\u6570\u636E" | "\u641C\u7D22\u6570\u636E";
135
- query: string;
136
- number?: number;
137
- search_id?: string;
138
- }, "methodType"> & {
139
- typeMode?: TypeMode;
140
- } & {
141
- typeMode?: M | undefined;
142
- }) => Promise<ApiResponse<ConditionalReturnType<DySuggestWords, M>>>;
143
- search: <M extends TypeMode>(options: Omit<{
144
- methodType: "\u70ED\u70B9\u8BCD\u6570\u636E" | "\u641C\u7D22\u6570\u636E";
145
- query: string;
146
- number?: number;
147
- search_id?: string;
148
- }, "methodType"> & {
149
- typeMode?: TypeMode;
150
- } & {
151
- typeMode?: M | undefined;
152
- }) => Promise<ApiResponse<ConditionalReturnType<DySearchInfo, M>>>;
153
- getLiveRoomInfo: <M extends TypeMode>(options: Omit<{
154
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u89C6\u9891\u5217\u8868\u6570\u636E" | "\u76F4\u64AD\u95F4\u4FE1\u606F\u6570\u636E";
155
- sec_uid: string;
156
- }, "methodType"> & {
157
- typeMode?: TypeMode;
158
- } & {
159
- typeMode?: M | undefined;
160
- }) => Promise<ApiResponse<ConditionalReturnType<DyUserLiveVideos, M>>>;
161
- };
162
- sign: typeof douyinSign;
163
- douyinApiUrls: typeof douyinApiUrls;
164
- };
165
- bilibili: {
166
- /** 绑定了cookie的B站API对象,调用时不需要传递cookie */
167
- api: {
168
- getVideoInfo: <M extends TypeMode = "loose">(options: Omit<{
169
- methodType: "\u5355\u4E2A\u89C6\u9891\u4F5C\u54C1\u6570\u636E";
170
- bvid: string;
171
- }, "methodType"> & {
172
- typeMode?: TypeMode;
173
- } & {
174
- typeMode?: M | undefined;
175
- }) => Promise<ApiResponse<ConditionalReturnType<BiliOneWork, M>>>;
176
- getVideoStream: <M extends TypeMode = "loose">(options: Omit<{
177
- methodType: "\u5355\u4E2A\u89C6\u9891\u4E0B\u8F7D\u4FE1\u606F\u6570\u636E";
178
- avid: number;
179
- cid: number;
180
- }, "methodType"> & {
181
- typeMode?: TypeMode;
182
- } & {
183
- typeMode?: M | undefined;
184
- }) => Promise<ApiResponse<ConditionalReturnType<BiliVideoPlayurlIsLogin | BiliBiliVideoPlayurlNoLogin, M>>>;
185
- getComments: <M extends TypeMode = "loose">(options: Omit<{
186
- methodType: "\u8BC4\u8BBA\u6570\u636E";
187
- type: number;
188
- oid: string;
189
- number?: number;
190
- mode?: 0 | 1 | 2 | 3;
191
- pagination_str?: string;
192
- plat?: number;
193
- seek_rpid?: string;
194
- web_location?: string;
195
- }, "methodType"> & {
196
- typeMode?: TypeMode;
197
- } & {
198
- typeMode?: M | undefined;
199
- }) => Promise<ApiResponse<ConditionalReturnType<BiliWorkComments, M>>>;
200
- getUserProfile: <M extends TypeMode = "loose">(options: Omit<{
201
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u52A8\u6001\u5217\u8868\u6570\u636E" | "\u83B7\u53D6UP\u4E3B\u603B\u64AD\u653E\u91CF";
202
- host_mid: number;
203
- }, "methodType"> & {
204
- typeMode?: TypeMode;
205
- } & {
206
- typeMode?: M | undefined;
207
- }) => Promise<ApiResponse<ConditionalReturnType<BiliUserProfile, M>>>;
208
- getUserDynamic: <M extends TypeMode = "loose">(options: Omit<{
209
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u52A8\u6001\u5217\u8868\u6570\u636E" | "\u83B7\u53D6UP\u4E3B\u603B\u64AD\u653E\u91CF";
210
- host_mid: number;
211
- }, "methodType"> & {
212
- typeMode?: TypeMode;
213
- } & {
214
- typeMode?: M | undefined;
215
- }) => Promise<ApiResponse<ConditionalReturnType<BiliUserDynamic, M>>>;
216
- getEmojiList: <M extends TypeMode = "loose">(options: Omit<{
217
- methodType: "Emoji\u6570\u636E";
218
- }, "methodType"> & {
219
- typeMode?: TypeMode;
220
- } & {
221
- typeMode?: M | undefined;
222
- }) => Promise<ApiResponse<ConditionalReturnType<BiliEmojiList, M>>>;
223
- getBangumiInfo: <M extends TypeMode = "loose">(options: Omit<{
224
- methodType: "\u756A\u5267\u57FA\u672C\u4FE1\u606F\u6570\u636E";
225
- season_id?: string;
226
- ep_id?: string;
227
- }, "methodType"> & {
228
- typeMode?: TypeMode;
229
- } & {
230
- typeMode?: M | undefined;
231
- }) => Promise<ApiResponse<ConditionalReturnType<BiliBangumiVideoInfo, M>>>;
232
- getBangumiStream: <M extends TypeMode = "loose">(options: Omit<{
233
- methodType: "\u756A\u5267\u4E0B\u8F7D\u4FE1\u606F\u6570\u636E";
234
- cid: number;
235
- ep_id: string;
236
- }, "methodType"> & {
237
- typeMode?: TypeMode;
238
- } & {
239
- typeMode?: M | undefined;
240
- }) => Promise<ApiResponse<ConditionalReturnType<BiliBangumiVideoPlayurlIsLogin | BiliBangumiVideoPlayurlNoLogin, M>>>;
241
- getDynamicInfo: <M extends TypeMode = "loose">(options: Omit<{
242
- methodType: "\u52A8\u6001\u8BE6\u60C5\u6570\u636E" | "\u52A8\u6001\u5361\u7247\u6570\u636E";
243
- dynamic_id: string;
244
- }, "methodType"> & {
245
- typeMode?: TypeMode;
246
- } & {
247
- typeMode?: M | undefined;
248
- }) => Promise<ApiResponse<ConditionalReturnType<BiliDynamicInfo, M>>>;
249
- getDynamicCard: <M extends TypeMode = "loose">(options: Omit<{
250
- methodType: "\u52A8\u6001\u8BE6\u60C5\u6570\u636E" | "\u52A8\u6001\u5361\u7247\u6570\u636E";
251
- dynamic_id: string;
252
- }, "methodType"> & {
253
- typeMode?: TypeMode;
254
- } & {
255
- typeMode?: M | undefined;
256
- }) => Promise<ApiResponse<ConditionalReturnType<BiliDynamicCard, M>>>;
257
- getLiveRoomDetail: <M extends TypeMode = "loose">(options: Omit<{
258
- methodType: "\u76F4\u64AD\u95F4\u4FE1\u606F" | "\u76F4\u64AD\u95F4\u521D\u59CB\u5316\u4FE1\u606F";
259
- room_id: string;
260
- }, "methodType"> & {
261
- typeMode?: TypeMode;
262
- } & {
263
- typeMode?: M | undefined;
264
- }) => Promise<ApiResponse<ConditionalReturnType<BiliLiveRoomDetail, M>>>;
265
- getLiveRoomInitInfo: <M extends TypeMode = "loose">(options: Omit<{
266
- methodType: "\u76F4\u64AD\u95F4\u4FE1\u606F" | "\u76F4\u64AD\u95F4\u521D\u59CB\u5316\u4FE1\u606F";
267
- room_id: string;
268
- }, "methodType"> & {
269
- typeMode?: TypeMode;
270
- } & {
271
- typeMode?: M | undefined;
272
- }) => Promise<ApiResponse<ConditionalReturnType<BiliLiveRoomDef, M>>>;
273
- getLoginBasicInfo: <M extends TypeMode = "loose">(options: Omit<{
274
- methodType: "\u767B\u5F55\u57FA\u672C\u4FE1\u606F";
275
- }, "methodType"> & {
276
- typeMode?: TypeMode;
277
- } & {
278
- typeMode?: M | undefined;
279
- }) => Promise<ApiResponse<ConditionalReturnType<any, M>>>;
280
- getLoginQrcode: <M extends TypeMode = "loose">(options: Omit<{
281
- methodType: "\u7533\u8BF7\u4E8C\u7EF4\u7801";
282
- }, "methodType"> & {
283
- typeMode?: TypeMode;
284
- } & {
285
- typeMode?: M | undefined;
286
- }) => Promise<ApiResponse<ConditionalReturnType<BiliNewLoginQrcode, M>>>;
287
- checkQrcodeStatus: <M extends TypeMode = "loose">(options: Omit<{
288
- methodType: "\u4E8C\u7EF4\u7801\u72B6\u6001";
289
- qrcode_key: string;
290
- }, "methodType"> & {
291
- typeMode?: TypeMode;
292
- } & {
293
- typeMode?: M | undefined;
294
- }) => Promise<ApiResponse<ConditionalReturnType<BiliCheckQrcode, M>>>;
295
- getUserTotalPlayCount: <M extends TypeMode = "loose">(options: Omit<{
296
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u52A8\u6001\u5217\u8868\u6570\u636E" | "\u83B7\u53D6UP\u4E3B\u603B\u64AD\u653E\u91CF";
297
- host_mid: number;
298
- }, "methodType"> & {
299
- typeMode?: TypeMode;
300
- } & {
301
- typeMode?: M | undefined;
302
- }) => Promise<ApiResponse<ConditionalReturnType<BiliUserFullView, M>>>;
303
- convertAvToBv: <M extends TypeMode = "loose">(options: Omit<{
304
- methodType: "AV\u8F6CBV";
305
- avid: number;
306
- }, "methodType"> & {
307
- typeMode?: TypeMode;
308
- } & {
309
- typeMode?: M | undefined;
310
- }) => Promise<ApiResponse<ConditionalReturnType<BiliAv2Bv, M>>>;
311
- convertBvToAv: <M extends TypeMode = "loose">(options: Omit<{
312
- methodType: "BV\u8F6CAV";
313
- bvid: string;
314
- }, "methodType"> & {
315
- typeMode?: TypeMode;
316
- } & {
317
- typeMode?: M | undefined;
318
- }) => Promise<ApiResponse<ConditionalReturnType<BiliBv2AV, M>>>;
319
- };
320
- sign: {
321
- wbi_sign: typeof wbi_sign;
322
- av2bv: typeof av2bv;
323
- bv2av: typeof bv2av;
324
- };
325
- bilibiliApiUrls: typeof bilibiliApiUrls;
326
- };
327
- kuaishou: {
328
- /** 绑定了cookie的快手API对象,调用时不需要传递cookie */
329
- api: {
330
- getWorkInfo: <M extends TypeMode = "loose">(options: Omit<{
331
- methodType: "\u5355\u4E2A\u89C6\u9891\u4F5C\u54C1\u6570\u636E";
332
- photoId: string;
333
- }, "methodType"> & {
334
- typeMode?: TypeMode;
335
- } & {
336
- typeMode?: M | undefined;
337
- }) => Promise<ApiResponse<ConditionalReturnType<KsOneWork, M>>>;
338
- getComments: <M extends TypeMode = "loose">(options: Omit<{
339
- methodType: "\u8BC4\u8BBA\u6570\u636E";
340
- photoId: string;
341
- }, "methodType"> & {
342
- typeMode?: TypeMode;
343
- } & {
344
- typeMode?: M | undefined;
345
- }) => Promise<ApiResponse<ConditionalReturnType<KsWorkComments, M>>>;
346
- getEmojiList: <M extends TypeMode = "loose">(options: Omit<{
347
- methodType: "Emoji\u6570\u636E";
348
- }, "methodType"> & {
349
- typeMode?: TypeMode;
350
- } & {
351
- typeMode?: M | undefined;
352
- }) => Promise<ApiResponse<ConditionalReturnType<KsEmojiList, M>>>;
353
- };
354
- kuaishouApiUrls: typeof kuaishouApiUrls;
355
- };
356
- };
357
-
358
- /**
359
- * API错误类
360
- */
361
- declare class ApiError extends Error {
362
- readonly code: number;
363
- readonly platform: string;
364
- /**
365
- * 构造API错误
366
- * @param message - 错误消息
367
- * @param code - 错误代码
368
- * @param platform - 平台名称
369
- */
370
- constructor(message: string, code?: number, platform?: string);
371
- }
372
- /**
373
- * 参数验证错误类
374
- */
375
- declare class ValidationError extends Error {
376
- readonly errors: Array<{
377
- field: string;
378
- message: string;
379
- }>;
380
- readonly requestPath?: string;
381
- /**
382
- * 构造参数验证错误
383
- * @param message - 错误消息
384
- * @param errors - 详细错误信息
385
- * @param requestPath - HTTP请求路径
386
- */
387
- constructor(message: string, errors: Array<{
388
- field: string;
389
- message: string;
390
- }>, requestPath?: string);
391
- /**
392
- * 从Zod错误创建验证错误
393
- * @param zodError - Zod验证错误
394
- * @param requestPath - HTTP请求路径
395
- * @returns 验证错误实例
396
- */
397
- static fromZodError(zodError: z.ZodError, requestPath?: string): ValidationError;
398
- }
399
- /**
400
- * 处理错误并返回统一格式
401
- * @param error - 错误对象
402
- * @param requestPath - HTTP请求路径(可选)
403
- * @returns 统一的错误响应格式
404
- */
405
- declare const handleError: (error: unknown, requestPath?: string) => {
406
- data: null;
407
- message: string;
408
- code: number;
409
- errors?: Array<{
410
- field: string;
411
- message: string;
412
- }>;
413
- platform?: string;
414
- requestPath?: string;
415
- };
416
-
417
- /**
418
- * @deprecated 请使用 createAmagiClient 替代
419
- */
420
- declare const amagiClient: (options?: CookieOptions) => {
421
- startServer: (port?: number) => express.Application;
422
- startClient: (port?: number) => express.Application;
423
- getDouyinData: <T extends DouyinMethodType, M extends TypeMode>(methodType: T, options?: ExtendedDouyinOptions<T> & {
424
- typeMode?: M;
425
- }) => Promise<ApiResponse<ConditionalReturnType<DouyinDataOptionsMap[T]["data"], M>>>;
426
- getBilibiliData: <T extends BilibiliMethodType, M extends TypeMode>(methodType: T, options?: ExtendedBilibiliOptions<T> & {
427
- typeMode?: M;
428
- }) => Promise<ApiResponse<ConditionalReturnType<BilibiliDataOptionsMap[T]["data"], M>>>;
429
- getKuaishouData: <T extends KuaishouMethodType, M extends TypeMode>(methodType: T, options?: ExtendedKuaishouOptions<T> & {
430
- typeMode?: M;
431
- }) => Promise<ApiResponse<ConditionalReturnType<KuaishouDataOptionsMap[T]["data"], M>>>;
432
- douyin: {
433
- api: {
434
- getWorkInfo: <M extends TypeMode>(options: Omit<{
435
- methodType: "\u89C6\u9891\u4F5C\u54C1\u6570\u636E" | "\u56FE\u96C6\u4F5C\u54C1\u6570\u636E" | "\u5408\u8F91\u4F5C\u54C1\u6570\u636E" | "\u805A\u5408\u89E3\u6790";
436
- aweme_id: string;
437
- }, "methodType"> & {
438
- typeMode?: TypeMode;
439
- } & {
440
- typeMode?: M | undefined;
441
- }) => Promise<ApiResponse<ConditionalReturnType<DyVideoWork | DyImageAlbumWork | DySlidesWork, M>>>;
442
- getVideoWorkInfo: <M extends TypeMode>(options: Omit<{
443
- methodType: "\u89C6\u9891\u4F5C\u54C1\u6570\u636E";
444
- aweme_id: string;
445
- }, "methodType"> & {
446
- typeMode?: TypeMode;
447
- } & {
448
- typeMode?: M | undefined;
449
- }) => Promise<ApiResponse<ConditionalReturnType<DyVideoWork, M>>>;
450
- getImageAlbumWorkInfo: <M extends TypeMode>(options: Omit<{
451
- methodType: "\u56FE\u96C6\u4F5C\u54C1\u6570\u636E";
452
- aweme_id: string;
453
- }, "methodType"> & {
454
- typeMode?: TypeMode;
455
- } & {
456
- typeMode?: M | undefined;
457
- }) => Promise<ApiResponse<ConditionalReturnType<DyImageAlbumWork, M>>>;
458
- getSlidesWorkInfo: <M extends TypeMode>(options: Omit<{
459
- methodType: "\u5408\u8F91\u4F5C\u54C1\u6570\u636E";
460
- aweme_id: string;
461
- }, "methodType"> & {
462
- typeMode?: TypeMode;
463
- } & {
464
- typeMode?: M | undefined;
465
- }) => Promise<ApiResponse<ConditionalReturnType<DySlidesWork, M>>>;
466
- getComments: <M extends TypeMode>(options: Omit<{
467
- methodType: "\u8BC4\u8BBA\u6570\u636E";
468
- aweme_id: string;
469
- number?: number;
470
- cursor?: number;
471
- }, "methodType"> & {
472
- typeMode?: TypeMode;
473
- } & {
474
- typeMode?: M | undefined;
475
- }) => Promise<ApiResponse<ConditionalReturnType<DyWorkComments, M>>>;
476
- getCommentReplies: <M extends TypeMode>(options: Omit<{
477
- methodType: "\u6307\u5B9A\u8BC4\u8BBA\u56DE\u590D\u6570\u636E";
478
- aweme_id: string;
479
- comment_id: string;
480
- number?: number;
481
- cursor?: number;
482
- }, "methodType"> & {
483
- typeMode?: TypeMode;
484
- } & {
485
- typeMode?: M | undefined;
486
- }) => Promise<ApiResponse<ConditionalReturnType<any, M>>>;
487
- getUserProfile: <M extends TypeMode>(options: Omit<{
488
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u89C6\u9891\u5217\u8868\u6570\u636E" | "\u76F4\u64AD\u95F4\u4FE1\u606F\u6570\u636E";
489
- sec_uid: string;
490
- }, "methodType"> & {
491
- typeMode?: TypeMode;
492
- } & {
493
- typeMode?: M | undefined;
494
- }) => Promise<ApiResponse<ConditionalReturnType<DyUserInfo, M>>>;
495
- getEmojiList: <M extends TypeMode>(options: Omit<{
496
- methodType: "Emoji\u6570\u636E";
497
- }, "methodType"> & {
498
- typeMode?: TypeMode;
499
- } & {
500
- typeMode?: M | undefined;
501
- }) => Promise<ApiResponse<ConditionalReturnType<DyEmojiList, M>>>;
502
- getEmojiProList: <M extends TypeMode>(options: Omit<{
503
- methodType: "\u52A8\u6001\u8868\u60C5\u6570\u636E";
504
- }, "methodType"> & {
505
- typeMode?: TypeMode;
506
- } & {
507
- typeMode?: M | undefined;
508
- }) => Promise<ApiResponse<ConditionalReturnType<DyEmojiProList, M>>>;
509
- getUserVideos: <M extends TypeMode>(options: Omit<{
510
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u89C6\u9891\u5217\u8868\u6570\u636E" | "\u76F4\u64AD\u95F4\u4FE1\u606F\u6570\u636E";
511
- sec_uid: string;
512
- }, "methodType"> & {
513
- typeMode?: TypeMode;
514
- } & {
515
- typeMode?: M | undefined;
516
- }) => Promise<ApiResponse<ConditionalReturnType<DyUserPostVideos, M>>>;
517
- getMusicInfo: <M extends TypeMode>(options: Omit<{
518
- methodType: "\u97F3\u4E50\u6570\u636E";
519
- music_id: string;
520
- }, "methodType"> & {
521
- typeMode?: TypeMode;
522
- } & {
523
- typeMode?: M | undefined;
524
- }) => Promise<ApiResponse<ConditionalReturnType<DyMusicWork, M>>>;
525
- getSuggestWords: <M extends TypeMode>(options: Omit<{
526
- methodType: "\u70ED\u70B9\u8BCD\u6570\u636E" | "\u641C\u7D22\u6570\u636E";
527
- query: string;
528
- number?: number;
529
- search_id?: string;
530
- }, "methodType"> & {
531
- typeMode?: TypeMode;
532
- } & {
533
- typeMode?: M | undefined;
534
- }) => Promise<ApiResponse<ConditionalReturnType<DySuggestWords, M>>>;
535
- search: <M extends TypeMode>(options: Omit<{
536
- methodType: "\u70ED\u70B9\u8BCD\u6570\u636E" | "\u641C\u7D22\u6570\u636E";
537
- query: string;
538
- number?: number;
539
- search_id?: string;
540
- }, "methodType"> & {
541
- typeMode?: TypeMode;
542
- } & {
543
- typeMode?: M | undefined;
544
- }) => Promise<ApiResponse<ConditionalReturnType<DySearchInfo, M>>>;
545
- getLiveRoomInfo: <M extends TypeMode>(options: Omit<{
546
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u89C6\u9891\u5217\u8868\u6570\u636E" | "\u76F4\u64AD\u95F4\u4FE1\u606F\u6570\u636E";
547
- sec_uid: string;
548
- }, "methodType"> & {
549
- typeMode?: TypeMode;
550
- } & {
551
- typeMode?: M | undefined;
552
- }) => Promise<ApiResponse<ConditionalReturnType<DyUserLiveVideos, M>>>;
553
- };
554
- sign: typeof douyinSign;
555
- douyinApiUrls: typeof douyinApiUrls;
556
- };
557
- bilibili: {
558
- api: {
559
- getVideoInfo: <M extends TypeMode = "loose">(options: Omit<{
560
- methodType: "\u5355\u4E2A\u89C6\u9891\u4F5C\u54C1\u6570\u636E";
561
- bvid: string;
562
- }, "methodType"> & {
563
- typeMode?: TypeMode;
564
- } & {
565
- typeMode?: M | undefined;
566
- }) => Promise<ApiResponse<ConditionalReturnType<BiliOneWork, M>>>;
567
- getVideoStream: <M extends TypeMode = "loose">(options: Omit<{
568
- methodType: "\u5355\u4E2A\u89C6\u9891\u4E0B\u8F7D\u4FE1\u606F\u6570\u636E";
569
- avid: number;
570
- cid: number;
571
- }, "methodType"> & {
572
- typeMode?: TypeMode;
573
- } & {
574
- typeMode?: M | undefined;
575
- }) => Promise<ApiResponse<ConditionalReturnType<BiliVideoPlayurlIsLogin | BiliBiliVideoPlayurlNoLogin, M>>>;
576
- getComments: <M extends TypeMode = "loose">(options: Omit<{
577
- methodType: "\u8BC4\u8BBA\u6570\u636E";
578
- type: number;
579
- oid: string;
580
- number?: number;
581
- mode?: 0 | 1 | 2 | 3;
582
- pagination_str?: string;
583
- plat?: number;
584
- seek_rpid?: string;
585
- web_location?: string;
586
- }, "methodType"> & {
587
- typeMode?: TypeMode;
588
- } & {
589
- typeMode?: M | undefined;
590
- }) => Promise<ApiResponse<ConditionalReturnType<BiliWorkComments, M>>>;
591
- getUserProfile: <M extends TypeMode = "loose">(options: Omit<{
592
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u52A8\u6001\u5217\u8868\u6570\u636E" | "\u83B7\u53D6UP\u4E3B\u603B\u64AD\u653E\u91CF";
593
- host_mid: number;
594
- }, "methodType"> & {
595
- typeMode?: TypeMode;
596
- } & {
597
- typeMode?: M | undefined;
598
- }) => Promise<ApiResponse<ConditionalReturnType<BiliUserProfile, M>>>;
599
- getUserDynamic: <M extends TypeMode = "loose">(options: Omit<{
600
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u52A8\u6001\u5217\u8868\u6570\u636E" | "\u83B7\u53D6UP\u4E3B\u603B\u64AD\u653E\u91CF";
601
- host_mid: number;
602
- }, "methodType"> & {
603
- typeMode?: TypeMode;
604
- } & {
605
- typeMode?: M | undefined;
606
- }) => Promise<ApiResponse<ConditionalReturnType<BiliUserDynamic, M>>>;
607
- getEmojiList: <M extends TypeMode = "loose">(options: Omit<{
608
- methodType: "Emoji\u6570\u636E";
609
- }, "methodType"> & {
610
- typeMode?: TypeMode;
611
- } & {
612
- typeMode?: M | undefined;
613
- }) => Promise<ApiResponse<ConditionalReturnType<BiliEmojiList, M>>>;
614
- getBangumiInfo: <M extends TypeMode = "loose">(options: Omit<{
615
- methodType: "\u756A\u5267\u57FA\u672C\u4FE1\u606F\u6570\u636E";
616
- season_id?: string;
617
- ep_id?: string;
618
- }, "methodType"> & {
619
- typeMode?: TypeMode;
620
- } & {
621
- typeMode?: M | undefined;
622
- }) => Promise<ApiResponse<ConditionalReturnType<BiliBangumiVideoInfo, M>>>;
623
- getBangumiStream: <M extends TypeMode = "loose">(options: Omit<{
624
- methodType: "\u756A\u5267\u4E0B\u8F7D\u4FE1\u606F\u6570\u636E";
625
- cid: number;
626
- ep_id: string;
627
- }, "methodType"> & {
628
- typeMode?: TypeMode;
629
- } & {
630
- typeMode?: M | undefined;
631
- }) => Promise<ApiResponse<ConditionalReturnType<BiliBangumiVideoPlayurlIsLogin | BiliBangumiVideoPlayurlNoLogin, M>>>;
632
- getDynamicInfo: <M extends TypeMode = "loose">(options: Omit<{
633
- methodType: "\u52A8\u6001\u8BE6\u60C5\u6570\u636E" | "\u52A8\u6001\u5361\u7247\u6570\u636E";
634
- dynamic_id: string;
635
- }, "methodType"> & {
636
- typeMode?: TypeMode;
637
- } & {
638
- typeMode?: M | undefined;
639
- }) => Promise<ApiResponse<ConditionalReturnType<BiliDynamicInfo, M>>>;
640
- getDynamicCard: <M extends TypeMode = "loose">(options: Omit<{
641
- methodType: "\u52A8\u6001\u8BE6\u60C5\u6570\u636E" | "\u52A8\u6001\u5361\u7247\u6570\u636E";
642
- dynamic_id: string;
643
- }, "methodType"> & {
644
- typeMode?: TypeMode;
645
- } & {
646
- typeMode?: M | undefined;
647
- }) => Promise<ApiResponse<ConditionalReturnType<BiliDynamicCard, M>>>;
648
- getLiveRoomDetail: <M extends TypeMode = "loose">(options: Omit<{
649
- methodType: "\u76F4\u64AD\u95F4\u4FE1\u606F" | "\u76F4\u64AD\u95F4\u521D\u59CB\u5316\u4FE1\u606F";
650
- room_id: string;
651
- }, "methodType"> & {
652
- typeMode?: TypeMode;
653
- } & {
654
- typeMode?: M | undefined;
655
- }) => Promise<ApiResponse<ConditionalReturnType<BiliLiveRoomDetail, M>>>;
656
- getLiveRoomInitInfo: <M extends TypeMode = "loose">(options: Omit<{
657
- methodType: "\u76F4\u64AD\u95F4\u4FE1\u606F" | "\u76F4\u64AD\u95F4\u521D\u59CB\u5316\u4FE1\u606F";
658
- room_id: string;
659
- }, "methodType"> & {
660
- typeMode?: TypeMode;
661
- } & {
662
- typeMode?: M | undefined;
663
- }) => Promise<ApiResponse<ConditionalReturnType<BiliLiveRoomDef, M>>>;
664
- getLoginBasicInfo: <M extends TypeMode = "loose">(options: Omit<{
665
- methodType: "\u767B\u5F55\u57FA\u672C\u4FE1\u606F";
666
- }, "methodType"> & {
667
- typeMode?: TypeMode;
668
- } & {
669
- typeMode?: M | undefined;
670
- }) => Promise<ApiResponse<ConditionalReturnType<any, M>>>;
671
- getLoginQrcode: <M extends TypeMode = "loose">(options: Omit<{
672
- methodType: "\u7533\u8BF7\u4E8C\u7EF4\u7801";
673
- }, "methodType"> & {
674
- typeMode?: TypeMode;
675
- } & {
676
- typeMode?: M | undefined;
677
- }) => Promise<ApiResponse<ConditionalReturnType<BiliNewLoginQrcode, M>>>;
678
- checkQrcodeStatus: <M extends TypeMode = "loose">(options: Omit<{
679
- methodType: "\u4E8C\u7EF4\u7801\u72B6\u6001";
680
- qrcode_key: string;
681
- }, "methodType"> & {
682
- typeMode?: TypeMode;
683
- } & {
684
- typeMode?: M | undefined;
685
- }) => Promise<ApiResponse<ConditionalReturnType<BiliCheckQrcode, M>>>;
686
- getUserTotalPlayCount: <M extends TypeMode = "loose">(options: Omit<{
687
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u52A8\u6001\u5217\u8868\u6570\u636E" | "\u83B7\u53D6UP\u4E3B\u603B\u64AD\u653E\u91CF";
688
- host_mid: number;
689
- }, "methodType"> & {
690
- typeMode?: TypeMode;
691
- } & {
692
- typeMode?: M | undefined;
693
- }) => Promise<ApiResponse<ConditionalReturnType<BiliUserFullView, M>>>;
694
- convertAvToBv: <M extends TypeMode = "loose">(options: Omit<{
695
- methodType: "AV\u8F6CBV";
696
- avid: number;
697
- }, "methodType"> & {
698
- typeMode?: TypeMode;
699
- } & {
700
- typeMode?: M | undefined;
701
- }) => Promise<ApiResponse<ConditionalReturnType<BiliAv2Bv, M>>>;
702
- convertBvToAv: <M extends TypeMode = "loose">(options: Omit<{
703
- methodType: "BV\u8F6CAV";
704
- bvid: string;
705
- }, "methodType"> & {
706
- typeMode?: TypeMode;
707
- } & {
708
- typeMode?: M | undefined;
709
- }) => Promise<ApiResponse<ConditionalReturnType<BiliBv2AV, M>>>;
710
- };
711
- sign: {
712
- wbi_sign: typeof wbi_sign;
713
- av2bv: typeof av2bv;
714
- bv2av: typeof bv2av;
715
- };
716
- bilibiliApiUrls: typeof bilibiliApiUrls;
717
- };
718
- kuaishou: {
719
- api: {
720
- getWorkInfo: <M extends TypeMode = "loose">(options: Omit<{
721
- methodType: "\u5355\u4E2A\u89C6\u9891\u4F5C\u54C1\u6570\u636E";
722
- photoId: string;
723
- }, "methodType"> & {
724
- typeMode?: TypeMode;
725
- } & {
726
- typeMode?: M | undefined;
727
- }) => Promise<ApiResponse<ConditionalReturnType<KsOneWork, M>>>;
728
- getComments: <M extends TypeMode = "loose">(options: Omit<{
729
- methodType: "\u8BC4\u8BBA\u6570\u636E";
730
- photoId: string;
731
- }, "methodType"> & {
732
- typeMode?: TypeMode;
733
- } & {
734
- typeMode?: M | undefined;
735
- }) => Promise<ApiResponse<ConditionalReturnType<KsWorkComments, M>>>;
736
- getEmojiList: <M extends TypeMode = "loose">(options: Omit<{
737
- methodType: "Emoji\u6570\u636E";
738
- }, "methodType"> & {
739
- typeMode?: TypeMode;
740
- } & {
741
- typeMode?: M | undefined;
742
- }) => Promise<ApiResponse<ConditionalReturnType<KsEmojiList, M>>>;
743
- };
744
- kuaishouApiUrls: typeof kuaishouApiUrls;
745
- };
746
- };
747
- /** amagi 的构造函数类型 */
748
- type AmagiConstructor = {
749
- new (options?: CookieOptions): ReturnType<typeof createAmagiClient>;
750
- (options?: CookieOptions): ReturnType<typeof createAmagiClient>;
751
- /** 抖音相关功能模块 (工具集) */
752
- douyin: typeof douyinUtils;
753
- /** B站相关功能模块 (工具集) */
754
- bilibili: typeof bilibiliUtils;
755
- /** 快手相关功能模块 (工具集) */
756
- kuaishou: typeof kuaishouUtils;
757
- getDouyinData: typeof getDouyinData;
758
- getBilibiliData: typeof getBilibiliData;
759
- getKuaishouData: typeof getKuaishouData;
760
- };
761
- /** After instantiation, it can interact with the specified platform API to quickly obtain data. */
762
- declare const CreateApp: AmagiConstructor;
763
- /** After instantiation, it can interact with the specified platform API to quickly obtain data. */
764
- declare const amagi: AmagiConstructor;
765
-
766
- export { ApiError, ApiResponse, BiliAv2Bv, BiliBangumiVideoInfo, BiliBangumiVideoPlayurlIsLogin, BiliBangumiVideoPlayurlNoLogin, BiliBiliVideoPlayurlNoLogin, BiliBv2AV, BiliCheckQrcode, BiliDynamicCard, BiliDynamicInfo, BiliEmojiList, BiliLiveRoomDef, BiliLiveRoomDetail, BiliNewLoginQrcode, BiliOneWork, BiliUserDynamic, BiliUserFullView, BiliUserProfile, BiliVideoPlayurlIsLogin, BiliWorkComments, BilibiliDataOptionsMap, BilibiliMethodType, CreateApp as Client, type CookieOptions, CreateApp, DouyinDataOptionsMap, DouyinMethodType, DyEmojiList, DyEmojiProList, DyImageAlbumWork, DyMusicWork, DySearchInfo, DySlidesWork, DySuggestWords, DyUserInfo, DyUserLiveVideos, DyUserPostVideos, DyVideoWork, DyWorkComments, KsEmojiList, KsOneWork, KsWorkComments, KuaishouDataOptionsMap, KuaishouMethodType, ValidationError, amagiClient, av2bv, bilibiliApiUrls, bilibiliUtils, bv2av, createAmagiClient, amagi as default, douyinApiUrls, douyinSign, douyinUtils, getBilibiliData, getDouyinData, getKuaishouData, handleError, kuaishouApiUrls, kuaishouUtils, wbi_sign };