@ikenxuan/amagi 4.5.1 → 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,758 +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-BvcyJb5r.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-BvcyJb5r.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: number;
189
- number?: number;
190
- pn?: number;
191
- }, "methodType"> & {
192
- typeMode?: TypeMode;
193
- } & {
194
- typeMode?: M | undefined;
195
- }) => Promise<ApiResponse<ConditionalReturnType<BiliWorkComments, M>>>;
196
- getUserProfile: <M extends TypeMode = "loose">(options: Omit<{
197
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u52A8\u6001\u5217\u8868\u6570\u636E" | "\u83B7\u53D6UP\u4E3B\u603B\u64AD\u653E\u91CF";
198
- host_mid: number;
199
- }, "methodType"> & {
200
- typeMode?: TypeMode;
201
- } & {
202
- typeMode?: M | undefined;
203
- }) => Promise<ApiResponse<ConditionalReturnType<BiliUserProfile, M>>>;
204
- getUserDynamic: <M extends TypeMode = "loose">(options: Omit<{
205
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u52A8\u6001\u5217\u8868\u6570\u636E" | "\u83B7\u53D6UP\u4E3B\u603B\u64AD\u653E\u91CF";
206
- host_mid: number;
207
- }, "methodType"> & {
208
- typeMode?: TypeMode;
209
- } & {
210
- typeMode?: M | undefined;
211
- }) => Promise<ApiResponse<ConditionalReturnType<BiliUserDynamic, M>>>;
212
- getEmojiList: <M extends TypeMode = "loose">(options: Omit<{
213
- methodType: "Emoji\u6570\u636E";
214
- }, "methodType"> & {
215
- typeMode?: TypeMode;
216
- } & {
217
- typeMode?: M | undefined;
218
- }) => Promise<ApiResponse<ConditionalReturnType<BiliEmojiList, M>>>;
219
- getBangumiInfo: <M extends TypeMode = "loose">(options: Omit<{
220
- methodType: "\u756A\u5267\u57FA\u672C\u4FE1\u606F\u6570\u636E";
221
- season_id?: string;
222
- ep_id?: string;
223
- }, "methodType"> & {
224
- typeMode?: TypeMode;
225
- } & {
226
- typeMode?: M | undefined;
227
- }) => Promise<ApiResponse<ConditionalReturnType<BiliBangumiVideoInfo, M>>>;
228
- getBangumiStream: <M extends TypeMode = "loose">(options: Omit<{
229
- methodType: "\u756A\u5267\u4E0B\u8F7D\u4FE1\u606F\u6570\u636E";
230
- cid: number;
231
- ep_id: string;
232
- }, "methodType"> & {
233
- typeMode?: TypeMode;
234
- } & {
235
- typeMode?: M | undefined;
236
- }) => Promise<ApiResponse<ConditionalReturnType<BiliBangumiVideoPlayurlIsLogin | BiliBangumiVideoPlayurlNoLogin, M>>>;
237
- getDynamicInfo: <M extends TypeMode = "loose">(options: Omit<{
238
- methodType: "\u52A8\u6001\u8BE6\u60C5\u6570\u636E" | "\u52A8\u6001\u5361\u7247\u6570\u636E";
239
- dynamic_id: string;
240
- }, "methodType"> & {
241
- typeMode?: TypeMode;
242
- } & {
243
- typeMode?: M | undefined;
244
- }) => Promise<ApiResponse<ConditionalReturnType<BiliDynamicInfo, M>>>;
245
- getDynamicCard: <M extends TypeMode = "loose">(options: Omit<{
246
- methodType: "\u52A8\u6001\u8BE6\u60C5\u6570\u636E" | "\u52A8\u6001\u5361\u7247\u6570\u636E";
247
- dynamic_id: string;
248
- }, "methodType"> & {
249
- typeMode?: TypeMode;
250
- } & {
251
- typeMode?: M | undefined;
252
- }) => Promise<ApiResponse<ConditionalReturnType<BiliDynamicCard, M>>>;
253
- getLiveRoomDetail: <M extends TypeMode = "loose">(options: Omit<{
254
- methodType: "\u76F4\u64AD\u95F4\u4FE1\u606F" | "\u76F4\u64AD\u95F4\u521D\u59CB\u5316\u4FE1\u606F";
255
- room_id: string;
256
- }, "methodType"> & {
257
- typeMode?: TypeMode;
258
- } & {
259
- typeMode?: M | undefined;
260
- }) => Promise<ApiResponse<ConditionalReturnType<BiliLiveRoomDetail, M>>>;
261
- getLiveRoomInitInfo: <M extends TypeMode = "loose">(options: Omit<{
262
- methodType: "\u76F4\u64AD\u95F4\u4FE1\u606F" | "\u76F4\u64AD\u95F4\u521D\u59CB\u5316\u4FE1\u606F";
263
- room_id: string;
264
- }, "methodType"> & {
265
- typeMode?: TypeMode;
266
- } & {
267
- typeMode?: M | undefined;
268
- }) => Promise<ApiResponse<ConditionalReturnType<BiliLiveRoomDef, M>>>;
269
- getLoginBasicInfo: <M extends TypeMode = "loose">(options: Omit<{
270
- methodType: "\u767B\u5F55\u57FA\u672C\u4FE1\u606F";
271
- }, "methodType"> & {
272
- typeMode?: TypeMode;
273
- } & {
274
- typeMode?: M | undefined;
275
- }) => Promise<ApiResponse<ConditionalReturnType<any, M>>>;
276
- getLoginQrcode: <M extends TypeMode = "loose">(options: Omit<{
277
- methodType: "\u7533\u8BF7\u4E8C\u7EF4\u7801";
278
- }, "methodType"> & {
279
- typeMode?: TypeMode;
280
- } & {
281
- typeMode?: M | undefined;
282
- }) => Promise<ApiResponse<ConditionalReturnType<BiliNewLoginQrcode, M>>>;
283
- checkQrcodeStatus: <M extends TypeMode = "loose">(options: Omit<{
284
- methodType: "\u4E8C\u7EF4\u7801\u72B6\u6001";
285
- qrcode_key: string;
286
- }, "methodType"> & {
287
- typeMode?: TypeMode;
288
- } & {
289
- typeMode?: M | undefined;
290
- }) => Promise<ApiResponse<ConditionalReturnType<BiliCheckQrcode, M>>>;
291
- getUserTotalPlayCount: <M extends TypeMode = "loose">(options: Omit<{
292
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u52A8\u6001\u5217\u8868\u6570\u636E" | "\u83B7\u53D6UP\u4E3B\u603B\u64AD\u653E\u91CF";
293
- host_mid: number;
294
- }, "methodType"> & {
295
- typeMode?: TypeMode;
296
- } & {
297
- typeMode?: M | undefined;
298
- }) => Promise<ApiResponse<ConditionalReturnType<BiliUserFullView, M>>>;
299
- convertAvToBv: <M extends TypeMode = "loose">(options: Omit<{
300
- methodType: "AV\u8F6CBV";
301
- avid: number;
302
- }, "methodType"> & {
303
- typeMode?: TypeMode;
304
- } & {
305
- typeMode?: M | undefined;
306
- }) => Promise<ApiResponse<ConditionalReturnType<BiliAv2Bv, M>>>;
307
- convertBvToAv: <M extends TypeMode = "loose">(options: Omit<{
308
- methodType: "BV\u8F6CAV";
309
- bvid: string;
310
- }, "methodType"> & {
311
- typeMode?: TypeMode;
312
- } & {
313
- typeMode?: M | undefined;
314
- }) => Promise<ApiResponse<ConditionalReturnType<BiliBv2AV, M>>>;
315
- };
316
- sign: {
317
- wbi_sign: typeof wbi_sign;
318
- av2bv: typeof av2bv;
319
- bv2av: typeof bv2av;
320
- };
321
- bilibiliApiUrls: typeof bilibiliApiUrls;
322
- };
323
- kuaishou: {
324
- /** 绑定了cookie的快手API对象,调用时不需要传递cookie */
325
- api: {
326
- getWorkInfo: <M extends TypeMode = "loose">(options: Omit<{
327
- methodType: "\u5355\u4E2A\u89C6\u9891\u4F5C\u54C1\u6570\u636E";
328
- photoId: string;
329
- }, "methodType"> & {
330
- typeMode?: TypeMode;
331
- } & {
332
- typeMode?: M | undefined;
333
- }) => Promise<ApiResponse<ConditionalReturnType<KsOneWork, M>>>;
334
- getComments: <M extends TypeMode = "loose">(options: Omit<{
335
- methodType: "\u8BC4\u8BBA\u6570\u636E";
336
- photoId: string;
337
- }, "methodType"> & {
338
- typeMode?: TypeMode;
339
- } & {
340
- typeMode?: M | undefined;
341
- }) => Promise<ApiResponse<ConditionalReturnType<KsWorkComments, M>>>;
342
- getEmojiList: <M extends TypeMode = "loose">(options: Omit<{
343
- methodType: "Emoji\u6570\u636E";
344
- }, "methodType"> & {
345
- typeMode?: TypeMode;
346
- } & {
347
- typeMode?: M | undefined;
348
- }) => Promise<ApiResponse<ConditionalReturnType<KsEmojiList, M>>>;
349
- };
350
- kuaishouApiUrls: typeof kuaishouApiUrls;
351
- };
352
- };
353
-
354
- /**
355
- * API错误类
356
- */
357
- declare class ApiError extends Error {
358
- readonly code: number;
359
- readonly platform: string;
360
- /**
361
- * 构造API错误
362
- * @param message - 错误消息
363
- * @param code - 错误代码
364
- * @param platform - 平台名称
365
- */
366
- constructor(message: string, code?: number, platform?: string);
367
- }
368
- /**
369
- * 参数验证错误类
370
- */
371
- declare class ValidationError extends Error {
372
- readonly errors: Array<{
373
- field: string;
374
- message: string;
375
- }>;
376
- readonly requestPath?: string;
377
- /**
378
- * 构造参数验证错误
379
- * @param message - 错误消息
380
- * @param errors - 详细错误信息
381
- * @param requestPath - HTTP请求路径
382
- */
383
- constructor(message: string, errors: Array<{
384
- field: string;
385
- message: string;
386
- }>, requestPath?: string);
387
- /**
388
- * 从Zod错误创建验证错误
389
- * @param zodError - Zod验证错误
390
- * @param requestPath - HTTP请求路径
391
- * @returns 验证错误实例
392
- */
393
- static fromZodError(zodError: z.ZodError, requestPath?: string): ValidationError;
394
- }
395
- /**
396
- * 处理错误并返回统一格式
397
- * @param error - 错误对象
398
- * @param requestPath - HTTP请求路径(可选)
399
- * @returns 统一的错误响应格式
400
- */
401
- declare const handleError: (error: unknown, requestPath?: string) => {
402
- data: null;
403
- message: string;
404
- code: number;
405
- errors?: Array<{
406
- field: string;
407
- message: string;
408
- }>;
409
- platform?: string;
410
- requestPath?: string;
411
- };
412
-
413
- /**
414
- * @deprecated 请使用 createAmagiClient 替代
415
- */
416
- declare const amagiClient: (options?: CookieOptions) => {
417
- startServer: (port?: number) => express.Application;
418
- startClient: (port?: number) => express.Application;
419
- getDouyinData: <T extends DouyinMethodType, M extends TypeMode>(methodType: T, options?: ExtendedDouyinOptions<T> & {
420
- typeMode?: M;
421
- }) => Promise<ApiResponse<ConditionalReturnType<DouyinDataOptionsMap[T]["data"], M>>>;
422
- getBilibiliData: <T extends BilibiliMethodType, M extends TypeMode>(methodType: T, options?: ExtendedBilibiliOptions<T> & {
423
- typeMode?: M;
424
- }) => Promise<ApiResponse<ConditionalReturnType<BilibiliDataOptionsMap[T]["data"], M>>>;
425
- getKuaishouData: <T extends KuaishouMethodType, M extends TypeMode>(methodType: T, options?: ExtendedKuaishouOptions<T> & {
426
- typeMode?: M;
427
- }) => Promise<ApiResponse<ConditionalReturnType<KuaishouDataOptionsMap[T]["data"], M>>>;
428
- douyin: {
429
- api: {
430
- getWorkInfo: <M extends TypeMode>(options: Omit<{
431
- methodType: "\u89C6\u9891\u4F5C\u54C1\u6570\u636E" | "\u56FE\u96C6\u4F5C\u54C1\u6570\u636E" | "\u5408\u8F91\u4F5C\u54C1\u6570\u636E" | "\u805A\u5408\u89E3\u6790";
432
- aweme_id: string;
433
- }, "methodType"> & {
434
- typeMode?: TypeMode;
435
- } & {
436
- typeMode?: M | undefined;
437
- }) => Promise<ApiResponse<ConditionalReturnType<DyVideoWork | DyImageAlbumWork | DySlidesWork, M>>>;
438
- getVideoWorkInfo: <M extends TypeMode>(options: Omit<{
439
- methodType: "\u89C6\u9891\u4F5C\u54C1\u6570\u636E";
440
- aweme_id: string;
441
- }, "methodType"> & {
442
- typeMode?: TypeMode;
443
- } & {
444
- typeMode?: M | undefined;
445
- }) => Promise<ApiResponse<ConditionalReturnType<DyVideoWork, M>>>;
446
- getImageAlbumWorkInfo: <M extends TypeMode>(options: Omit<{
447
- methodType: "\u56FE\u96C6\u4F5C\u54C1\u6570\u636E";
448
- aweme_id: string;
449
- }, "methodType"> & {
450
- typeMode?: TypeMode;
451
- } & {
452
- typeMode?: M | undefined;
453
- }) => Promise<ApiResponse<ConditionalReturnType<DyImageAlbumWork, M>>>;
454
- getSlidesWorkInfo: <M extends TypeMode>(options: Omit<{
455
- methodType: "\u5408\u8F91\u4F5C\u54C1\u6570\u636E";
456
- aweme_id: string;
457
- }, "methodType"> & {
458
- typeMode?: TypeMode;
459
- } & {
460
- typeMode?: M | undefined;
461
- }) => Promise<ApiResponse<ConditionalReturnType<DySlidesWork, M>>>;
462
- getComments: <M extends TypeMode>(options: Omit<{
463
- methodType: "\u8BC4\u8BBA\u6570\u636E";
464
- aweme_id: string;
465
- number?: number;
466
- cursor?: number;
467
- }, "methodType"> & {
468
- typeMode?: TypeMode;
469
- } & {
470
- typeMode?: M | undefined;
471
- }) => Promise<ApiResponse<ConditionalReturnType<DyWorkComments, M>>>;
472
- getCommentReplies: <M extends TypeMode>(options: Omit<{
473
- methodType: "\u6307\u5B9A\u8BC4\u8BBA\u56DE\u590D\u6570\u636E";
474
- aweme_id: string;
475
- comment_id: string;
476
- number?: number;
477
- cursor?: number;
478
- }, "methodType"> & {
479
- typeMode?: TypeMode;
480
- } & {
481
- typeMode?: M | undefined;
482
- }) => Promise<ApiResponse<ConditionalReturnType<any, M>>>;
483
- getUserProfile: <M extends TypeMode>(options: Omit<{
484
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u89C6\u9891\u5217\u8868\u6570\u636E" | "\u76F4\u64AD\u95F4\u4FE1\u606F\u6570\u636E";
485
- sec_uid: string;
486
- }, "methodType"> & {
487
- typeMode?: TypeMode;
488
- } & {
489
- typeMode?: M | undefined;
490
- }) => Promise<ApiResponse<ConditionalReturnType<DyUserInfo, M>>>;
491
- getEmojiList: <M extends TypeMode>(options: Omit<{
492
- methodType: "Emoji\u6570\u636E";
493
- }, "methodType"> & {
494
- typeMode?: TypeMode;
495
- } & {
496
- typeMode?: M | undefined;
497
- }) => Promise<ApiResponse<ConditionalReturnType<DyEmojiList, M>>>;
498
- getEmojiProList: <M extends TypeMode>(options: Omit<{
499
- methodType: "\u52A8\u6001\u8868\u60C5\u6570\u636E";
500
- }, "methodType"> & {
501
- typeMode?: TypeMode;
502
- } & {
503
- typeMode?: M | undefined;
504
- }) => Promise<ApiResponse<ConditionalReturnType<DyEmojiProList, M>>>;
505
- getUserVideos: <M extends TypeMode>(options: Omit<{
506
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u89C6\u9891\u5217\u8868\u6570\u636E" | "\u76F4\u64AD\u95F4\u4FE1\u606F\u6570\u636E";
507
- sec_uid: string;
508
- }, "methodType"> & {
509
- typeMode?: TypeMode;
510
- } & {
511
- typeMode?: M | undefined;
512
- }) => Promise<ApiResponse<ConditionalReturnType<DyUserPostVideos, M>>>;
513
- getMusicInfo: <M extends TypeMode>(options: Omit<{
514
- methodType: "\u97F3\u4E50\u6570\u636E";
515
- music_id: string;
516
- }, "methodType"> & {
517
- typeMode?: TypeMode;
518
- } & {
519
- typeMode?: M | undefined;
520
- }) => Promise<ApiResponse<ConditionalReturnType<DyMusicWork, M>>>;
521
- getSuggestWords: <M extends TypeMode>(options: Omit<{
522
- methodType: "\u70ED\u70B9\u8BCD\u6570\u636E" | "\u641C\u7D22\u6570\u636E";
523
- query: string;
524
- number?: number;
525
- search_id?: string;
526
- }, "methodType"> & {
527
- typeMode?: TypeMode;
528
- } & {
529
- typeMode?: M | undefined;
530
- }) => Promise<ApiResponse<ConditionalReturnType<DySuggestWords, M>>>;
531
- search: <M extends TypeMode>(options: Omit<{
532
- methodType: "\u70ED\u70B9\u8BCD\u6570\u636E" | "\u641C\u7D22\u6570\u636E";
533
- query: string;
534
- number?: number;
535
- search_id?: string;
536
- }, "methodType"> & {
537
- typeMode?: TypeMode;
538
- } & {
539
- typeMode?: M | undefined;
540
- }) => Promise<ApiResponse<ConditionalReturnType<DySearchInfo, M>>>;
541
- getLiveRoomInfo: <M extends TypeMode>(options: Omit<{
542
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u89C6\u9891\u5217\u8868\u6570\u636E" | "\u76F4\u64AD\u95F4\u4FE1\u606F\u6570\u636E";
543
- sec_uid: string;
544
- }, "methodType"> & {
545
- typeMode?: TypeMode;
546
- } & {
547
- typeMode?: M | undefined;
548
- }) => Promise<ApiResponse<ConditionalReturnType<DyUserLiveVideos, M>>>;
549
- };
550
- sign: typeof douyinSign;
551
- douyinApiUrls: typeof douyinApiUrls;
552
- };
553
- bilibili: {
554
- api: {
555
- getVideoInfo: <M extends TypeMode = "loose">(options: Omit<{
556
- methodType: "\u5355\u4E2A\u89C6\u9891\u4F5C\u54C1\u6570\u636E";
557
- bvid: string;
558
- }, "methodType"> & {
559
- typeMode?: TypeMode;
560
- } & {
561
- typeMode?: M | undefined;
562
- }) => Promise<ApiResponse<ConditionalReturnType<BiliOneWork, M>>>;
563
- getVideoStream: <M extends TypeMode = "loose">(options: Omit<{
564
- methodType: "\u5355\u4E2A\u89C6\u9891\u4E0B\u8F7D\u4FE1\u606F\u6570\u636E";
565
- avid: number;
566
- cid: number;
567
- }, "methodType"> & {
568
- typeMode?: TypeMode;
569
- } & {
570
- typeMode?: M | undefined;
571
- }) => Promise<ApiResponse<ConditionalReturnType<BiliVideoPlayurlIsLogin | BiliBiliVideoPlayurlNoLogin, M>>>;
572
- getComments: <M extends TypeMode = "loose">(options: Omit<{
573
- methodType: "\u8BC4\u8BBA\u6570\u636E";
574
- type: number;
575
- oid: number;
576
- number?: number;
577
- pn?: number;
578
- }, "methodType"> & {
579
- typeMode?: TypeMode;
580
- } & {
581
- typeMode?: M | undefined;
582
- }) => Promise<ApiResponse<ConditionalReturnType<BiliWorkComments, M>>>;
583
- getUserProfile: <M extends TypeMode = "loose">(options: Omit<{
584
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u52A8\u6001\u5217\u8868\u6570\u636E" | "\u83B7\u53D6UP\u4E3B\u603B\u64AD\u653E\u91CF";
585
- host_mid: number;
586
- }, "methodType"> & {
587
- typeMode?: TypeMode;
588
- } & {
589
- typeMode?: M | undefined;
590
- }) => Promise<ApiResponse<ConditionalReturnType<BiliUserProfile, M>>>;
591
- getUserDynamic: <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<BiliUserDynamic, M>>>;
599
- getEmojiList: <M extends TypeMode = "loose">(options: Omit<{
600
- methodType: "Emoji\u6570\u636E";
601
- }, "methodType"> & {
602
- typeMode?: TypeMode;
603
- } & {
604
- typeMode?: M | undefined;
605
- }) => Promise<ApiResponse<ConditionalReturnType<BiliEmojiList, M>>>;
606
- getBangumiInfo: <M extends TypeMode = "loose">(options: Omit<{
607
- methodType: "\u756A\u5267\u57FA\u672C\u4FE1\u606F\u6570\u636E";
608
- season_id?: string;
609
- ep_id?: string;
610
- }, "methodType"> & {
611
- typeMode?: TypeMode;
612
- } & {
613
- typeMode?: M | undefined;
614
- }) => Promise<ApiResponse<ConditionalReturnType<BiliBangumiVideoInfo, M>>>;
615
- getBangumiStream: <M extends TypeMode = "loose">(options: Omit<{
616
- methodType: "\u756A\u5267\u4E0B\u8F7D\u4FE1\u606F\u6570\u636E";
617
- cid: number;
618
- ep_id: string;
619
- }, "methodType"> & {
620
- typeMode?: TypeMode;
621
- } & {
622
- typeMode?: M | undefined;
623
- }) => Promise<ApiResponse<ConditionalReturnType<BiliBangumiVideoPlayurlIsLogin | BiliBangumiVideoPlayurlNoLogin, M>>>;
624
- getDynamicInfo: <M extends TypeMode = "loose">(options: Omit<{
625
- methodType: "\u52A8\u6001\u8BE6\u60C5\u6570\u636E" | "\u52A8\u6001\u5361\u7247\u6570\u636E";
626
- dynamic_id: string;
627
- }, "methodType"> & {
628
- typeMode?: TypeMode;
629
- } & {
630
- typeMode?: M | undefined;
631
- }) => Promise<ApiResponse<ConditionalReturnType<BiliDynamicInfo, M>>>;
632
- getDynamicCard: <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<BiliDynamicCard, M>>>;
640
- getLiveRoomDetail: <M extends TypeMode = "loose">(options: Omit<{
641
- methodType: "\u76F4\u64AD\u95F4\u4FE1\u606F" | "\u76F4\u64AD\u95F4\u521D\u59CB\u5316\u4FE1\u606F";
642
- room_id: string;
643
- }, "methodType"> & {
644
- typeMode?: TypeMode;
645
- } & {
646
- typeMode?: M | undefined;
647
- }) => Promise<ApiResponse<ConditionalReturnType<BiliLiveRoomDetail, M>>>;
648
- getLiveRoomInitInfo: <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<BiliLiveRoomDef, M>>>;
656
- getLoginBasicInfo: <M extends TypeMode = "loose">(options: Omit<{
657
- methodType: "\u767B\u5F55\u57FA\u672C\u4FE1\u606F";
658
- }, "methodType"> & {
659
- typeMode?: TypeMode;
660
- } & {
661
- typeMode?: M | undefined;
662
- }) => Promise<ApiResponse<ConditionalReturnType<any, M>>>;
663
- getLoginQrcode: <M extends TypeMode = "loose">(options: Omit<{
664
- methodType: "\u7533\u8BF7\u4E8C\u7EF4\u7801";
665
- }, "methodType"> & {
666
- typeMode?: TypeMode;
667
- } & {
668
- typeMode?: M | undefined;
669
- }) => Promise<ApiResponse<ConditionalReturnType<BiliNewLoginQrcode, M>>>;
670
- checkQrcodeStatus: <M extends TypeMode = "loose">(options: Omit<{
671
- methodType: "\u4E8C\u7EF4\u7801\u72B6\u6001";
672
- qrcode_key: string;
673
- }, "methodType"> & {
674
- typeMode?: TypeMode;
675
- } & {
676
- typeMode?: M | undefined;
677
- }) => Promise<ApiResponse<ConditionalReturnType<BiliCheckQrcode, M>>>;
678
- getUserTotalPlayCount: <M extends TypeMode = "loose">(options: Omit<{
679
- methodType: "\u7528\u6237\u4E3B\u9875\u6570\u636E" | "\u7528\u6237\u4E3B\u9875\u52A8\u6001\u5217\u8868\u6570\u636E" | "\u83B7\u53D6UP\u4E3B\u603B\u64AD\u653E\u91CF";
680
- host_mid: number;
681
- }, "methodType"> & {
682
- typeMode?: TypeMode;
683
- } & {
684
- typeMode?: M | undefined;
685
- }) => Promise<ApiResponse<ConditionalReturnType<BiliUserFullView, M>>>;
686
- convertAvToBv: <M extends TypeMode = "loose">(options: Omit<{
687
- methodType: "AV\u8F6CBV";
688
- avid: number;
689
- }, "methodType"> & {
690
- typeMode?: TypeMode;
691
- } & {
692
- typeMode?: M | undefined;
693
- }) => Promise<ApiResponse<ConditionalReturnType<BiliAv2Bv, M>>>;
694
- convertBvToAv: <M extends TypeMode = "loose">(options: Omit<{
695
- methodType: "BV\u8F6CAV";
696
- bvid: string;
697
- }, "methodType"> & {
698
- typeMode?: TypeMode;
699
- } & {
700
- typeMode?: M | undefined;
701
- }) => Promise<ApiResponse<ConditionalReturnType<BiliBv2AV, M>>>;
702
- };
703
- sign: {
704
- wbi_sign: typeof wbi_sign;
705
- av2bv: typeof av2bv;
706
- bv2av: typeof bv2av;
707
- };
708
- bilibiliApiUrls: typeof bilibiliApiUrls;
709
- };
710
- kuaishou: {
711
- api: {
712
- getWorkInfo: <M extends TypeMode = "loose">(options: Omit<{
713
- methodType: "\u5355\u4E2A\u89C6\u9891\u4F5C\u54C1\u6570\u636E";
714
- photoId: string;
715
- }, "methodType"> & {
716
- typeMode?: TypeMode;
717
- } & {
718
- typeMode?: M | undefined;
719
- }) => Promise<ApiResponse<ConditionalReturnType<KsOneWork, M>>>;
720
- getComments: <M extends TypeMode = "loose">(options: Omit<{
721
- methodType: "\u8BC4\u8BBA\u6570\u636E";
722
- photoId: string;
723
- }, "methodType"> & {
724
- typeMode?: TypeMode;
725
- } & {
726
- typeMode?: M | undefined;
727
- }) => Promise<ApiResponse<ConditionalReturnType<KsWorkComments, M>>>;
728
- getEmojiList: <M extends TypeMode = "loose">(options: Omit<{
729
- methodType: "Emoji\u6570\u636E";
730
- }, "methodType"> & {
731
- typeMode?: TypeMode;
732
- } & {
733
- typeMode?: M | undefined;
734
- }) => Promise<ApiResponse<ConditionalReturnType<KsEmojiList, M>>>;
735
- };
736
- kuaishouApiUrls: typeof kuaishouApiUrls;
737
- };
738
- };
739
- /** amagi 的构造函数类型 */
740
- type AmagiConstructor = {
741
- new (options?: CookieOptions): ReturnType<typeof createAmagiClient>;
742
- (options?: CookieOptions): ReturnType<typeof createAmagiClient>;
743
- /** 抖音相关功能模块 (工具集) */
744
- douyin: typeof douyinUtils;
745
- /** B站相关功能模块 (工具集) */
746
- bilibili: typeof bilibiliUtils;
747
- /** 快手相关功能模块 (工具集) */
748
- kuaishou: typeof kuaishouUtils;
749
- getDouyinData: typeof getDouyinData;
750
- getBilibiliData: typeof getBilibiliData;
751
- getKuaishouData: typeof getKuaishouData;
752
- };
753
- /** After instantiation, it can interact with the specified platform API to quickly obtain data. */
754
- declare const CreateApp: AmagiConstructor;
755
- /** After instantiation, it can interact with the specified platform API to quickly obtain data. */
756
- declare const amagi: AmagiConstructor;
757
-
758
- 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 };