@ikenxuan/amagi 6.3.0 → 6.5.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.
- package/dist/default/index.cjs +324 -1115
- package/dist/default/index.d.ts +548 -988
- package/dist/default/index.mjs +324 -1101
- package/dist/exports/axios.cjs +1 -1
- package/dist/exports/express.cjs +1 -1
- package/dist/{rolldown-runtime-D6vf50IK.cjs → rolldown-runtime-VH7oDXx4.cjs} +1 -1
- package/package.json +4 -4
package/dist/default/index.mjs
CHANGED
|
@@ -4,448 +4,9 @@ import zod from "zod";
|
|
|
4
4
|
import { CryptoConfig, FingerprintGenerator, Xhshow } from "@ikenxuan/xhshow-ts";
|
|
5
5
|
import crypto, { createCipheriv, createHash, randomBytes, randomUUID } from "node:crypto";
|
|
6
6
|
import axios, { AxiosError } from "axios";
|
|
7
|
-
import { Chalk } from "chalk";
|
|
8
7
|
import protobuf from "protobufjs";
|
|
9
8
|
import express from "express";
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* 废弃 API 注册表
|
|
13
|
-
* 存储所有已注册的废弃 API 配置
|
|
14
|
-
*/
|
|
15
|
-
const deprecatedApis = /* @__PURE__ */ new Map();
|
|
16
|
-
/**
|
|
17
|
-
* 注册一个废弃的 API
|
|
18
|
-
*
|
|
19
|
-
* 将 API 添加到废弃注册表中,后续可通过 checkDeprecation 检查
|
|
20
|
-
*
|
|
21
|
-
* @param config - 废弃配置对象
|
|
22
|
-
*
|
|
23
|
-
* @example
|
|
24
|
-
* ```typescript
|
|
25
|
-
* registerDeprecatedApi({
|
|
26
|
-
* name: 'getDouyinData',
|
|
27
|
-
* deprecatedIn: '6.0.0',
|
|
28
|
-
* removedIn: '7.0.0',
|
|
29
|
-
* replacement: 'douyinFetcher',
|
|
30
|
-
* throwError: true
|
|
31
|
-
* })
|
|
32
|
-
* ```
|
|
33
|
-
*/
|
|
34
|
-
function registerDeprecatedApi(config) {
|
|
35
|
-
deprecatedApis.set(config.name, config);
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* 检查 API 是否已废弃并进行相应处理
|
|
39
|
-
*
|
|
40
|
-
* 如果 API 已注册为废弃,根据配置决定是打印警告还是抛出错误
|
|
41
|
-
*
|
|
42
|
-
* @param apiName - 要检查的 API 名称
|
|
43
|
-
* @throws {DeprecatedApiError} 如果 API 已废弃且配置为抛出错误
|
|
44
|
-
*
|
|
45
|
-
* @example
|
|
46
|
-
* ```typescript
|
|
47
|
-
* // 在函数开头调用检查
|
|
48
|
-
* function getDouyinData(options) {
|
|
49
|
-
* checkDeprecation('getDouyinData')
|
|
50
|
-
* // ...
|
|
51
|
-
* }
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
function checkDeprecation(apiName) {
|
|
55
|
-
const config = deprecatedApis.get(apiName);
|
|
56
|
-
if (!config) return;
|
|
57
|
-
const message = buildDeprecationMessage(config);
|
|
58
|
-
if (config.throwError) throw new DeprecatedApiError(message, config);
|
|
59
|
-
else console.warn(message);
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* 根据配置构建废弃提示消息
|
|
63
|
-
*
|
|
64
|
-
* @param config - 废弃配置
|
|
65
|
-
* @returns 格式化的废弃提示消息字符串
|
|
66
|
-
*/
|
|
67
|
-
function buildDeprecationMessage(config) {
|
|
68
|
-
const lines = [`[DEPRECATED] "${config.name}" 已在 v${config.deprecatedIn} 版本废弃。`];
|
|
69
|
-
if (config.replacement) lines.push(`请使用 "${config.replacement}" 替代。`);
|
|
70
|
-
else lines.push("此接口已被上游删除,无法继续使用,无可用替代方案。");
|
|
71
|
-
if (config.removedIn) lines.push(`此 API 将在 v${config.removedIn} 版本移除。`);
|
|
72
|
-
if (config.migrationGuide) lines.push(`迁移指南: ${config.migrationGuide}`);
|
|
73
|
-
return lines.join("\n");
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* 废弃 API 调用错误类
|
|
77
|
-
*
|
|
78
|
-
* 当调用已废弃且配置为抛出错误的 API 时抛出此错误
|
|
79
|
-
* 包含完整的废弃配置信息,便于调试和迁移
|
|
80
|
-
*/
|
|
81
|
-
var DeprecatedApiError = class DeprecatedApiError extends Error {
|
|
82
|
-
/** 废弃配置信息,包含替代方案等详细信息 */
|
|
83
|
-
config;
|
|
84
|
-
/**
|
|
85
|
-
* 创建废弃 API 错误实例
|
|
86
|
-
*
|
|
87
|
-
* @param message - 错误消息
|
|
88
|
-
* @param config - 废弃配置对象
|
|
89
|
-
*/
|
|
90
|
-
constructor(message, config) {
|
|
91
|
-
super(message);
|
|
92
|
-
this.name = "DeprecatedApiError";
|
|
93
|
-
this.config = config;
|
|
94
|
-
Error.captureStackTrace?.(this, DeprecatedApiError);
|
|
95
|
-
}
|
|
96
|
-
};
|
|
97
|
-
registerDeprecatedApi({
|
|
98
|
-
name: "getDouyinData",
|
|
99
|
-
deprecatedIn: "6.0.0",
|
|
100
|
-
removedIn: "7.0.0",
|
|
101
|
-
replacement: "douyinFetcher 或 client.douyin.fetcher",
|
|
102
|
-
migrationGuide: "https://github.com/ikenxuan/amagi/blob/main/packages/core/MIGRATION-v6.md",
|
|
103
|
-
throwError: true
|
|
104
|
-
});
|
|
105
|
-
registerDeprecatedApi({
|
|
106
|
-
name: "getBilibiliData",
|
|
107
|
-
deprecatedIn: "6.0.0",
|
|
108
|
-
removedIn: "7.0.0",
|
|
109
|
-
replacement: "bilibiliFetcher 或 client.bilibili.fetcher",
|
|
110
|
-
migrationGuide: "https://github.com/ikenxuan/amagi/blob/main/packages/core/MIGRATION-v6.md",
|
|
111
|
-
throwError: true
|
|
112
|
-
});
|
|
113
|
-
registerDeprecatedApi({
|
|
114
|
-
name: "getKuaishouData",
|
|
115
|
-
deprecatedIn: "6.0.0",
|
|
116
|
-
removedIn: "7.0.0",
|
|
117
|
-
replacement: "kuaishouFetcher 或 client.kuaishou.fetcher",
|
|
118
|
-
migrationGuide: "https://github.com/ikenxuan/amagi/blob/main/packages/core/MIGRATION-v6.md",
|
|
119
|
-
throwError: true
|
|
120
|
-
});
|
|
121
|
-
registerDeprecatedApi({
|
|
122
|
-
name: "getXiaohongshuData",
|
|
123
|
-
deprecatedIn: "6.0.0",
|
|
124
|
-
removedIn: "7.0.0",
|
|
125
|
-
replacement: "xiaohongshuFetcher 或 client.xiaohongshu.fetcher",
|
|
126
|
-
migrationGuide: "https://github.com/ikenxuan/amagi/blob/main/packages/core/MIGRATION-v6.md",
|
|
127
|
-
throwError: true
|
|
128
|
-
});
|
|
129
|
-
[
|
|
130
|
-
{
|
|
131
|
-
name: "单个视频作品数据",
|
|
132
|
-
replacement: "fetchVideoInfo"
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
name: "单个视频下载信息数据",
|
|
136
|
-
replacement: "fetchVideoStreamUrl"
|
|
137
|
-
},
|
|
138
|
-
{
|
|
139
|
-
name: "评论数据",
|
|
140
|
-
replacement: "fetchComments"
|
|
141
|
-
},
|
|
142
|
-
{
|
|
143
|
-
name: "指定评论的回复",
|
|
144
|
-
replacement: "fetchCommentReplies"
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
name: "用户主页数据",
|
|
148
|
-
replacement: "fetchUserCard"
|
|
149
|
-
},
|
|
150
|
-
{
|
|
151
|
-
name: "用户主页动态列表数据",
|
|
152
|
-
replacement: "fetchUserDynamicList"
|
|
153
|
-
},
|
|
154
|
-
{
|
|
155
|
-
name: "用户空间详细信息",
|
|
156
|
-
replacement: "fetchUserSpaceInfo"
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
name: "获取UP主总播放量",
|
|
160
|
-
replacement: "fetchUploaderTotalViews"
|
|
161
|
-
},
|
|
162
|
-
{
|
|
163
|
-
name: "Emoji数据",
|
|
164
|
-
replacement: "fetchEmojiList"
|
|
165
|
-
},
|
|
166
|
-
{
|
|
167
|
-
name: "番剧基本信息数据",
|
|
168
|
-
replacement: "fetchBangumiInfo"
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
name: "番剧下载信息数据",
|
|
172
|
-
replacement: "fetchBangumiStreamUrl"
|
|
173
|
-
},
|
|
174
|
-
{
|
|
175
|
-
name: "动态详情数据",
|
|
176
|
-
replacement: "fetchDynamicDetail"
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
name: "直播间信息",
|
|
180
|
-
replacement: "fetchLiveRoomInfo"
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
name: "直播间初始化信息",
|
|
184
|
-
replacement: "fetchLiveRoomInitInfo"
|
|
185
|
-
},
|
|
186
|
-
{
|
|
187
|
-
name: "登录基本信息",
|
|
188
|
-
replacement: "fetchLoginStatus"
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
name: "申请二维码",
|
|
192
|
-
replacement: "requestLoginQrcode"
|
|
193
|
-
},
|
|
194
|
-
{
|
|
195
|
-
name: "二维码状态",
|
|
196
|
-
replacement: "checkQrcodeStatus"
|
|
197
|
-
},
|
|
198
|
-
{
|
|
199
|
-
name: "AV转BV",
|
|
200
|
-
replacement: "convertAvToBv"
|
|
201
|
-
},
|
|
202
|
-
{
|
|
203
|
-
name: "BV转AV",
|
|
204
|
-
replacement: "convertBvToAv"
|
|
205
|
-
},
|
|
206
|
-
{
|
|
207
|
-
name: "专栏正文内容",
|
|
208
|
-
replacement: "fetchArticleContent"
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
name: "专栏显示卡片信息",
|
|
212
|
-
replacement: "fetchArticleCards"
|
|
213
|
-
},
|
|
214
|
-
{
|
|
215
|
-
name: "专栏文章基本信息",
|
|
216
|
-
replacement: "fetchArticleInfo"
|
|
217
|
-
},
|
|
218
|
-
{
|
|
219
|
-
name: "文集基本信息",
|
|
220
|
-
replacement: "fetchArticleListInfo"
|
|
221
|
-
},
|
|
222
|
-
{
|
|
223
|
-
name: "实时弹幕",
|
|
224
|
-
replacement: "fetchVideoDanmaku"
|
|
225
|
-
},
|
|
226
|
-
{
|
|
227
|
-
name: "从_v_voucher_申请_captcha",
|
|
228
|
-
replacement: "requestCaptchaFromVoucher"
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
name: "验证验证码结果",
|
|
232
|
-
replacement: "validateCaptchaResult"
|
|
233
|
-
},
|
|
234
|
-
{
|
|
235
|
-
name: "视频作品数据",
|
|
236
|
-
replacement: "fetchVideoWork"
|
|
237
|
-
},
|
|
238
|
-
{
|
|
239
|
-
name: "图集作品数据",
|
|
240
|
-
replacement: "fetchImageAlbumWork"
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
name: "合辑作品数据",
|
|
244
|
-
replacement: "fetchSlidesWork"
|
|
245
|
-
},
|
|
246
|
-
{
|
|
247
|
-
name: "文字作品数据",
|
|
248
|
-
replacement: "fetchTextWork"
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
name: "聚合解析",
|
|
252
|
-
replacement: "parseWork"
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
name: "指定评论回复数据",
|
|
256
|
-
replacement: "fetchCommentReplies"
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
name: "用户主页视频列表数据",
|
|
260
|
-
replacement: "fetchUserVideoList"
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
name: "热点词数据",
|
|
264
|
-
replacement: "fetchSuggestWords"
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
name: "搜索数据",
|
|
268
|
-
replacement: "searchContent"
|
|
269
|
-
},
|
|
270
|
-
{
|
|
271
|
-
name: "音乐数据",
|
|
272
|
-
replacement: "fetchMusicInfo"
|
|
273
|
-
},
|
|
274
|
-
{
|
|
275
|
-
name: "直播间信息数据",
|
|
276
|
-
replacement: "fetchLiveRoomInfo"
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
name: "申请二维码数据",
|
|
280
|
-
replacement: "requestLoginQrcode"
|
|
281
|
-
},
|
|
282
|
-
{
|
|
283
|
-
name: "动态表情数据",
|
|
284
|
-
replacement: "fetchDynamicEmojiList"
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
name: "弹幕数据",
|
|
288
|
-
replacement: "fetchDanmakuList"
|
|
289
|
-
},
|
|
290
|
-
{
|
|
291
|
-
name: "单个视频作品数据",
|
|
292
|
-
replacement: "fetchVideoWork"
|
|
293
|
-
},
|
|
294
|
-
{
|
|
295
|
-
name: "首页推荐数据",
|
|
296
|
-
replacement: "fetchHomeFeed"
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
name: "单个笔记数据",
|
|
300
|
-
replacement: "fetchNoteDetail"
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
name: "用户数据",
|
|
304
|
-
replacement: "fetchUserProfile"
|
|
305
|
-
},
|
|
306
|
-
{
|
|
307
|
-
name: "用户笔记数据",
|
|
308
|
-
replacement: "fetchUserNoteList"
|
|
309
|
-
},
|
|
310
|
-
{
|
|
311
|
-
name: "表情列表",
|
|
312
|
-
replacement: "fetchEmojiList"
|
|
313
|
-
},
|
|
314
|
-
{
|
|
315
|
-
name: "搜索笔记",
|
|
316
|
-
replacement: "searchNotes"
|
|
317
|
-
}
|
|
318
|
-
].forEach(({ name, replacement }) => {
|
|
319
|
-
registerDeprecatedApi({
|
|
320
|
-
name: `methodType: '${name}'`,
|
|
321
|
-
deprecatedIn: "6.0.0",
|
|
322
|
-
removedIn: "7.0.0",
|
|
323
|
-
replacement: `fetcher.${replacement}()`,
|
|
324
|
-
throwError: true
|
|
325
|
-
});
|
|
326
|
-
});
|
|
327
|
-
registerDeprecatedApi({
|
|
328
|
-
name: `methodType: '动态卡片数据'`,
|
|
329
|
-
deprecatedIn: "6.0.0",
|
|
330
|
-
removedIn: "7.0.0",
|
|
331
|
-
migrationGuide: "https://amagi-docs.vercel.app/docs/changelog/6.1.3",
|
|
332
|
-
throwError: false
|
|
333
|
-
});
|
|
334
|
-
registerDeprecatedApi({
|
|
335
|
-
name: "fetchDynamicCard",
|
|
336
|
-
deprecatedIn: "6.1.3",
|
|
337
|
-
removedIn: "7.0.0",
|
|
338
|
-
migrationGuide: "https://amagi-docs.vercel.app/docs/changelog/6.1.3",
|
|
339
|
-
throwError: false
|
|
340
|
-
});
|
|
341
|
-
//#endregion
|
|
342
|
-
//#region src/model/DataFetchers.ts
|
|
343
|
-
/**
|
|
344
|
-
* 数据获取器模块 (已废弃)
|
|
345
|
-
*
|
|
346
|
-
* 此模块中的 getXXXData 函数已在 v6 版本废弃并移除
|
|
347
|
-
* 请使用新的 fetcher API 替代
|
|
348
|
-
*
|
|
349
|
-
* @module model/DataFetchers
|
|
350
|
-
* @deprecated v6 已废弃,请使用 fetcher API 替代
|
|
351
|
-
*/
|
|
352
|
-
/**
|
|
353
|
-
* 获取抖音数据
|
|
354
|
-
*
|
|
355
|
-
* @deprecated v6 已废弃,请使用 douyinFetcher 或 client.douyin.fetcher 替代
|
|
356
|
-
* @throws {DeprecatedApiError} 调用时抛出废弃错误
|
|
357
|
-
*
|
|
358
|
-
* @example
|
|
359
|
-
* ```typescript
|
|
360
|
-
* // 旧用法 (已废弃,会抛出错误)
|
|
361
|
-
* const data = await getDouyinData('videoWork', { aweme_id: '123' }, cookie)
|
|
362
|
-
*
|
|
363
|
-
* // 新用法
|
|
364
|
-
* import { douyinFetcher } from '@ikenxuan/amagi'
|
|
365
|
-
* const data = await douyinFetcher.fetchVideoWork({ aweme_id: '123' }, cookie)
|
|
366
|
-
*
|
|
367
|
-
* // 或使用客户端实例
|
|
368
|
-
* const client = createAmagiClient({ cookies: { douyin: cookie } })
|
|
369
|
-
* const data = await client.douyin.fetcher.fetchVideoWork({ aweme_id: '123' })
|
|
370
|
-
* ```
|
|
371
|
-
*/
|
|
372
|
-
function getDouyinData(..._args) {
|
|
373
|
-
checkDeprecation("getDouyinData");
|
|
374
|
-
throw new Error("getDouyinData 已废弃");
|
|
375
|
-
}
|
|
376
|
-
/**
|
|
377
|
-
* 获取B站数据
|
|
378
|
-
*
|
|
379
|
-
* @deprecated v6 已废弃,请使用 bilibiliFetcher 或 client.bilibili.fetcher 替代
|
|
380
|
-
* @throws {DeprecatedApiError} 调用时抛出废弃错误
|
|
381
|
-
*
|
|
382
|
-
* @example
|
|
383
|
-
* ```typescript
|
|
384
|
-
* // 旧用法 (已废弃,会抛出错误)
|
|
385
|
-
* const data = await getBilibiliData('videoInfo', { bvid: 'BV123' }, cookie)
|
|
386
|
-
*
|
|
387
|
-
* // 新用法
|
|
388
|
-
* import { bilibiliFetcher } from '@ikenxuan/amagi'
|
|
389
|
-
* const data = await bilibiliFetcher.fetchVideoInfo({ bvid: 'BV123' }, cookie)
|
|
390
|
-
*
|
|
391
|
-
* // 或使用客户端实例
|
|
392
|
-
* const client = createAmagiClient({ cookies: { bilibili: cookie } })
|
|
393
|
-
* const data = await client.bilibili.fetcher.fetchVideoInfo({ bvid: 'BV123' })
|
|
394
|
-
* ```
|
|
395
|
-
*/
|
|
396
|
-
function getBilibiliData(..._args) {
|
|
397
|
-
checkDeprecation("getBilibiliData");
|
|
398
|
-
throw new Error("getBilibiliData 已废弃");
|
|
399
|
-
}
|
|
400
|
-
/**
|
|
401
|
-
* 获取快手数据
|
|
402
|
-
*
|
|
403
|
-
* @deprecated v6 已废弃,请使用 kuaishouFetcher 或 client.kuaishou.fetcher 替代
|
|
404
|
-
* @throws {DeprecatedApiError} 调用时抛出废弃错误
|
|
405
|
-
*
|
|
406
|
-
* @example
|
|
407
|
-
* ```typescript
|
|
408
|
-
* // 旧用法 (已废弃,会抛出错误)
|
|
409
|
-
* const data = await getKuaishouData('videoWork', { photoId: '123' }, cookie)
|
|
410
|
-
*
|
|
411
|
-
* // 新用法
|
|
412
|
-
* import { kuaishouFetcher } from '@ikenxuan/amagi'
|
|
413
|
-
* const data = await kuaishouFetcher.fetchVideoWork({ photoId: '123' }, cookie)
|
|
414
|
-
*
|
|
415
|
-
* // 或使用客户端实例
|
|
416
|
-
* const client = createAmagiClient({ cookies: { kuaishou: cookie } })
|
|
417
|
-
* const data = await client.kuaishou.fetcher.fetchVideoWork({ photoId: '123' })
|
|
418
|
-
* ```
|
|
419
|
-
*/
|
|
420
|
-
function getKuaishouData(..._args) {
|
|
421
|
-
checkDeprecation("getKuaishouData");
|
|
422
|
-
throw new Error("getKuaishouData 已废弃");
|
|
423
|
-
}
|
|
424
|
-
/**
|
|
425
|
-
* 获取小红书数据
|
|
426
|
-
*
|
|
427
|
-
* @deprecated v6 已废弃,请使用 xiaohongshuFetcher 或 client.xiaohongshu.fetcher 替代
|
|
428
|
-
* @throws {DeprecatedApiError} 调用时抛出废弃错误
|
|
429
|
-
*
|
|
430
|
-
* @example
|
|
431
|
-
* ```typescript
|
|
432
|
-
* // 旧用法 (已废弃,会抛出错误)
|
|
433
|
-
* const data = await getXiaohongshuData('noteDetail', { note_id: '123' }, cookie)
|
|
434
|
-
*
|
|
435
|
-
* // 新用法
|
|
436
|
-
* import { xiaohongshuFetcher } from '@ikenxuan/amagi'
|
|
437
|
-
* const data = await xiaohongshuFetcher.fetchNoteDetail({ note_id: '123' }, cookie)
|
|
438
|
-
*
|
|
439
|
-
* // 或使用客户端实例
|
|
440
|
-
* const client = createAmagiClient({ cookies: { xiaohongshu: cookie } })
|
|
441
|
-
* const data = await client.xiaohongshu.fetcher.fetchNoteDetail({ note_id: '123' })
|
|
442
|
-
* ```
|
|
443
|
-
*/
|
|
444
|
-
function getXiaohongshuData(..._args) {
|
|
445
|
-
checkDeprecation("getXiaohongshuData");
|
|
446
|
-
throw new Error("getXiaohongshuData 已废弃");
|
|
447
|
-
}
|
|
448
|
-
//#endregion
|
|
9
|
+
import { Chalk } from "chalk";
|
|
449
10
|
//#region src/platform/bilibili/API.ts
|
|
450
11
|
/**
|
|
451
12
|
* B站 API URL 构建类
|
|
@@ -517,15 +78,6 @@ var BilibiliAPI = class {
|
|
|
517
78
|
getDynamicDetail(data) {
|
|
518
79
|
return `https://api.bilibili.com/x/polymer/web-dynamic/v1/detail?id=${data.dynamic_id}&features=itemOpusStyle,opusBigCover,onlyfansVote,endFooterHidden,decorationCard,onlyfansAssetsV2,ugcDelete,onlyfansQaCard,editable,opusPrivateVisible,avatarAutoTheme`;
|
|
519
80
|
}
|
|
520
|
-
/**
|
|
521
|
-
* 获取动态卡片信息
|
|
522
|
-
*
|
|
523
|
-
* @deprecated B站官方已于 `2025-08-09` 删除原 `dynamic_svr` 接口,该接口已停用。
|
|
524
|
-
* 调用将返回错误信息,请使用 {@link getDynamicDetail} 替代。
|
|
525
|
-
*/
|
|
526
|
-
getDynamicCard(data) {
|
|
527
|
-
return this.getDynamicDetail(data);
|
|
528
|
-
}
|
|
529
81
|
/** 获取用户名片信息 */
|
|
530
82
|
getUserCard(data) {
|
|
531
83
|
return `https://api.bilibili.com/x/web-interface/card?mid=${data.host_mid}&photo=true`;
|
|
@@ -617,86 +169,6 @@ var BilibiliAPI = class {
|
|
|
617
169
|
/** B站 API URL 构建器实例 */
|
|
618
170
|
const bilibiliApiUrls = new BilibiliAPI();
|
|
619
171
|
//#endregion
|
|
620
|
-
//#region src/platform/bilibili/BilibiliApi.ts
|
|
621
|
-
/**
|
|
622
|
-
* 创建废弃的 API 存根函数
|
|
623
|
-
*/
|
|
624
|
-
const createDeprecatedStub$3 = (methodName) => {
|
|
625
|
-
return (..._args) => {
|
|
626
|
-
checkDeprecation("getBilibiliData");
|
|
627
|
-
throw new Error(`bilibili.${methodName} 已废弃,请使用 bilibiliFetcher 替代`);
|
|
628
|
-
};
|
|
629
|
-
};
|
|
630
|
-
/**
|
|
631
|
-
* B站相关 API 的命名空间。
|
|
632
|
-
*
|
|
633
|
-
* @deprecated v6 已废弃,请使用 bilibiliFetcher 或 client.bilibili.fetcher 替代
|
|
634
|
-
*/
|
|
635
|
-
const bilibili = {
|
|
636
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchVideoInfo 替代 */
|
|
637
|
-
getVideoInfo: createDeprecatedStub$3("getVideoInfo"),
|
|
638
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchVideoStreamUrl 替代 */
|
|
639
|
-
getVideoStream: createDeprecatedStub$3("getVideoStream"),
|
|
640
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchComments 替代 */
|
|
641
|
-
getComments: createDeprecatedStub$3("getComments"),
|
|
642
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchCommentReplies 替代 */
|
|
643
|
-
getCommentReply: createDeprecatedStub$3("getCommentReply"),
|
|
644
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchUserCard 替代 */
|
|
645
|
-
getUserProfile: createDeprecatedStub$3("getUserProfile"),
|
|
646
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchUserDynamicList 替代 */
|
|
647
|
-
getUserDynamic: createDeprecatedStub$3("getUserDynamic"),
|
|
648
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchEmojiList 替代 */
|
|
649
|
-
getEmojiList: createDeprecatedStub$3("getEmojiList"),
|
|
650
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchBangumiInfo 替代 */
|
|
651
|
-
getBangumiInfo: createDeprecatedStub$3("getBangumiInfo"),
|
|
652
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchBangumiStreamUrl 替代 */
|
|
653
|
-
getBangumiStream: createDeprecatedStub$3("getBangumiStream"),
|
|
654
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchDynamicDetail 替代 */
|
|
655
|
-
getDynamicInfo: createDeprecatedStub$3("getDynamicInfo"),
|
|
656
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchDynamicCard 替代 */
|
|
657
|
-
getDynamicCard: createDeprecatedStub$3("getDynamicCard"),
|
|
658
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchLiveRoomInfo 替代 */
|
|
659
|
-
getLiveRoomDetail: createDeprecatedStub$3("getLiveRoomDetail"),
|
|
660
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchLiveRoomInitInfo 替代 */
|
|
661
|
-
getLiveRoomInitInfo: createDeprecatedStub$3("getLiveRoomInitInfo"),
|
|
662
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchLoginStatus 替代 */
|
|
663
|
-
getLoginBasicInfo: createDeprecatedStub$3("getLoginBasicInfo"),
|
|
664
|
-
/** @deprecated 请使用 bilibiliFetcher.requestLoginQrcode 替代 */
|
|
665
|
-
getLoginQrcode: createDeprecatedStub$3("getLoginQrcode"),
|
|
666
|
-
/** @deprecated 请使用 bilibiliFetcher.checkQrcodeStatus 替代 */
|
|
667
|
-
checkQrcodeStatus: createDeprecatedStub$3("checkQrcodeStatus"),
|
|
668
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchUploaderTotalViews 替代 */
|
|
669
|
-
getUserTotalPlayCount: createDeprecatedStub$3("getUserTotalPlayCount"),
|
|
670
|
-
/** @deprecated 请使用 bilibiliFetcher.convertAvToBv 替代 */
|
|
671
|
-
convertAvToBv: createDeprecatedStub$3("convertAvToBv"),
|
|
672
|
-
/** @deprecated 请使用 bilibiliFetcher.convertBvToAv 替代 */
|
|
673
|
-
convertBvToAv: createDeprecatedStub$3("convertBvToAv"),
|
|
674
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchArticleContent 替代 */
|
|
675
|
-
getArticleContent: createDeprecatedStub$3("getArticleContent"),
|
|
676
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchArticleCards 替代 */
|
|
677
|
-
getArticleCard: createDeprecatedStub$3("getArticleCard"),
|
|
678
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchArticleInfo 替代 */
|
|
679
|
-
getArticleInfo: createDeprecatedStub$3("getArticleInfo"),
|
|
680
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchArticleListInfo 替代 */
|
|
681
|
-
getColumnInfo: createDeprecatedStub$3("getColumnInfo"),
|
|
682
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchUserSpaceInfo 替代 */
|
|
683
|
-
getUserProfileDetail: createDeprecatedStub$3("getUserProfileDetail"),
|
|
684
|
-
/** @deprecated 请使用 bilibiliFetcher.requestCaptchaFromVoucher 替代 */
|
|
685
|
-
applyVoucherCaptcha: createDeprecatedStub$3("applyVoucherCaptcha"),
|
|
686
|
-
/** @deprecated 请使用 bilibiliFetcher.validateCaptchaResult 替代 */
|
|
687
|
-
validateCaptcha: createDeprecatedStub$3("validateCaptcha"),
|
|
688
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchVideoDanmaku 替代 */
|
|
689
|
-
getDanmaku: createDeprecatedStub$3("getDanmaku")
|
|
690
|
-
};
|
|
691
|
-
/**
|
|
692
|
-
* 创建绑定了cookie的B站API对象
|
|
693
|
-
*
|
|
694
|
-
* @deprecated v6 已废弃,请使用 createBoundBilibiliFetcher 替代
|
|
695
|
-
*/
|
|
696
|
-
const createBoundBilibiliApi = (_cookie, _requestConfig) => {
|
|
697
|
-
return { ...bilibili };
|
|
698
|
-
};
|
|
699
|
-
//#endregion
|
|
700
172
|
//#region src/model/events.ts
|
|
701
173
|
/**
|
|
702
174
|
* Amagi 事件系统
|
|
@@ -1009,7 +481,7 @@ const BilibiliBangumiStreamParamsSchema = zod.object({
|
|
|
1009
481
|
});
|
|
1010
482
|
/** 动态参数验证 */
|
|
1011
483
|
const BilibiliDynamicParamsSchema = zod.object({
|
|
1012
|
-
methodType: zod.
|
|
484
|
+
methodType: zod.literal("dynamicDetail", { error: "方法类型必须是\"dynamicDetail\"" }),
|
|
1013
485
|
dynamic_id: zod.string({ error: "动态ID必须是字符串" }).min(1, { error: "动态ID不能为空" })
|
|
1014
486
|
});
|
|
1015
487
|
/** 直播间参数验证 */
|
|
@@ -1091,7 +563,6 @@ const BilibiliValidationSchemas = {
|
|
|
1091
563
|
bangumiInfo: BilibiliBangumiInfoParamsSchema,
|
|
1092
564
|
bangumiStream: BilibiliBangumiStreamParamsSchema,
|
|
1093
565
|
dynamicDetail: BilibiliDynamicParamsSchema,
|
|
1094
|
-
dynamicCard: BilibiliDynamicParamsSchema,
|
|
1095
566
|
liveRoomInfo: BilibiliLiveParamsSchema,
|
|
1096
567
|
liveRoomInit: BilibiliLiveParamsSchema,
|
|
1097
568
|
loginStatus: BilibiliLoginParamsSchema,
|
|
@@ -1122,7 +593,6 @@ const BilibiliMethodRoutes = {
|
|
|
1122
593
|
bangumiInfo: "/fetch_bangumi_video_info",
|
|
1123
594
|
bangumiStream: "/fetch_bangumi_video_playurl",
|
|
1124
595
|
dynamicDetail: "/fetch_dynamic_info",
|
|
1125
|
-
dynamicCard: "/fetch_dynamic_card",
|
|
1126
596
|
liveRoomInfo: "/fetch_live_room_detail",
|
|
1127
597
|
liveRoomInit: "/fetch_liveroom_def",
|
|
1128
598
|
loginStatus: "/login_basic_info",
|
|
@@ -1699,18 +1169,20 @@ const xiaohongshuApiUrls = {
|
|
|
1699
1169
|
* @returns 完整的接口URL
|
|
1700
1170
|
*/
|
|
1701
1171
|
noteComments(data) {
|
|
1172
|
+
const baseUrl = "https://edith.xiaohongshu.com/api/sns/web/v2/comment/page";
|
|
1173
|
+
const params = {
|
|
1174
|
+
note_id: data.note_id,
|
|
1175
|
+
cursor: data.cursor ?? "",
|
|
1176
|
+
image_formats: [
|
|
1177
|
+
"jpg",
|
|
1178
|
+
"webp",
|
|
1179
|
+
"avif"
|
|
1180
|
+
].join(","),
|
|
1181
|
+
xsec_token: data.xsec_token
|
|
1182
|
+
};
|
|
1702
1183
|
return {
|
|
1703
1184
|
apiPath: "/api/sns/web/v2/comment/page",
|
|
1704
|
-
Url:
|
|
1705
|
-
note_id: data.note_id,
|
|
1706
|
-
cursor: data.cursor ?? "",
|
|
1707
|
-
image_formats: [
|
|
1708
|
-
"jpg",
|
|
1709
|
-
"webp",
|
|
1710
|
-
"avif"
|
|
1711
|
-
].join(","),
|
|
1712
|
-
xsec_token: data.xsec_token
|
|
1713
|
-
})}`
|
|
1185
|
+
Url: `${baseUrl}?${buildQueryString$1(params)}`
|
|
1714
1186
|
};
|
|
1715
1187
|
},
|
|
1716
1188
|
/**
|
|
@@ -1730,19 +1202,21 @@ const xiaohongshuApiUrls = {
|
|
|
1730
1202
|
* @returns 完整的接口URL
|
|
1731
1203
|
*/
|
|
1732
1204
|
userNoteList(data) {
|
|
1205
|
+
const baseUrl = "https://edith.xiaohongshu.com/api/sns/web/v1/user_posted";
|
|
1206
|
+
const params = {
|
|
1207
|
+
user_id: data.user_id,
|
|
1208
|
+
cursor: data.cursor ?? "",
|
|
1209
|
+
num: data.num ?? 30,
|
|
1210
|
+
image_formats: [
|
|
1211
|
+
"jpg",
|
|
1212
|
+
"webp",
|
|
1213
|
+
"avif"
|
|
1214
|
+
].join(","),
|
|
1215
|
+
xsec_source: "pc_feed"
|
|
1216
|
+
};
|
|
1733
1217
|
return {
|
|
1734
1218
|
apiPath: "/api/sns/web/v1/user_posted",
|
|
1735
|
-
Url:
|
|
1736
|
-
user_id: data.user_id,
|
|
1737
|
-
cursor: data.cursor ?? "",
|
|
1738
|
-
num: data.num ?? 30,
|
|
1739
|
-
image_formats: [
|
|
1740
|
-
"jpg",
|
|
1741
|
-
"webp",
|
|
1742
|
-
"avif"
|
|
1743
|
-
].join(","),
|
|
1744
|
-
xsec_source: "pc_feed"
|
|
1745
|
-
})}`
|
|
1219
|
+
Url: `${baseUrl}?${buildQueryString$1(params)}`
|
|
1746
1220
|
};
|
|
1747
1221
|
},
|
|
1748
1222
|
/**
|
|
@@ -1959,7 +1433,8 @@ const createErrorResponse = (error, message, code = 500, data) => {
|
|
|
1959
1433
|
async function fetchBilibiliInternal(methodType, options, config) {
|
|
1960
1434
|
const startTime = Date.now();
|
|
1961
1435
|
try {
|
|
1962
|
-
const
|
|
1436
|
+
const apiParams = { ...validateBilibiliParams(methodType, options) };
|
|
1437
|
+
const rawData = await fetchBilibili(apiParams, config.cookie, config.requestConfig);
|
|
1963
1438
|
const duration = Date.now() - startTime;
|
|
1964
1439
|
if (rawData.code !== 0) {
|
|
1965
1440
|
const errorMessage = rawData.message || "B站数据获取失败";
|
|
@@ -1971,11 +1446,12 @@ async function fetchBilibiliInternal(methodType, options, config) {
|
|
|
1971
1446
|
url: void 0,
|
|
1972
1447
|
duration
|
|
1973
1448
|
});
|
|
1974
|
-
|
|
1449
|
+
const amagiError = rawData.amagiError ?? {
|
|
1975
1450
|
errorDescription: errorMessage,
|
|
1976
1451
|
requestType: methodType,
|
|
1977
1452
|
requestUrl: void 0
|
|
1978
|
-
}
|
|
1453
|
+
};
|
|
1454
|
+
return createErrorResponse(amagiError, errorMessage, rawData.code, rawData);
|
|
1979
1455
|
}
|
|
1980
1456
|
const result = createSuccessResponse(rawData, "获取成功", 200);
|
|
1981
1457
|
emitApiSuccess({
|
|
@@ -2282,31 +1758,6 @@ async function fetchDynamicDetail(options, cookie, requestConfig) {
|
|
|
2282
1758
|
requestConfig
|
|
2283
1759
|
});
|
|
2284
1760
|
}
|
|
2285
|
-
/**
|
|
2286
|
-
* 获取B站动态卡片信息
|
|
2287
|
-
*
|
|
2288
|
-
* @deprecated v6.1.3 已废弃,B站官方已于 `2025-08-09` 删除原 `dynamic_svr` 接口。
|
|
2289
|
-
* 调用将返回错误信息
|
|
2290
|
-
* 计划于 v7.0.0 移除。
|
|
2291
|
-
*
|
|
2292
|
-
* @param options - 动态参数
|
|
2293
|
-
* @param options.dynamic_id - 动态 ID
|
|
2294
|
-
* @param cookie - B站 Cookie (可选)
|
|
2295
|
-
* @param requestConfig - 请求配置 (可选)
|
|
2296
|
-
* @returns 动态卡片数据(已停用,返回错误信息)
|
|
2297
|
-
* @example
|
|
2298
|
-
* ```typescript
|
|
2299
|
-
* const result = await fetchDynamicCard({ dynamic_id: '123456789' }, cookie)
|
|
2300
|
-
* // result.success === false,错误信息提示接口已停用
|
|
2301
|
-
* ```
|
|
2302
|
-
*/
|
|
2303
|
-
async function fetchDynamicCard(options, cookie, requestConfig) {
|
|
2304
|
-
checkDeprecation("fetchDynamicCard");
|
|
2305
|
-
return fetchBilibiliInternal("dynamicCard", options, {
|
|
2306
|
-
cookie,
|
|
2307
|
-
requestConfig
|
|
2308
|
-
});
|
|
2309
|
-
}
|
|
2310
1761
|
//#endregion
|
|
2311
1762
|
//#region src/model/fetchers/bilibili/live.ts
|
|
2312
1763
|
/**
|
|
@@ -2566,6 +2017,37 @@ async function fetchVideoDanmaku(options, cookie, requestConfig) {
|
|
|
2566
2017
|
});
|
|
2567
2018
|
}
|
|
2568
2019
|
//#endregion
|
|
2020
|
+
//#region src/model/fetchers/shared/request-config.ts
|
|
2021
|
+
/**
|
|
2022
|
+
* 合并 Fetcher 的实例级请求配置与单次请求配置。
|
|
2023
|
+
*
|
|
2024
|
+
* 单次配置优先,请求头单独合并。函数不会修改任一入参,因此同一绑定
|
|
2025
|
+
* Fetcher 可以安全地在并发任务中为不同请求使用不同配置。
|
|
2026
|
+
*/
|
|
2027
|
+
const mergeRequestConfig = (base, override) => {
|
|
2028
|
+
if (!override) return base;
|
|
2029
|
+
return {
|
|
2030
|
+
...base ?? {},
|
|
2031
|
+
...override,
|
|
2032
|
+
headers: {
|
|
2033
|
+
...base?.headers ?? {},
|
|
2034
|
+
...override.headers ?? {}
|
|
2035
|
+
}
|
|
2036
|
+
};
|
|
2037
|
+
};
|
|
2038
|
+
/**
|
|
2039
|
+
* 解析绑定 Fetcher 当前调用实际使用的 cookie 与请求配置。
|
|
2040
|
+
*
|
|
2041
|
+
* 实例级或单次配置显式提供大写 `headers.Cookie` 时,合并后的值同时替换
|
|
2042
|
+
* 底层 Fetcher 的 cookie 参数,确保平台签名、前置请求和最终请求处于同一身份状态。
|
|
2043
|
+
*/
|
|
2044
|
+
const resolveBoundRequest = (boundCookie, base, override) => {
|
|
2045
|
+
const requestConfig = mergeRequestConfig(base, override);
|
|
2046
|
+
const headers = requestConfig?.headers;
|
|
2047
|
+
const cookieOverride = Boolean(headers && Object.prototype.hasOwnProperty.call(headers, "Cookie")) ? headers.Cookie : void 0;
|
|
2048
|
+
return [typeof cookieOverride === "string" ? cookieOverride : boundCookie, requestConfig];
|
|
2049
|
+
};
|
|
2050
|
+
//#endregion
|
|
2569
2051
|
//#region src/model/fetchers/bilibili/bound.ts
|
|
2570
2052
|
/**
|
|
2571
2053
|
* 创建绑定了 Cookie 和请求配置的 B站 Fetcher
|
|
@@ -2581,36 +2063,35 @@ async function fetchVideoDanmaku(options, cookie, requestConfig) {
|
|
|
2581
2063
|
* ```
|
|
2582
2064
|
*/
|
|
2583
2065
|
function createBoundBilibiliFetcher(cookie, requestConfig) {
|
|
2066
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
2584
2067
|
return {
|
|
2585
|
-
fetchVideoInfo: (options) => fetchVideoInfo(options,
|
|
2586
|
-
fetchVideoStreamUrl: (options) => fetchVideoStreamUrl(options,
|
|
2587
|
-
fetchVideoDanmaku: (options) => fetchVideoDanmaku(options,
|
|
2588
|
-
fetchComments: (options) => fetchComments(options,
|
|
2589
|
-
fetchCommentReplies: (options) => fetchCommentReplies$1(options,
|
|
2590
|
-
fetchUserCard: (options) => fetchUserCard(options,
|
|
2591
|
-
fetchUserDynamicList: (options) => fetchUserDynamicList(options,
|
|
2592
|
-
fetchUserLiveStatus: (options) => fetchUserLiveStatus(options,
|
|
2593
|
-
fetchUserSpaceInfo: (options) => fetchUserSpaceInfo(options,
|
|
2594
|
-
fetchUploaderTotalViews: (options) => fetchUploaderTotalViews(options,
|
|
2595
|
-
fetchDynamicDetail: (options) => fetchDynamicDetail(options,
|
|
2596
|
-
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
|
|
2606
|
-
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
convertBvToAv: (options) => convertBvToAv(options, cookie, requestConfig),
|
|
2613
|
-
fetchEmojiList: (options) => fetchEmojiList$3(options, cookie, requestConfig)
|
|
2068
|
+
fetchVideoInfo: (options, override) => fetchVideoInfo(options, ...resolveRequest(override)),
|
|
2069
|
+
fetchVideoStreamUrl: (options, override) => fetchVideoStreamUrl(options, ...resolveRequest(override)),
|
|
2070
|
+
fetchVideoDanmaku: (options, override) => fetchVideoDanmaku(options, ...resolveRequest(override)),
|
|
2071
|
+
fetchComments: (options, override) => fetchComments(options, ...resolveRequest(override)),
|
|
2072
|
+
fetchCommentReplies: (options, override) => fetchCommentReplies$1(options, ...resolveRequest(override)),
|
|
2073
|
+
fetchUserCard: (options, override) => fetchUserCard(options, ...resolveRequest(override)),
|
|
2074
|
+
fetchUserDynamicList: (options, override) => fetchUserDynamicList(options, ...resolveRequest(override)),
|
|
2075
|
+
fetchUserLiveStatus: (options, override) => fetchUserLiveStatus(options, ...resolveRequest(override)),
|
|
2076
|
+
fetchUserSpaceInfo: (options, override) => fetchUserSpaceInfo(options, ...resolveRequest(override)),
|
|
2077
|
+
fetchUploaderTotalViews: (options, override) => fetchUploaderTotalViews(options, ...resolveRequest(override)),
|
|
2078
|
+
fetchDynamicDetail: (options, override) => fetchDynamicDetail(options, ...resolveRequest(override)),
|
|
2079
|
+
fetchBangumiInfo: (options, override) => fetchBangumiInfo(options, ...resolveRequest(override)),
|
|
2080
|
+
fetchBangumiStreamUrl: (options, override) => fetchBangumiStreamUrl(options, ...resolveRequest(override)),
|
|
2081
|
+
fetchLiveRoomInfo: (options, override) => fetchLiveRoomInfo$2(options, ...resolveRequest(override)),
|
|
2082
|
+
fetchLiveRoomInitInfo: (options, override) => fetchLiveRoomInitInfo(options, ...resolveRequest(override)),
|
|
2083
|
+
fetchArticleContent: (options, override) => fetchArticleContent(options, ...resolveRequest(override)),
|
|
2084
|
+
fetchArticleCards: (options, override) => fetchArticleCards(options, ...resolveRequest(override)),
|
|
2085
|
+
fetchArticleInfo: (options, override) => fetchArticleInfo(options, ...resolveRequest(override)),
|
|
2086
|
+
fetchArticleListInfo: (options, override) => fetchArticleListInfo(options, ...resolveRequest(override)),
|
|
2087
|
+
fetchLoginStatus: (options, override) => fetchLoginStatus(options, ...resolveRequest(override)),
|
|
2088
|
+
requestLoginQrcode: (options, override) => requestLoginQrcode$1(options, ...resolveRequest(override)),
|
|
2089
|
+
checkQrcodeStatus: (options, override) => checkQrcodeStatus(options, ...resolveRequest(override)),
|
|
2090
|
+
requestCaptchaFromVoucher: (options, override) => requestCaptchaFromVoucher(options, ...resolveRequest(override)),
|
|
2091
|
+
validateCaptchaResult: (options, override) => validateCaptchaResult(options, ...resolveRequest(override)),
|
|
2092
|
+
convertAvToBv: (options, override) => convertAvToBv(options, ...resolveRequest(override)),
|
|
2093
|
+
convertBvToAv: (options, override) => convertBvToAv(options, ...resolveRequest(override)),
|
|
2094
|
+
fetchEmojiList: (options, override) => fetchEmojiList$3(options, ...resolveRequest(override))
|
|
2614
2095
|
};
|
|
2615
2096
|
}
|
|
2616
2097
|
//#endregion
|
|
@@ -2641,7 +2122,6 @@ const bilibiliFetcher = {
|
|
|
2641
2122
|
fetchUserSpaceInfo,
|
|
2642
2123
|
fetchUploaderTotalViews,
|
|
2643
2124
|
fetchDynamicDetail,
|
|
2644
|
-
fetchDynamicCard,
|
|
2645
2125
|
fetchBangumiInfo,
|
|
2646
2126
|
fetchBangumiStreamUrl,
|
|
2647
2127
|
fetchLiveRoomInfo: fetchLiveRoomInfo$2,
|
|
@@ -3023,8 +2503,6 @@ function result_encrypt(long_str, num) {
|
|
|
3023
2503
|
case 3:
|
|
3024
2504
|
temp_int = long_int & 63;
|
|
3025
2505
|
result += constant["str"].charAt(temp_int);
|
|
3026
|
-
break;
|
|
3027
|
-
default: break;
|
|
3028
2506
|
}
|
|
3029
2507
|
}
|
|
3030
2508
|
return result;
|
|
@@ -3526,7 +3004,8 @@ var DouyinAPI = class {
|
|
|
3526
3004
|
}
|
|
3527
3005
|
/** 获取视频或图集数据 */
|
|
3528
3006
|
getWorkDetail(data) {
|
|
3529
|
-
|
|
3007
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/aweme/detail/";
|
|
3008
|
+
const params = {
|
|
3530
3009
|
...this.getBaseParams(),
|
|
3531
3010
|
aweme_id: data.aweme_id,
|
|
3532
3011
|
update_version_code: "170400",
|
|
@@ -3536,11 +3015,13 @@ var DouyinAPI = class {
|
|
|
3536
3015
|
screen_height: "1310",
|
|
3537
3016
|
round_trip_time: "150",
|
|
3538
3017
|
webid: "7351848354471872041"
|
|
3539
|
-
}
|
|
3018
|
+
};
|
|
3019
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3540
3020
|
}
|
|
3541
3021
|
/** 获取评论数据 */
|
|
3542
3022
|
getComments(data) {
|
|
3543
|
-
|
|
3023
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/comment/list/";
|
|
3024
|
+
const params = {
|
|
3544
3025
|
...this.getBaseParams(),
|
|
3545
3026
|
aweme_id: data.aweme_id,
|
|
3546
3027
|
cursor: data.cursor ?? 0,
|
|
@@ -3555,11 +3036,13 @@ var DouyinAPI = class {
|
|
|
3555
3036
|
screen_width: "1552",
|
|
3556
3037
|
screen_height: "970",
|
|
3557
3038
|
round_trip_time: "50"
|
|
3558
|
-
}
|
|
3039
|
+
};
|
|
3040
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3559
3041
|
}
|
|
3560
3042
|
/** 获取二级评论数据 */
|
|
3561
3043
|
getCommentReplies(data) {
|
|
3562
|
-
|
|
3044
|
+
const baseUrl = "https://www-hj.douyin.com/aweme/v1/web/comment/list/reply/";
|
|
3045
|
+
const params = {
|
|
3563
3046
|
device_platform: "webapp",
|
|
3564
3047
|
aid: "6383",
|
|
3565
3048
|
channel: "channel_pc_web",
|
|
@@ -3597,11 +3080,13 @@ var DouyinAPI = class {
|
|
|
3597
3080
|
webid: "7487210762873685515",
|
|
3598
3081
|
verifyFp: fp,
|
|
3599
3082
|
fp
|
|
3600
|
-
}
|
|
3083
|
+
};
|
|
3084
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3601
3085
|
}
|
|
3602
3086
|
/** 获取动图数据 */
|
|
3603
3087
|
getSlidesInfo(data) {
|
|
3604
|
-
|
|
3088
|
+
const baseUrl = "https://www.iesdouyin.com/web/api/v2/aweme/slidesinfo/";
|
|
3089
|
+
const params = {
|
|
3605
3090
|
reflow_source: "reflow_page",
|
|
3606
3091
|
web_id: "7326472315356857893",
|
|
3607
3092
|
device_id: "7326472315356857893",
|
|
@@ -3610,7 +3095,8 @@ var DouyinAPI = class {
|
|
|
3610
3095
|
msToken: douyinSign.Mstoken(116),
|
|
3611
3096
|
verifyFp: fp,
|
|
3612
3097
|
fp
|
|
3613
|
-
}
|
|
3098
|
+
};
|
|
3099
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3614
3100
|
}
|
|
3615
3101
|
/** 获取表情数据 */
|
|
3616
3102
|
getEmojiList() {
|
|
@@ -3618,7 +3104,8 @@ var DouyinAPI = class {
|
|
|
3618
3104
|
}
|
|
3619
3105
|
/** 获取用户主页视频数据 */
|
|
3620
3106
|
getUserVideoList(data) {
|
|
3621
|
-
|
|
3107
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/aweme/post/";
|
|
3108
|
+
const params = {
|
|
3622
3109
|
...this.getBaseParams(),
|
|
3623
3110
|
sec_user_id: data.sec_uid,
|
|
3624
3111
|
max_cursor: data.max_cursor ?? "0",
|
|
@@ -3636,11 +3123,13 @@ var DouyinAPI = class {
|
|
|
3636
3123
|
screen_height: "970",
|
|
3637
3124
|
round_trip_time: "50",
|
|
3638
3125
|
webid: "7338423850134226495"
|
|
3639
|
-
}
|
|
3126
|
+
};
|
|
3127
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3640
3128
|
}
|
|
3641
3129
|
/** 获取用户喜欢列表数据 */
|
|
3642
3130
|
getUserFavoriteList(data) {
|
|
3643
|
-
|
|
3131
|
+
const baseUrl = "https://www-hj.douyin.com/aweme/v1/web/aweme/favorite/";
|
|
3132
|
+
const params = {
|
|
3644
3133
|
...this.getBaseParams(),
|
|
3645
3134
|
sec_user_id: data.sec_uid,
|
|
3646
3135
|
max_cursor: data.max_cursor ?? "0",
|
|
@@ -3659,11 +3148,13 @@ var DouyinAPI = class {
|
|
|
3659
3148
|
screen_height: "1310",
|
|
3660
3149
|
round_trip_time: "0",
|
|
3661
3150
|
webid: "7487210762873685515"
|
|
3662
|
-
}
|
|
3151
|
+
};
|
|
3152
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3663
3153
|
}
|
|
3664
3154
|
/** 获取用户推荐列表数据 */
|
|
3665
3155
|
getUserRecommendList(data) {
|
|
3666
|
-
|
|
3156
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/familiar/recommend/feed/";
|
|
3157
|
+
const params = {
|
|
3667
3158
|
device_platform: "",
|
|
3668
3159
|
aid: "6383",
|
|
3669
3160
|
channel: "channel_pc_web",
|
|
@@ -3702,11 +3193,13 @@ var DouyinAPI = class {
|
|
|
3702
3193
|
msToken: douyinSign.Mstoken(184),
|
|
3703
3194
|
verifyFp: fp,
|
|
3704
3195
|
fp
|
|
3705
|
-
}
|
|
3196
|
+
};
|
|
3197
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3706
3198
|
}
|
|
3707
3199
|
/** 获取用户主页信息 */
|
|
3708
3200
|
getUserProfile(data) {
|
|
3709
|
-
|
|
3201
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/user/profile/other/";
|
|
3202
|
+
const params = {
|
|
3710
3203
|
...this.getBaseParams(),
|
|
3711
3204
|
publish_video_strategy_type: "2",
|
|
3712
3205
|
source: "channel_pc_web",
|
|
@@ -3718,11 +3211,13 @@ var DouyinAPI = class {
|
|
|
3718
3211
|
screen_height: "970",
|
|
3719
3212
|
round_trip_time: "0",
|
|
3720
3213
|
webid: "7327957959955580467"
|
|
3721
|
-
}
|
|
3214
|
+
};
|
|
3215
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3722
3216
|
}
|
|
3723
3217
|
/** 获取热点词数据 */
|
|
3724
3218
|
getSuggestWords(data) {
|
|
3725
|
-
|
|
3219
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/api/suggest_words/";
|
|
3220
|
+
const params = {
|
|
3726
3221
|
...this.getBaseParams(),
|
|
3727
3222
|
query: data.query,
|
|
3728
3223
|
business_id: "30088",
|
|
@@ -3733,91 +3228,103 @@ var DouyinAPI = class {
|
|
|
3733
3228
|
screen_height: "970",
|
|
3734
3229
|
round_trip_time: "50",
|
|
3735
3230
|
webid: "7327957959955580467"
|
|
3736
|
-
}
|
|
3231
|
+
};
|
|
3232
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3737
3233
|
}
|
|
3738
3234
|
/** 获取搜索数据 */
|
|
3739
3235
|
search(data) {
|
|
3740
3236
|
const searchType = data.type ?? "general";
|
|
3741
3237
|
const { verifyFp, fp, ...baseParamsWithoutFp } = this.getBaseParams();
|
|
3742
|
-
if (searchType === "user")
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
3778
|
-
|
|
3779
|
-
|
|
3780
|
-
|
|
3781
|
-
|
|
3782
|
-
|
|
3783
|
-
|
|
3784
|
-
|
|
3785
|
-
|
|
3786
|
-
|
|
3787
|
-
|
|
3788
|
-
|
|
3789
|
-
|
|
3790
|
-
|
|
3791
|
-
|
|
3792
|
-
|
|
3793
|
-
|
|
3794
|
-
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3238
|
+
if (searchType === "user") {
|
|
3239
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/discover/search/";
|
|
3240
|
+
const params = {
|
|
3241
|
+
...baseParamsWithoutFp,
|
|
3242
|
+
count: data.number ?? 10,
|
|
3243
|
+
disable_rs: "0",
|
|
3244
|
+
from_group_id: "",
|
|
3245
|
+
is_filter_search: "0",
|
|
3246
|
+
keyword: data.query,
|
|
3247
|
+
list_type: "single",
|
|
3248
|
+
need_filter_settings: "1",
|
|
3249
|
+
offset: "0",
|
|
3250
|
+
pc_libra_divert: "Windows",
|
|
3251
|
+
pc_search_top_1_params: "{\"enable_ai_search_top_1\":1}",
|
|
3252
|
+
query_correct_type: "1",
|
|
3253
|
+
round_trip_time: "250",
|
|
3254
|
+
screen_height: "1310",
|
|
3255
|
+
screen_width: "2328",
|
|
3256
|
+
search_channel: "aweme_user_web",
|
|
3257
|
+
search_source: "switch_tab",
|
|
3258
|
+
support_dash: "1",
|
|
3259
|
+
support_h265: "1",
|
|
3260
|
+
version_code: "170400",
|
|
3261
|
+
version_name: "17.4.0",
|
|
3262
|
+
webid: "7521399115230610959",
|
|
3263
|
+
...data.search_id && { search_id: data.search_id }
|
|
3264
|
+
};
|
|
3265
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3266
|
+
} else if (searchType === "video") {
|
|
3267
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/search/item/";
|
|
3268
|
+
const params = {
|
|
3269
|
+
...baseParamsWithoutFp,
|
|
3270
|
+
count: data.number ?? 10,
|
|
3271
|
+
disable_rs: "0",
|
|
3272
|
+
enable_history: "1",
|
|
3273
|
+
from_group_id: "",
|
|
3274
|
+
is_filter_search: "0",
|
|
3275
|
+
keyword: data.query,
|
|
3276
|
+
list_type: "single",
|
|
3277
|
+
need_filter_settings: "1",
|
|
3278
|
+
offset: "0",
|
|
3279
|
+
pc_libra_divert: "Windows",
|
|
3280
|
+
pc_search_top_1_params: "{\"enable_ai_search_top_1\":1}",
|
|
3281
|
+
query_correct_type: "1",
|
|
3282
|
+
round_trip_time: "50",
|
|
3283
|
+
screen_height: "1310",
|
|
3284
|
+
screen_width: "2328",
|
|
3285
|
+
search_channel: "aweme_video_web",
|
|
3286
|
+
search_source: "switch_tab",
|
|
3287
|
+
support_dash: "1",
|
|
3288
|
+
support_h265: "1",
|
|
3289
|
+
version_code: "170400",
|
|
3290
|
+
version_name: "17.4.0",
|
|
3291
|
+
webid: "7521399115230610959",
|
|
3292
|
+
...data.search_id && { search_id: data.search_id }
|
|
3293
|
+
};
|
|
3294
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3295
|
+
} else {
|
|
3296
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/general/search/stream/";
|
|
3297
|
+
const params = {
|
|
3298
|
+
...baseParamsWithoutFp,
|
|
3299
|
+
count: data.number ?? 10,
|
|
3300
|
+
disable_rs: "0",
|
|
3301
|
+
enable_history: "1",
|
|
3302
|
+
is_filter_search: "0",
|
|
3303
|
+
keyword: data.query,
|
|
3304
|
+
list_type: "",
|
|
3305
|
+
need_filter_settings: "1",
|
|
3306
|
+
offset: "0",
|
|
3307
|
+
pc_libra_divert: "Windows",
|
|
3308
|
+
pc_search_top_1_params: "{\"enable_ai_search_top_1\":1}",
|
|
3309
|
+
query_correct_type: "1",
|
|
3310
|
+
round_trip_time: "0",
|
|
3311
|
+
screen_height: "1310",
|
|
3312
|
+
screen_width: "2328",
|
|
3313
|
+
search_channel: "aweme_general",
|
|
3314
|
+
search_source: "normal_search",
|
|
3315
|
+
support_dash: "1",
|
|
3316
|
+
support_h265: "1",
|
|
3317
|
+
version_code: "190600",
|
|
3318
|
+
version_name: "19.6.0",
|
|
3319
|
+
webid: "7521399115230610959"
|
|
3320
|
+
};
|
|
3321
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3322
|
+
}
|
|
3817
3323
|
}
|
|
3818
3324
|
/** 获取互动表情数据 */
|
|
3819
3325
|
getDynamicEmojiList() {
|
|
3820
|
-
|
|
3326
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/im/strategy/config";
|
|
3327
|
+
const params = {
|
|
3821
3328
|
device_platform: "webapp",
|
|
3822
3329
|
aid: "1128",
|
|
3823
3330
|
channel: "channel_pc_web",
|
|
@@ -3849,11 +3356,13 @@ var DouyinAPI = class {
|
|
|
3849
3356
|
msToken: douyinSign.Mstoken(116),
|
|
3850
3357
|
verifyFp: fp,
|
|
3851
3358
|
fp
|
|
3852
|
-
}
|
|
3359
|
+
};
|
|
3360
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3853
3361
|
}
|
|
3854
3362
|
/** 获取背景音乐数据 */
|
|
3855
3363
|
getMusicInfo(data) {
|
|
3856
|
-
|
|
3364
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/music/detail/";
|
|
3365
|
+
const params = {
|
|
3857
3366
|
device_platform: "webapp",
|
|
3858
3367
|
aid: "6383",
|
|
3859
3368
|
channel: "channel_pc_web",
|
|
@@ -3884,11 +3393,13 @@ var DouyinAPI = class {
|
|
|
3884
3393
|
msToken: douyinSign.Mstoken(116),
|
|
3885
3394
|
verifyFp: fp,
|
|
3886
3395
|
fp
|
|
3887
|
-
}
|
|
3396
|
+
};
|
|
3397
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3888
3398
|
}
|
|
3889
3399
|
/** 获取直播间信息 */
|
|
3890
3400
|
getLiveRoomInfo(data) {
|
|
3891
|
-
|
|
3401
|
+
const baseUrl = "https://live.douyin.com/webcast/room/web/enter/";
|
|
3402
|
+
const params = {
|
|
3892
3403
|
aid: "6383",
|
|
3893
3404
|
app_name: "douyin_web",
|
|
3894
3405
|
live_id: "1",
|
|
@@ -3911,18 +3422,22 @@ var DouyinAPI = class {
|
|
|
3911
3422
|
msToken: douyinSign.Mstoken(116),
|
|
3912
3423
|
verifyFp: fp,
|
|
3913
3424
|
fp
|
|
3914
|
-
}
|
|
3425
|
+
};
|
|
3426
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3915
3427
|
}
|
|
3916
3428
|
/** 申请登录二维码 */
|
|
3917
3429
|
getLoginQrcode(data) {
|
|
3918
|
-
|
|
3430
|
+
const baseUrl = "https://sso.douyin.com/get_qrcode/";
|
|
3431
|
+
const params = {
|
|
3919
3432
|
verifyFp: data.verify_fp,
|
|
3920
3433
|
fp: data.verify_fp
|
|
3921
|
-
}
|
|
3434
|
+
};
|
|
3435
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3922
3436
|
}
|
|
3923
3437
|
/** 获取弹幕数据 */
|
|
3924
3438
|
getDanmakuList(data) {
|
|
3925
|
-
|
|
3439
|
+
const baseUrl = "https://www-hj.douyin.com/aweme/v1/web/danmaku/get_v2/";
|
|
3440
|
+
const params = {
|
|
3926
3441
|
...this.getBaseParams(),
|
|
3927
3442
|
app_name: "aweme",
|
|
3928
3443
|
format: "json",
|
|
@@ -3949,7 +3464,8 @@ var DouyinAPI = class {
|
|
|
3949
3464
|
msToken: douyinSign.Mstoken(116),
|
|
3950
3465
|
verifyFp: fp,
|
|
3951
3466
|
fp
|
|
3952
|
-
}
|
|
3467
|
+
};
|
|
3468
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3953
3469
|
}
|
|
3954
3470
|
};
|
|
3955
3471
|
/**
|
|
@@ -3971,7 +3487,6 @@ const douyinApiUrls = new DouyinAPI();
|
|
|
3971
3487
|
* 提供抖音各类数据的获取功能,包括视频、评论、用户等
|
|
3972
3488
|
*
|
|
3973
3489
|
* 注意:为避免循环依赖,此文件直接从具体模块导入,而不是从平台 index 文件导入
|
|
3974
|
-
* 循环依赖链:DataFetchers → getdata → platform/douyin → DataFetchers
|
|
3975
3490
|
*
|
|
3976
3491
|
* @module platform/douyin/getdata
|
|
3977
3492
|
*/
|
|
@@ -4248,7 +3763,8 @@ const DouyinData = async (data, cookie, requestConfig) => {
|
|
|
4248
3763
|
signType: null,
|
|
4249
3764
|
processRawResponse: (raw) => {
|
|
4250
3765
|
if (!isUserSearch && !isVideoSearch) {
|
|
4251
|
-
const
|
|
3766
|
+
const chunks = typeof raw === "string" ? parseDouyinMultiJson(raw) : [raw];
|
|
3767
|
+
const responses = filterSearchResponses(chunks);
|
|
4252
3768
|
if (responses.length === 0) return raw;
|
|
4253
3769
|
const mergedData = [];
|
|
4254
3770
|
let lastValid = {};
|
|
@@ -4627,7 +4143,8 @@ const filterSearchResponses = (objs) => {
|
|
|
4627
4143
|
async function fetchDouyinInternal(methodType, options, config) {
|
|
4628
4144
|
const startTime = Date.now();
|
|
4629
4145
|
try {
|
|
4630
|
-
const
|
|
4146
|
+
const apiParams = { ...validateDouyinParams(methodType, options) };
|
|
4147
|
+
const rawData = await DouyinData(apiParams, config.cookie, config.requestConfig);
|
|
4631
4148
|
const duration = Date.now() - startTime;
|
|
4632
4149
|
if (rawData.data === "" || rawData.status_code !== 0) {
|
|
4633
4150
|
emitApiError({
|
|
@@ -5068,26 +4585,27 @@ async function fetchDanmakuList(options, cookie, requestConfig) {
|
|
|
5068
4585
|
* ```
|
|
5069
4586
|
*/
|
|
5070
4587
|
function createBoundDouyinFetcher(cookie, requestConfig) {
|
|
4588
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
5071
4589
|
return {
|
|
5072
|
-
fetchVideoWork: (options,
|
|
5073
|
-
fetchImageAlbumWork: (options,
|
|
5074
|
-
fetchSlidesWork: (options,
|
|
5075
|
-
fetchTextWork: (options,
|
|
5076
|
-
parseWork: (options,
|
|
5077
|
-
fetchDanmakuList: (options,
|
|
5078
|
-
fetchWorkComments: (options,
|
|
5079
|
-
fetchCommentReplies: (options,
|
|
5080
|
-
fetchUserProfile: (options,
|
|
5081
|
-
fetchUserVideoList: (options,
|
|
5082
|
-
fetchUserFavoriteList: (options,
|
|
5083
|
-
fetchUserRecommendList: (options,
|
|
5084
|
-
searchContent: (options,
|
|
5085
|
-
fetchSuggestWords: (options,
|
|
5086
|
-
fetchMusicInfo: (options,
|
|
5087
|
-
fetchLiveRoomInfo: (options,
|
|
5088
|
-
requestLoginQrcode: (options,
|
|
5089
|
-
fetchEmojiList: (options,
|
|
5090
|
-
fetchDynamicEmojiList: (options,
|
|
4590
|
+
fetchVideoWork: (options, override) => fetchVideoWork$1(options, ...resolveRequest(override)),
|
|
4591
|
+
fetchImageAlbumWork: (options, override) => fetchImageAlbumWork(options, ...resolveRequest(override)),
|
|
4592
|
+
fetchSlidesWork: (options, override) => fetchSlidesWork(options, ...resolveRequest(override)),
|
|
4593
|
+
fetchTextWork: (options, override) => fetchTextWork(options, ...resolveRequest(override)),
|
|
4594
|
+
parseWork: (options, override) => parseWork(options, ...resolveRequest(override)),
|
|
4595
|
+
fetchDanmakuList: (options, override) => fetchDanmakuList(options, ...resolveRequest(override)),
|
|
4596
|
+
fetchWorkComments: (options, override) => fetchWorkComments$1(options, ...resolveRequest(override)),
|
|
4597
|
+
fetchCommentReplies: (options, override) => fetchCommentReplies(options, ...resolveRequest(override)),
|
|
4598
|
+
fetchUserProfile: (options, override) => fetchUserProfile$2(options, ...resolveRequest(override)),
|
|
4599
|
+
fetchUserVideoList: (options, override) => fetchUserVideoList(options, ...resolveRequest(override)),
|
|
4600
|
+
fetchUserFavoriteList: (options, override) => fetchUserFavoriteList(options, ...resolveRequest(override)),
|
|
4601
|
+
fetchUserRecommendList: (options, override) => fetchUserRecommendList(options, ...resolveRequest(override)),
|
|
4602
|
+
searchContent: (options, override) => searchContent(options, ...resolveRequest(override)),
|
|
4603
|
+
fetchSuggestWords: (options, override) => fetchSuggestWords(options, ...resolveRequest(override)),
|
|
4604
|
+
fetchMusicInfo: (options, override) => fetchMusicInfo(options, ...resolveRequest(override)),
|
|
4605
|
+
fetchLiveRoomInfo: (options, override) => fetchLiveRoomInfo$1(options, ...resolveRequest(override)),
|
|
4606
|
+
requestLoginQrcode: (options, override) => requestLoginQrcode(options, ...resolveRequest(override)),
|
|
4607
|
+
fetchEmojiList: (options, override) => fetchEmojiList$2(options, ...resolveRequest(override)),
|
|
4608
|
+
fetchDynamicEmojiList: (options, override) => fetchDynamicEmojiList(options, ...resolveRequest(override))
|
|
5091
4609
|
};
|
|
5092
4610
|
}
|
|
5093
4611
|
//#endregion
|
|
@@ -5234,11 +4752,13 @@ var API = class {
|
|
|
5234
4752
|
* @returns 请求配置
|
|
5235
4753
|
*/
|
|
5236
4754
|
profilePublic(data) {
|
|
4755
|
+
const count = "count" in data ? data.count ?? 12 : 12;
|
|
4756
|
+
const pcursor = "pcursor" in data ? data.pcursor ?? "" : "";
|
|
5237
4757
|
return createKuaishouLiveApiRequest("profilePublic", "/live_api/profile/public", {
|
|
5238
4758
|
caver: 2,
|
|
5239
|
-
count
|
|
4759
|
+
count,
|
|
5240
4760
|
hasMore: true,
|
|
5241
|
-
pcursor
|
|
4761
|
+
pcursor,
|
|
5242
4762
|
principalId: data.principalId,
|
|
5243
4763
|
privacy: "public"
|
|
5244
4764
|
}, { signPath: "/rest/k/feed/profile" });
|
|
@@ -5402,6 +4922,7 @@ var API = class {
|
|
|
5402
4922
|
* @returns 请求配置
|
|
5403
4923
|
*/
|
|
5404
4924
|
liveReco(gameId) {
|
|
4925
|
+
const normalizedGameId = Number(gameId) > 0 ? Number(gameId) : 1001;
|
|
5405
4926
|
return createKuaishouLiveApiRequest("liveReco", "/live_api/liveroom/reco", {}, {
|
|
5406
4927
|
method: "POST",
|
|
5407
4928
|
requiresSign: false,
|
|
@@ -5411,7 +4932,7 @@ var API = class {
|
|
|
5411
4932
|
followingWeight: 50
|
|
5412
4933
|
},
|
|
5413
4934
|
gameFavour: [{
|
|
5414
|
-
gameId:
|
|
4935
|
+
gameId: normalizedGameId,
|
|
5415
4936
|
totalStayLength: 100
|
|
5416
4937
|
}]
|
|
5417
4938
|
}
|
|
@@ -5644,8 +5165,10 @@ const maskKuaishouHudrPayload = (payload) => {
|
|
|
5644
5165
|
* @returns `HUDR_` 的完整结果及若干中间态,便于对拍与调试
|
|
5645
5166
|
*/
|
|
5646
5167
|
const deriveKuaishouHudrBody = (context) => {
|
|
5647
|
-
const
|
|
5648
|
-
const
|
|
5168
|
+
const payload = buildKuaishouHudrPayload(context);
|
|
5169
|
+
const maskedPayload = maskKuaishouHudrPayload(payload);
|
|
5170
|
+
const encrypted = new KuaishouChaChaCipher(KUAISHOU_HUDR_CHACHA_KEY, KUAISHOU_HUDR_CHACHA_NONCE).encrypt(maskedPayload);
|
|
5171
|
+
const body = encodeBase64Url(encrypted);
|
|
5649
5172
|
return {
|
|
5650
5173
|
body,
|
|
5651
5174
|
full: `${KUAISHOU_HUDR_PREFIX}${body}`,
|
|
@@ -6157,7 +5680,9 @@ const KUAISHOU_HE_RANDOM_MAX = 0xffffffffffff;
|
|
|
6157
5680
|
* @returns `$HE_` 载荷中的 4 字节 hash field hex
|
|
6158
5681
|
*/
|
|
6159
5682
|
const deriveKuaishouHeHashFieldHex = (signInput, hudrBody) => {
|
|
6160
|
-
|
|
5683
|
+
const hashInput = `${signInput}HUDR_${hudrBody}`;
|
|
5684
|
+
const digestHex = bytesToLowerHex(deriveKuaishouCts(deriveKuaishouB2sa(hashInput))).slice(0, 8);
|
|
5685
|
+
return bytesToLowerHex(xorByteArrays(hexToSignedBytes(digestHex), KUAISHOU_HE_INPUT_XOR_MASK));
|
|
6161
5686
|
};
|
|
6162
5687
|
/**
|
|
6163
5688
|
* 推导快手签名中的 `$HE_` 段。
|
|
@@ -6497,7 +6022,6 @@ var kuaishouSign = class {
|
|
|
6497
6022
|
* 快手数据获取模块
|
|
6498
6023
|
*
|
|
6499
6024
|
* 注意:为避免循环依赖,此文件直接从具体模块导入,而不是从平台 index 文件导入
|
|
6500
|
-
* 循环依赖链:DataFetchers → getdata → platform/kuaishou → DataFetchers
|
|
6501
6025
|
*/
|
|
6502
6026
|
const KUAISHOU_PROFILE_TAB_TYPE_MAP = {
|
|
6503
6027
|
public: "public",
|
|
@@ -7179,7 +6703,8 @@ const KuaishouData = async (data, cookie, requestConfig) => {
|
|
|
7179
6703
|
if (!liveDetailData) return liveRoomInfo;
|
|
7180
6704
|
const userInfo = isErrorDetailLike(userInfoPayload) ? void 0 : userInfoPayload?.data?.userInfo;
|
|
7181
6705
|
const sensitiveInfo = isErrorDetailLike(sensitivePayload) ? void 0 : sensitivePayload?.data?.sensitiveUserInfo;
|
|
7182
|
-
const
|
|
6706
|
+
const currentAuthor = mergeKuaishouLiveAuthor(liveDetailData?.author, userInfo, sensitiveInfo);
|
|
6707
|
+
const currentLiveRoomItem = mapLiveDetailToLiveRoomPlayItem(liveDetailData, currentAuthor);
|
|
7183
6708
|
const liveStreamId = currentLiveRoomItem.liveStream?.id ?? currentLiveRoomItem.config?.liveStreamId;
|
|
7184
6709
|
const currentGameId = liveDetailData?.gameInfo?.id ?? liveDetailData?.gameInfo?.gameId;
|
|
7185
6710
|
const liveDetailWebsocketMeta = resolveKuaishouLiveDetailWebsocketMeta(liveDetailData);
|
|
@@ -7197,7 +6722,8 @@ const KuaishouData = async (data, cookie, requestConfig) => {
|
|
|
7197
6722
|
shouldFetchRecommendList ? fetchKuaishouLiveApiPayload(data.methodType, kuaishouApiUrls.liveReco(currentGameId), refererPath, { allowResult2: true }) : Promise.resolve(null)
|
|
7198
6723
|
]);
|
|
7199
6724
|
const resolvedRecommendList = !isErrorDetailLike(recoPayload) && Array.isArray(recoPayload?.data?.list) ? recoPayload.data.list : liveDetailRecommendList;
|
|
7200
|
-
const
|
|
6725
|
+
const recoPlayList = Array.isArray(resolvedRecommendList) ? resolvedRecommendList.map((item) => mapRecoItemToLiveRoomPlayItem(item)) : [];
|
|
6726
|
+
const nextPlayList = dedupeLiveRoomPlayList([currentLiveRoomItem, ...recoPlayList]);
|
|
7201
6727
|
return {
|
|
7202
6728
|
...liveRoomInfo,
|
|
7203
6729
|
principalId: data.principalId,
|
|
@@ -7308,7 +6834,8 @@ const GlobalGetData$2 = async (type, options, config) => {
|
|
|
7308
6834
|
async function fetchKuaishouInternal(methodType, options, config) {
|
|
7309
6835
|
const startTime = Date.now();
|
|
7310
6836
|
try {
|
|
7311
|
-
const
|
|
6837
|
+
const apiParams = { ...validateKuaishouParams(methodType, options) };
|
|
6838
|
+
const rawData = await KuaishouData(apiParams, config.cookie, config.requestConfig);
|
|
7312
6839
|
const duration = Date.now() - startTime;
|
|
7313
6840
|
if (rawData.code && Object.values(kuaishouAPIErrorCode).includes(rawData.code)) {
|
|
7314
6841
|
emitApiError({
|
|
@@ -7480,13 +7007,14 @@ const kuaishouFetcher = {
|
|
|
7480
7007
|
* ```
|
|
7481
7008
|
*/
|
|
7482
7009
|
function createBoundKuaishouFetcher(cookie, requestConfig) {
|
|
7010
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
7483
7011
|
return {
|
|
7484
|
-
fetchVideoWork: (options,
|
|
7485
|
-
fetchWorkComments: (options,
|
|
7486
|
-
fetchUserProfile: (options,
|
|
7487
|
-
fetchUserWorkList: (options,
|
|
7488
|
-
fetchLiveRoomInfo: (options,
|
|
7489
|
-
fetchEmojiList: (options,
|
|
7012
|
+
fetchVideoWork: (options, override) => fetchVideoWork(options, ...resolveRequest(override)),
|
|
7013
|
+
fetchWorkComments: (options, override) => fetchWorkComments(options, ...resolveRequest(override)),
|
|
7014
|
+
fetchUserProfile: (options, override) => fetchUserProfile$1(options, ...resolveRequest(override)),
|
|
7015
|
+
fetchUserWorkList: (options, override) => fetchUserWorkList(options, ...resolveRequest(override)),
|
|
7016
|
+
fetchLiveRoomInfo: (options, override) => fetchLiveRoomInfo(options, ...resolveRequest(override)),
|
|
7017
|
+
fetchEmojiList: (options, override) => fetchEmojiList$1(options, ...resolveRequest(override))
|
|
7490
7018
|
};
|
|
7491
7019
|
}
|
|
7492
7020
|
//#endregion
|
|
@@ -7566,18 +7094,19 @@ const XiaohongshuData = async (data, cookie, requestConfig) => {
|
|
|
7566
7094
|
...requestConfig?.headers ?? {}
|
|
7567
7095
|
}
|
|
7568
7096
|
};
|
|
7097
|
+
const userData = await GlobalGetData$1(data.methodType, {
|
|
7098
|
+
...baseRequestConfig,
|
|
7099
|
+
url: xiaohongshuApiUrls.userProfile(data).Url,
|
|
7100
|
+
headers: {
|
|
7101
|
+
...baseRequestConfig.headers,
|
|
7102
|
+
"x-s": xiaohongshuSign.generateXSGet(xiaohongshuApiUrls.userProfile(data).apiPath, xiaohongshuSign.extractA1FromCookie(requestCookie), "xhs-pc-web"),
|
|
7103
|
+
"x-s-common": xiaohongshuSign.generateXSCommon(requestCookie),
|
|
7104
|
+
"x-t": xiaohongshuSign.generateXT()
|
|
7105
|
+
}
|
|
7106
|
+
});
|
|
7569
7107
|
return {
|
|
7570
7108
|
code: 0,
|
|
7571
|
-
data: extractCreatorInfoFromHtml(
|
|
7572
|
-
...baseRequestConfig,
|
|
7573
|
-
url: xiaohongshuApiUrls.userProfile(data).Url,
|
|
7574
|
-
headers: {
|
|
7575
|
-
...baseRequestConfig.headers,
|
|
7576
|
-
"x-s": xiaohongshuSign.generateXSGet(xiaohongshuApiUrls.userProfile(data).apiPath, xiaohongshuSign.extractA1FromCookie(requestCookie), "xhs-pc-web"),
|
|
7577
|
-
"x-s-common": xiaohongshuSign.generateXSCommon(requestCookie),
|
|
7578
|
-
"x-t": xiaohongshuSign.generateXT()
|
|
7579
|
-
}
|
|
7580
|
-
})),
|
|
7109
|
+
data: extractCreatorInfoFromHtml(userData),
|
|
7581
7110
|
msg: "success"
|
|
7582
7111
|
};
|
|
7583
7112
|
}
|
|
@@ -7691,7 +7220,8 @@ const sortTypeMapping = {
|
|
|
7691
7220
|
async function fetchXiaohongshuInternal(methodType, options, config) {
|
|
7692
7221
|
const startTime = Date.now();
|
|
7693
7222
|
try {
|
|
7694
|
-
const
|
|
7223
|
+
const apiParams = { ...validateXiaohongshuParams(methodType, options) };
|
|
7224
|
+
const rawData = await XiaohongshuData(apiParams, config.cookie, config.requestConfig);
|
|
7695
7225
|
const duration = Date.now() - startTime;
|
|
7696
7226
|
if (rawData.code && Object.values(xiaohongshuAPIErrorCode).includes(rawData.code)) {
|
|
7697
7227
|
emitApiError({
|
|
@@ -7925,14 +7455,15 @@ const xiaohongshuFetcher = {
|
|
|
7925
7455
|
* ```
|
|
7926
7456
|
*/
|
|
7927
7457
|
function createBoundXiaohongshuFetcher(cookie, requestConfig) {
|
|
7458
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
7928
7459
|
return {
|
|
7929
|
-
fetchHomeFeed: (options = {},
|
|
7930
|
-
fetchNoteDetail: (options,
|
|
7931
|
-
fetchNoteComments: (options,
|
|
7932
|
-
fetchUserProfile: (options,
|
|
7933
|
-
fetchUserNoteList: (options,
|
|
7934
|
-
searchNotes: (options,
|
|
7935
|
-
fetchEmojiList: (options,
|
|
7460
|
+
fetchHomeFeed: (options = {}, override) => fetchHomeFeed(options, ...resolveRequest(override)),
|
|
7461
|
+
fetchNoteDetail: (options, override) => fetchNoteDetail(options, ...resolveRequest(override)),
|
|
7462
|
+
fetchNoteComments: (options, override) => fetchNoteComments(options, ...resolveRequest(override)),
|
|
7463
|
+
fetchUserProfile: (options, override) => fetchUserProfile(options, ...resolveRequest(override)),
|
|
7464
|
+
fetchUserNoteList: (options, override) => fetchUserNoteList(options, ...resolveRequest(override)),
|
|
7465
|
+
searchNotes: (options, override) => searchNotes(options, ...resolveRequest(override)),
|
|
7466
|
+
fetchEmojiList: (options, override) => fetchEmojiList(options, ...resolveRequest(override))
|
|
7936
7467
|
};
|
|
7937
7468
|
}
|
|
7938
7469
|
//#endregion
|
|
@@ -8114,106 +7645,6 @@ const getHeadersAndData = async (config, maxRetries = DEFAULT_MAX_RETRIES) => {
|
|
|
8114
7645
|
};
|
|
8115
7646
|
};
|
|
8116
7647
|
//#endregion
|
|
8117
|
-
//#region src/model/logger.ts
|
|
8118
|
-
/**
|
|
8119
|
-
* @deprecated v6 已废弃日志模块,请使用事件系统替代
|
|
8120
|
-
* @see {@link ../events.ts} 使用 amagiEvents 监听日志事件
|
|
8121
|
-
*
|
|
8122
|
-
* 迁移示例:
|
|
8123
|
-
* ```typescript
|
|
8124
|
-
* import { amagiEvents } from '@ikenxuan/amagi'
|
|
8125
|
-
*
|
|
8126
|
-
* amagiEvents.on('log:info', (data) => console.log(data.message))
|
|
8127
|
-
* amagiEvents.on('log:error', (data) => console.error(data.message))
|
|
8128
|
-
* ```
|
|
8129
|
-
*/
|
|
8130
|
-
/**
|
|
8131
|
-
* @deprecated v6 已废弃,请使用事件系统替代
|
|
8132
|
-
* 初始化 logger 配置 - 此函数现在为空操作
|
|
8133
|
-
*/
|
|
8134
|
-
const initLogger = () => {};
|
|
8135
|
-
/**
|
|
8136
|
-
* @deprecated v6 已废弃,请使用事件系统替代
|
|
8137
|
-
* 简化的日志类,仅发射事件,不再依赖 log4js
|
|
8138
|
-
*/
|
|
8139
|
-
var SimpleLogger = class {
|
|
8140
|
-
chalk;
|
|
8141
|
-
red;
|
|
8142
|
-
green;
|
|
8143
|
-
yellow;
|
|
8144
|
-
blue;
|
|
8145
|
-
magenta;
|
|
8146
|
-
cyan;
|
|
8147
|
-
white;
|
|
8148
|
-
gray;
|
|
8149
|
-
constructor() {
|
|
8150
|
-
this.chalk = new Chalk();
|
|
8151
|
-
this.red = this.chalk.red;
|
|
8152
|
-
this.green = this.chalk.green;
|
|
8153
|
-
this.yellow = this.chalk.yellow;
|
|
8154
|
-
this.blue = this.chalk.blue;
|
|
8155
|
-
this.magenta = this.chalk.magenta;
|
|
8156
|
-
this.cyan = this.chalk.cyan;
|
|
8157
|
-
this.white = this.chalk.white;
|
|
8158
|
-
this.gray = this.chalk.gray;
|
|
8159
|
-
}
|
|
8160
|
-
info(message, ...args) {
|
|
8161
|
-
emitLog("info", String(message), ...args);
|
|
8162
|
-
}
|
|
8163
|
-
warn(message, ...args) {
|
|
8164
|
-
emitLog("warn", String(message), ...args);
|
|
8165
|
-
}
|
|
8166
|
-
error(message, ...args) {
|
|
8167
|
-
emitLog("error", String(message), ...args);
|
|
8168
|
-
}
|
|
8169
|
-
mark(message, ...args) {
|
|
8170
|
-
emitLog("mark", String(message), ...args);
|
|
8171
|
-
}
|
|
8172
|
-
debug(message, ...args) {
|
|
8173
|
-
emitLog("debug", String(message), ...args);
|
|
8174
|
-
}
|
|
8175
|
-
};
|
|
8176
|
-
/**
|
|
8177
|
-
* @deprecated v6 已废弃,请使用事件系统替代
|
|
8178
|
-
*/
|
|
8179
|
-
const logger = new SimpleLogger();
|
|
8180
|
-
/**
|
|
8181
|
-
* @deprecated v6 已废弃,请使用事件系统替代
|
|
8182
|
-
*/
|
|
8183
|
-
const httpLogger = new SimpleLogger();
|
|
8184
|
-
/**
|
|
8185
|
-
* @deprecated v6 已废弃,请使用事件系统监听 http:response 事件
|
|
8186
|
-
* 创建一个日志中间件,用于记录特定请求的详细信息
|
|
8187
|
-
* @param pathsToLog 指定需要记录日志的请求路径数组如果未提供,则记录所有请求的日志
|
|
8188
|
-
* @returns
|
|
8189
|
-
*/
|
|
8190
|
-
const logMiddleware = (pathsToLog) => {
|
|
8191
|
-
return (req, res, next) => {
|
|
8192
|
-
if (!pathsToLog || pathsToLog.some((path) => req.url.startsWith(path))) {
|
|
8193
|
-
const startTime = Date.now();
|
|
8194
|
-
const url = req.url;
|
|
8195
|
-
const method = req.method;
|
|
8196
|
-
const clientIP = req.headers["x-forwarded-for"] ?? req.socket.remoteAddress;
|
|
8197
|
-
res.on("finish", () => {
|
|
8198
|
-
const responseTime = Date.now() - startTime;
|
|
8199
|
-
const statusCode = res.statusCode;
|
|
8200
|
-
const requestSize = req.headers["content-length"] ?? "0";
|
|
8201
|
-
const responseSize = res.get("content-length") ?? "0";
|
|
8202
|
-
emitHttpResponse({
|
|
8203
|
-
method,
|
|
8204
|
-
url,
|
|
8205
|
-
statusCode,
|
|
8206
|
-
responseTime,
|
|
8207
|
-
clientIP: String(clientIP),
|
|
8208
|
-
requestSize: `${requestSize}B`,
|
|
8209
|
-
responseSize: `${responseSize}B`
|
|
8210
|
-
});
|
|
8211
|
-
});
|
|
8212
|
-
}
|
|
8213
|
-
next();
|
|
8214
|
-
};
|
|
8215
|
-
};
|
|
8216
|
-
//#endregion
|
|
8217
7648
|
//#region src/platform/bilibili/qtparam.ts
|
|
8218
7649
|
/**
|
|
8219
7650
|
* 生成B站视频流请求参数
|
|
@@ -8532,7 +7963,6 @@ const wbi_sign = async (BASEURL, cookie) => {
|
|
|
8532
7963
|
* 提供 B站各类数据的获取功能,包括视频、评论、用户、番剧等
|
|
8533
7964
|
*
|
|
8534
7965
|
* 注意:为避免循环依赖,此文件直接从具体模块导入,而不是从平台 index 文件导入
|
|
8535
|
-
* 循环依赖链:DataFetchers → getdata → platform/bilibili → DataFetchers
|
|
8536
7966
|
*
|
|
8537
7967
|
* @module platform/bilibili/getdata
|
|
8538
7968
|
*/
|
|
@@ -8552,10 +7982,11 @@ const fetchBilibili = async (data, cookie, requestConfig) => {
|
|
|
8552
7982
|
url: bilibiliApiUrls.getVideoInfo({ bvid: data.bvid })
|
|
8553
7983
|
});
|
|
8554
7984
|
case "videoStream": {
|
|
8555
|
-
const
|
|
7985
|
+
const baseUrl = bilibiliApiUrls.getVideoStream({
|
|
8556
7986
|
avid: data.avid,
|
|
8557
7987
|
cid: data.cid
|
|
8558
|
-
})
|
|
7988
|
+
});
|
|
7989
|
+
const sign = await qtparam(baseUrl, baseRequestConfig.headers?.Cookie);
|
|
8559
7990
|
return await GlobalGetData(data.methodType, {
|
|
8560
7991
|
...baseRequestConfig,
|
|
8561
7992
|
url: bilibiliApiUrls.getVideoStream({
|
|
@@ -8642,10 +8073,11 @@ const fetchBilibili = async (data, cookie, requestConfig) => {
|
|
|
8642
8073
|
});
|
|
8643
8074
|
}
|
|
8644
8075
|
case "bangumiStream": {
|
|
8645
|
-
const
|
|
8076
|
+
const baseUrl = bilibiliApiUrls.getBangumiStream({
|
|
8646
8077
|
cid: data.cid,
|
|
8647
8078
|
ep_id: data.ep_id.replace("ep", "")
|
|
8648
|
-
})
|
|
8079
|
+
});
|
|
8080
|
+
const sign = await qtparam(baseUrl, baseRequestConfig.headers?.cookie);
|
|
8649
8081
|
return await GlobalGetData(data.methodType, {
|
|
8650
8082
|
...baseRequestConfig,
|
|
8651
8083
|
url: bilibiliApiUrls.getBangumiStream({
|
|
@@ -8681,12 +8113,6 @@ const fetchBilibili = async (data, cookie, requestConfig) => {
|
|
|
8681
8113
|
url: bilibiliApiUrls.getDynamicDetail({ dynamic_id: data.dynamic_id })
|
|
8682
8114
|
});
|
|
8683
8115
|
}
|
|
8684
|
-
case "dynamicCard": return {
|
|
8685
|
-
code: -404,
|
|
8686
|
-
message: "接口已停用:B站官方已于 `2025-08-09` 删除 dynamic_svr 接口,fetchDynamicCard 方法已废弃,调用讲返回错误信息",
|
|
8687
|
-
ttl: 1,
|
|
8688
|
-
data: null
|
|
8689
|
-
};
|
|
8690
8116
|
case "userCard": {
|
|
8691
8117
|
const { host_mid } = data;
|
|
8692
8118
|
return await GlobalGetData(data.methodType, {
|
|
@@ -8699,7 +8125,8 @@ const fetchBilibili = async (data, cookie, requestConfig) => {
|
|
|
8699
8125
|
url: bilibiliApiUrls.getUserLiveStatus({ host_mid: data.host_mid })
|
|
8700
8126
|
});
|
|
8701
8127
|
case "userSpaceInfo": {
|
|
8702
|
-
const
|
|
8128
|
+
const baseUrl = bilibiliApiUrls.getUserSpaceInfo({ host_mid: data.host_mid });
|
|
8129
|
+
const wbiSignQuery = await wbi_sign(baseUrl, baseRequestConfig.headers?.cookie);
|
|
8703
8130
|
return await GlobalGetData(data.methodType, {
|
|
8704
8131
|
...baseRequestConfig,
|
|
8705
8132
|
url: bilibiliApiUrls.getUserSpaceInfo({ host_mid: data.host_mid }) + wbiSignQuery
|
|
@@ -9050,10 +8477,11 @@ var ValidationError = class ValidationError extends Error {
|
|
|
9050
8477
|
* @returns 验证错误实例
|
|
9051
8478
|
*/
|
|
9052
8479
|
static fromZodError(zodError, requestPath) {
|
|
9053
|
-
|
|
8480
|
+
const errors = zodError.issues.map((err) => ({
|
|
9054
8481
|
field: err.path.join("."),
|
|
9055
8482
|
message: err.message
|
|
9056
|
-
}))
|
|
8483
|
+
}));
|
|
8484
|
+
return new ValidationError("参数验证失败", errors, requestPath);
|
|
9057
8485
|
}
|
|
9058
8486
|
};
|
|
9059
8487
|
/**
|
|
@@ -9077,7 +8505,10 @@ const handleError = (error, requestPath) => {
|
|
|
9077
8505
|
platform: error.platform,
|
|
9078
8506
|
requestPath
|
|
9079
8507
|
};
|
|
9080
|
-
if (error instanceof zod.ZodError)
|
|
8508
|
+
if (error instanceof zod.ZodError) {
|
|
8509
|
+
const validationError = ValidationError.fromZodError(error, requestPath);
|
|
8510
|
+
return handleError(validationError, requestPath);
|
|
8511
|
+
}
|
|
9081
8512
|
return {
|
|
9082
8513
|
code: 500,
|
|
9083
8514
|
message: error instanceof Error ? error.message : "未知错误",
|
|
@@ -9188,71 +8619,7 @@ const bilibiliUtils = {
|
|
|
9188
8619
|
bv2av
|
|
9189
8620
|
},
|
|
9190
8621
|
danmaku: { parseDmSegMobileReply },
|
|
9191
|
-
bilibiliApiUrls
|
|
9192
|
-
api: bilibili
|
|
9193
|
-
};
|
|
9194
|
-
//#endregion
|
|
9195
|
-
//#region src/platform/douyin/DouyinApi.ts
|
|
9196
|
-
/**
|
|
9197
|
-
* 创建废弃的 API 存根函数
|
|
9198
|
-
*/
|
|
9199
|
-
const createDeprecatedStub$2 = (methodName) => {
|
|
9200
|
-
return (..._args) => {
|
|
9201
|
-
checkDeprecation("getDouyinData");
|
|
9202
|
-
throw new Error(`douyin.${methodName} 已废弃,请使用 douyinFetcher 替代`);
|
|
9203
|
-
};
|
|
9204
|
-
};
|
|
9205
|
-
/**
|
|
9206
|
-
* 封装了所有抖音相关的API请求,采用对象化的方式组织。
|
|
9207
|
-
*
|
|
9208
|
-
* @deprecated v6 已废弃,请使用 douyinFetcher 或 client.douyin.fetcher 替代
|
|
9209
|
-
*/
|
|
9210
|
-
const douyin = {
|
|
9211
|
-
/** @deprecated 请使用 douyinFetcher.fetchTextWork 替代 */
|
|
9212
|
-
getTextWorkInfo: createDeprecatedStub$2("getTextWorkInfo"),
|
|
9213
|
-
/** @deprecated 请使用 douyinFetcher.parseWork 替代 */
|
|
9214
|
-
getWorkInfo: createDeprecatedStub$2("getWorkInfo"),
|
|
9215
|
-
/** @deprecated 请使用 douyinFetcher.fetchVideoWork 替代 */
|
|
9216
|
-
getVideoWorkInfo: createDeprecatedStub$2("getVideoWorkInfo"),
|
|
9217
|
-
/** @deprecated 请使用 douyinFetcher.fetchImageAlbumWork 替代 */
|
|
9218
|
-
getImageAlbumWorkInfo: createDeprecatedStub$2("getImageAlbumWorkInfo"),
|
|
9219
|
-
/** @deprecated 请使用 douyinFetcher.fetchSlidesWork 替代 */
|
|
9220
|
-
getSlidesWorkInfo: createDeprecatedStub$2("getSlidesWorkInfo"),
|
|
9221
|
-
/** @deprecated 请使用 douyinFetcher.fetchComments 替代 */
|
|
9222
|
-
getComments: createDeprecatedStub$2("getComments"),
|
|
9223
|
-
/** @deprecated 请使用 douyinFetcher.fetchCommentReplies 替代 */
|
|
9224
|
-
getCommentReplies: createDeprecatedStub$2("getCommentReplies"),
|
|
9225
|
-
/** @deprecated 请使用 douyinFetcher.fetchUserProfile 替代 */
|
|
9226
|
-
getUserProfile: createDeprecatedStub$2("getUserProfile"),
|
|
9227
|
-
/** @deprecated 请使用 douyinFetcher.fetchEmojiList 替代 */
|
|
9228
|
-
getEmojiList: createDeprecatedStub$2("getEmojiList"),
|
|
9229
|
-
/** @deprecated 请使用 douyinFetcher.fetchDynamicEmojiList 替代 */
|
|
9230
|
-
getEmojiProList: createDeprecatedStub$2("getEmojiProList"),
|
|
9231
|
-
/** @deprecated 请使用 douyinFetcher.fetchUserVideoList 替代 */
|
|
9232
|
-
getUserVideos: createDeprecatedStub$2("getUserVideos"),
|
|
9233
|
-
/** @deprecated 请使用 douyinFetcher.fetchMusicInfo 替代 */
|
|
9234
|
-
getMusicInfo: createDeprecatedStub$2("getMusicInfo"),
|
|
9235
|
-
/** @deprecated 请使用 douyinFetcher.fetchSuggestWords 替代 */
|
|
9236
|
-
getSuggestWords: createDeprecatedStub$2("getSuggestWords"),
|
|
9237
|
-
/** @deprecated 请使用 douyinFetcher.searchContent 替代 */
|
|
9238
|
-
search: createDeprecatedStub$2("search"),
|
|
9239
|
-
/** @deprecated 请使用 douyinFetcher.fetchLiveRoomInfo 替代 */
|
|
9240
|
-
getLiveRoomInfo: createDeprecatedStub$2("getLiveRoomInfo"),
|
|
9241
|
-
/** @deprecated 请使用 douyinFetcher.fetchDanmakuList 替代 */
|
|
9242
|
-
getDanmaku: createDeprecatedStub$2("getDanmaku"),
|
|
9243
|
-
/** @deprecated 请使用 douyinFetcher 的具体方法替代 */
|
|
9244
|
-
invoke: createDeprecatedStub$2("invoke")
|
|
9245
|
-
};
|
|
9246
|
-
/**
|
|
9247
|
-
* 创建绑定了cookie的抖音API对象
|
|
9248
|
-
*
|
|
9249
|
-
* @deprecated v6 已废弃,请使用 createBoundDouyinFetcher 替代
|
|
9250
|
-
*/
|
|
9251
|
-
const createBoundDouyinApi = (_cookie, _requestConfig) => {
|
|
9252
|
-
return {
|
|
9253
|
-
...douyin,
|
|
9254
|
-
getSearchData: createDeprecatedStub$2("getSearchData")
|
|
9255
|
-
};
|
|
8622
|
+
bilibiliApiUrls
|
|
9256
8623
|
};
|
|
9257
8624
|
//#endregion
|
|
9258
8625
|
//#region src/platform/douyin/routes.ts
|
|
@@ -9306,46 +8673,7 @@ const createDouyinRoutes = (cookie, requestConfig = getDouyinDefaultConfig(cooki
|
|
|
9306
8673
|
/** 抖音相关功能模块 (工具集) */
|
|
9307
8674
|
const douyinUtils = {
|
|
9308
8675
|
sign: douyinSign,
|
|
9309
|
-
douyinApiUrls
|
|
9310
|
-
api: douyin
|
|
9311
|
-
};
|
|
9312
|
-
//#endregion
|
|
9313
|
-
//#region src/platform/kuaishou/KuaishouApi.ts
|
|
9314
|
-
/**
|
|
9315
|
-
* 创建废弃的 API 存根函数
|
|
9316
|
-
*/
|
|
9317
|
-
const createDeprecatedStub$1 = (methodName) => {
|
|
9318
|
-
return (..._args) => {
|
|
9319
|
-
checkDeprecation("getKuaishouData");
|
|
9320
|
-
throw new Error(`kuaishou.${methodName} 已废弃,请使用 kuaishouFetcher 替代`);
|
|
9321
|
-
};
|
|
9322
|
-
};
|
|
9323
|
-
/**
|
|
9324
|
-
* 快手相关 API 的命名空间。
|
|
9325
|
-
*
|
|
9326
|
-
* @deprecated v6 已废弃,请使用 kuaishouFetcher 或 client.kuaishou.fetcher 替代
|
|
9327
|
-
*/
|
|
9328
|
-
const kuaishou = {
|
|
9329
|
-
/** @deprecated 请使用 kuaishouFetcher.fetchVideoWork 替代 */
|
|
9330
|
-
getWorkInfo: createDeprecatedStub$1("getWorkInfo"),
|
|
9331
|
-
/** @deprecated 请使用 kuaishouFetcher.fetchWorkComments 替代 */
|
|
9332
|
-
getComments: createDeprecatedStub$1("getComments"),
|
|
9333
|
-
/** @deprecated 请使用 kuaishouFetcher.fetchUserProfile 替代 */
|
|
9334
|
-
getUserProfile: createDeprecatedStub$1("getUserProfile"),
|
|
9335
|
-
/** @deprecated 请使用 kuaishouFetcher.fetchUserWorkList 替代 */
|
|
9336
|
-
getUserWorkList: createDeprecatedStub$1("getUserWorkList"),
|
|
9337
|
-
/** @deprecated 请使用 kuaishouFetcher.fetchLiveRoomInfo 替代 */
|
|
9338
|
-
getLiveRoomInfo: createDeprecatedStub$1("getLiveRoomInfo"),
|
|
9339
|
-
/** @deprecated 请使用 kuaishouFetcher.fetchEmojiList 替代 */
|
|
9340
|
-
getEmojiList: createDeprecatedStub$1("getEmojiList")
|
|
9341
|
-
};
|
|
9342
|
-
/**
|
|
9343
|
-
* 创建绑定了cookie的快手API对象
|
|
9344
|
-
*
|
|
9345
|
-
* @deprecated v6 已废弃,请使用 createBoundKuaishouFetcher 替代
|
|
9346
|
-
*/
|
|
9347
|
-
const createBoundKuaishouApi = (_cookie, _requestConfig) => {
|
|
9348
|
-
return { ...kuaishou };
|
|
8676
|
+
douyinApiUrls
|
|
9349
8677
|
};
|
|
9350
8678
|
//#endregion
|
|
9351
8679
|
//#region src/platform/kuaishou/routes.ts
|
|
@@ -9399,48 +8727,7 @@ const createKuaishouRoutes = (cookie, requestConfig = getKuaishouDefaultConfig(c
|
|
|
9399
8727
|
/** 快手相关功能模块 (工具集) */
|
|
9400
8728
|
const kuaishouUtils = {
|
|
9401
8729
|
sign: kuaishouSign,
|
|
9402
|
-
kuaishouApiUrls
|
|
9403
|
-
api: kuaishou
|
|
9404
|
-
};
|
|
9405
|
-
//#endregion
|
|
9406
|
-
//#region src/platform/xiaohongshu/XiaohongshuApi.ts
|
|
9407
|
-
/**
|
|
9408
|
-
* 创建废弃的 API 存根函数
|
|
9409
|
-
*/
|
|
9410
|
-
const createDeprecatedStub = (methodName) => {
|
|
9411
|
-
return (..._args) => {
|
|
9412
|
-
checkDeprecation("getXiaohongshuData");
|
|
9413
|
-
throw new Error(`xiaohongshu.${methodName} 已废弃,请使用 xiaohongshuFetcher 替代`);
|
|
9414
|
-
};
|
|
9415
|
-
};
|
|
9416
|
-
/**
|
|
9417
|
-
* 封装了所有小红书相关的API请求,采用对象化的方式组织。
|
|
9418
|
-
*
|
|
9419
|
-
* @deprecated v6 已废弃,请使用 xiaohongshuFetcher 或 client.xiaohongshu.fetcher 替代
|
|
9420
|
-
*/
|
|
9421
|
-
const xiaohongshu = {
|
|
9422
|
-
/** @deprecated 请使用 xiaohongshuFetcher.fetchHomeFeed 替代 */
|
|
9423
|
-
getHomeFeed: createDeprecatedStub("getHomeFeed"),
|
|
9424
|
-
/** @deprecated 请使用 xiaohongshuFetcher.fetchNoteDetail 替代 */
|
|
9425
|
-
getNote: createDeprecatedStub("getNote"),
|
|
9426
|
-
/** @deprecated 请使用 xiaohongshuFetcher.fetchNoteComments 替代 */
|
|
9427
|
-
getComments: createDeprecatedStub("getComments"),
|
|
9428
|
-
/** @deprecated 请使用 xiaohongshuFetcher.fetchUserProfile 替代 */
|
|
9429
|
-
getUser: createDeprecatedStub("getUser"),
|
|
9430
|
-
/** @deprecated 请使用 xiaohongshuFetcher.fetchUserNoteList 替代 */
|
|
9431
|
-
getUserNotes: createDeprecatedStub("getUserNotes"),
|
|
9432
|
-
/** @deprecated 请使用 xiaohongshuFetcher.searchNotes 替代 */
|
|
9433
|
-
getSearchNotes: createDeprecatedStub("getSearchNotes"),
|
|
9434
|
-
/** @deprecated 请使用 xiaohongshuFetcher.fetchEmojiList 替代 */
|
|
9435
|
-
getEmojiList: createDeprecatedStub("getEmojiList")
|
|
9436
|
-
};
|
|
9437
|
-
/**
|
|
9438
|
-
* 创建绑定了cookie的小红书API对象
|
|
9439
|
-
*
|
|
9440
|
-
* @deprecated v6 已废弃,请使用 createBoundXiaohongshuFetcher 替代
|
|
9441
|
-
*/
|
|
9442
|
-
const createBoundXiaohongshuApi = (_cookie, _requestConfig) => {
|
|
9443
|
-
return { ...xiaohongshu };
|
|
8730
|
+
kuaishouApiUrls
|
|
9444
8731
|
};
|
|
9445
8732
|
//#endregion
|
|
9446
8733
|
//#region src/platform/xiaohongshu/routes.ts
|
|
@@ -9494,8 +8781,7 @@ const createXiaohongshuRoutes = (cookie, requestConfig = getXiaohongshuDefaultCo
|
|
|
9494
8781
|
/** 小红书相关功能模块 (工具集) */
|
|
9495
8782
|
const xiaohongshuUtils = {
|
|
9496
8783
|
sign: xiaohongshuSign,
|
|
9497
|
-
xiaohongshuApiUrls
|
|
9498
|
-
api: xiaohongshu
|
|
8784
|
+
xiaohongshuApiUrls
|
|
9499
8785
|
};
|
|
9500
8786
|
//#endregion
|
|
9501
8787
|
//#region src/server/index.ts
|
|
@@ -9542,38 +8828,6 @@ const createAmagiClient = (options) => {
|
|
|
9542
8828
|
});
|
|
9543
8829
|
return app;
|
|
9544
8830
|
};
|
|
9545
|
-
/**
|
|
9546
|
-
* @deprecated v6 已废弃,请使用 douyin.fetcher 替代
|
|
9547
|
-
* @throws {DeprecatedApiError} 调用时抛出废弃错误
|
|
9548
|
-
*/
|
|
9549
|
-
const getDouyinData = (..._args) => {
|
|
9550
|
-
checkDeprecation("getDouyinData");
|
|
9551
|
-
throw new Error("getDouyinData 已废弃");
|
|
9552
|
-
};
|
|
9553
|
-
/**
|
|
9554
|
-
* @deprecated v6 已废弃,请使用 bilibili.fetcher 替代
|
|
9555
|
-
* @throws {DeprecatedApiError} 调用时抛出废弃错误
|
|
9556
|
-
*/
|
|
9557
|
-
const getBilibiliData = (..._args) => {
|
|
9558
|
-
checkDeprecation("getBilibiliData");
|
|
9559
|
-
throw new Error("getBilibiliData 已废弃");
|
|
9560
|
-
};
|
|
9561
|
-
/**
|
|
9562
|
-
* @deprecated v6 已废弃,请使用 kuaishou.fetcher 替代
|
|
9563
|
-
* @throws {DeprecatedApiError} 调用时抛出废弃错误
|
|
9564
|
-
*/
|
|
9565
|
-
const getKuaishouData = (..._args) => {
|
|
9566
|
-
checkDeprecation("getKuaishouData");
|
|
9567
|
-
throw new Error("getKuaishouData 已废弃");
|
|
9568
|
-
};
|
|
9569
|
-
/**
|
|
9570
|
-
* @deprecated v6 已废弃,请使用 xiaohongshu.fetcher 替代
|
|
9571
|
-
* @throws {DeprecatedApiError} 调用时抛出废弃错误
|
|
9572
|
-
*/
|
|
9573
|
-
const getXiaohongshuData = (..._args) => {
|
|
9574
|
-
checkDeprecation("getXiaohongshuData");
|
|
9575
|
-
throw new Error("getXiaohongshuData 已废弃");
|
|
9576
|
-
};
|
|
9577
8831
|
return {
|
|
9578
8832
|
/** 启动本地HTTP服务 */
|
|
9579
8833
|
startServer,
|
|
@@ -9591,39 +8845,23 @@ const createAmagiClient = (options) => {
|
|
|
9591
8845
|
* @param listener - 事件处理函数 (只触发一次)
|
|
9592
8846
|
*/
|
|
9593
8847
|
once: (event, listener) => amagiEvents.once(event, listener),
|
|
9594
|
-
/** @deprecated v6 已废弃,请使用 douyin.fetcher 替代 */
|
|
9595
|
-
getDouyinData,
|
|
9596
|
-
/** @deprecated v6 已废弃,请使用 bilibili.fetcher 替代 */
|
|
9597
|
-
getBilibiliData,
|
|
9598
|
-
/** @deprecated v6 已废弃,请使用 kuaishou.fetcher 替代 */
|
|
9599
|
-
getKuaishouData,
|
|
9600
|
-
/** @deprecated v6 已废弃,请使用 xiaohongshu.fetcher 替代 */
|
|
9601
|
-
getXiaohongshuData,
|
|
9602
8848
|
douyin: {
|
|
9603
8849
|
...douyinUtils,
|
|
9604
|
-
/** @deprecated 请使用 fetcher 替代 */
|
|
9605
|
-
api: createBoundDouyinApi(douyinCookie, requestConfig),
|
|
9606
8850
|
/** fetcher */
|
|
9607
8851
|
fetcher: createBoundDouyinFetcher(douyinCookie, requestConfig)
|
|
9608
8852
|
},
|
|
9609
8853
|
bilibili: {
|
|
9610
8854
|
...bilibiliUtils,
|
|
9611
|
-
/** @deprecated 请使用 fetcher 替代 */
|
|
9612
|
-
api: createBoundBilibiliApi(bilibiliCookie, requestConfig),
|
|
9613
8855
|
/** fetcher */
|
|
9614
8856
|
fetcher: createBoundBilibiliFetcher(bilibiliCookie, requestConfig)
|
|
9615
8857
|
},
|
|
9616
8858
|
kuaishou: {
|
|
9617
8859
|
...kuaishouUtils,
|
|
9618
|
-
/** @deprecated 请使用 fetcher 替代 */
|
|
9619
|
-
api: createBoundKuaishouApi(kuaishouCookie, requestConfig),
|
|
9620
8860
|
/** fetcher */
|
|
9621
8861
|
fetcher: createBoundKuaishouFetcher(kuaishouCookie, requestConfig)
|
|
9622
8862
|
},
|
|
9623
8863
|
xiaohongshu: {
|
|
9624
8864
|
...xiaohongshuUtils,
|
|
9625
|
-
/** @deprecated 请使用 fetcher 替代 */
|
|
9626
|
-
api: createBoundXiaohongshuApi(xiaohongshuCookie, requestConfig),
|
|
9627
8865
|
/** fetcher */
|
|
9628
8866
|
fetcher: createBoundXiaohongshuFetcher(xiaohongshuCookie, requestConfig)
|
|
9629
8867
|
}
|
|
@@ -9787,7 +9025,6 @@ const BilibiliInternalMethods = {
|
|
|
9787
9025
|
USER_SPACE_INFO: "用户空间详细信息",
|
|
9788
9026
|
USER_TOTAL_VIEWS: "获取UP主总播放量",
|
|
9789
9027
|
DYNAMIC_DETAIL: "动态详情数据",
|
|
9790
|
-
DYNAMIC_CARD: "动态卡片数据",
|
|
9791
9028
|
BANGUMI_INFO: "番剧基本信息数据",
|
|
9792
9029
|
BANGUMI_STREAM: "番剧下载信息数据",
|
|
9793
9030
|
LIVE_ROOM_INFO: "直播间信息",
|
|
@@ -9818,7 +9055,6 @@ const BilibiliFetcherMethods = {
|
|
|
9818
9055
|
USER_SPACE_INFO: "fetchUserSpaceInfo",
|
|
9819
9056
|
USER_TOTAL_VIEWS: "fetchUploaderTotalViews",
|
|
9820
9057
|
DYNAMIC_DETAIL: "fetchDynamicDetail",
|
|
9821
|
-
DYNAMIC_CARD: "fetchDynamicCard",
|
|
9822
9058
|
BANGUMI_INFO: "fetchBangumiInfo",
|
|
9823
9059
|
BANGUMI_STREAM: "fetchBangumiStreamUrl",
|
|
9824
9060
|
LIVE_ROOM_INFO: "fetchLiveRoomInfo",
|
|
@@ -9927,7 +9163,6 @@ const BilibiliMethodToFetcher = {
|
|
|
9927
9163
|
[BilibiliInternalMethods.USER_SPACE_INFO]: BilibiliFetcherMethods.USER_SPACE_INFO,
|
|
9928
9164
|
[BilibiliInternalMethods.USER_TOTAL_VIEWS]: BilibiliFetcherMethods.USER_TOTAL_VIEWS,
|
|
9929
9165
|
[BilibiliInternalMethods.DYNAMIC_DETAIL]: BilibiliFetcherMethods.DYNAMIC_DETAIL,
|
|
9930
|
-
[BilibiliInternalMethods.DYNAMIC_CARD]: BilibiliFetcherMethods.DYNAMIC_CARD,
|
|
9931
9166
|
[BilibiliInternalMethods.BANGUMI_INFO]: BilibiliFetcherMethods.BANGUMI_INFO,
|
|
9932
9167
|
[BilibiliInternalMethods.BANGUMI_STREAM]: BilibiliFetcherMethods.BANGUMI_STREAM,
|
|
9933
9168
|
[BilibiliInternalMethods.LIVE_ROOM_INFO]: BilibiliFetcherMethods.LIVE_ROOM_INFO,
|
|
@@ -10059,7 +9294,6 @@ const BilibiliMethodMapping = {
|
|
|
10059
9294
|
用户空间详细信息: "fetchUserSpaceInfo",
|
|
10060
9295
|
获取UP主总播放量: "fetchUploaderTotalViews",
|
|
10061
9296
|
动态详情数据: "fetchDynamicDetail",
|
|
10062
|
-
动态卡片数据: "fetchDynamicCard",
|
|
10063
9297
|
番剧基本信息数据: "fetchBangumiInfo",
|
|
10064
9298
|
番剧下载信息数据: "fetchBangumiStreamUrl",
|
|
10065
9299
|
直播间信息: "fetchLiveRoomInfo",
|
|
@@ -10142,7 +9376,6 @@ const BilibiliApiRoutes = {
|
|
|
10142
9376
|
userSpaceInfo: "/user/space",
|
|
10143
9377
|
uploaderTotalViews: "/user/total-views",
|
|
10144
9378
|
dynamicDetail: "/dynamic",
|
|
10145
|
-
dynamicCard: "/dynamic/card",
|
|
10146
9379
|
bangumiInfo: "/bangumi",
|
|
10147
9380
|
bangumiStream: "/bangumi/stream",
|
|
10148
9381
|
liveRoomInfo: "/live",
|
|
@@ -10212,14 +9445,10 @@ function getApiRoute(platform, methodType) {
|
|
|
10212
9445
|
* 构建后使用 __VERSION__,开发环境从 package.json 读取
|
|
10213
9446
|
*/
|
|
10214
9447
|
const getVersion = () => {
|
|
10215
|
-
return "6.
|
|
9448
|
+
return "6.5.0";
|
|
10216
9449
|
};
|
|
10217
9450
|
const VERSION = getVersion();
|
|
10218
9451
|
/**
|
|
10219
|
-
* @deprecated 请使用 createAmagiClient 替代
|
|
10220
|
-
*/
|
|
10221
|
-
const amagiClient = createAmagiClient;
|
|
10222
|
-
/**
|
|
10223
9452
|
* 创建一个新的 amagi 客户端实例
|
|
10224
9453
|
* 用于创建和初始化一个新的 amagi 客户端实例,支持通过 new 关键字或函数调用方式使用
|
|
10225
9454
|
* @param options - cookies 配置选项,用于设置客户端的 cookies 相关参数
|
|
@@ -10239,10 +9468,6 @@ CreateAmagiApp.douyin = douyinUtils;
|
|
|
10239
9468
|
CreateAmagiApp.bilibili = bilibiliUtils;
|
|
10240
9469
|
CreateAmagiApp.kuaishou = kuaishouUtils;
|
|
10241
9470
|
CreateAmagiApp.xiaohongshu = xiaohongshuUtils;
|
|
10242
|
-
CreateAmagiApp.getDouyinData = getDouyinData;
|
|
10243
|
-
CreateAmagiApp.getBilibiliData = getBilibiliData;
|
|
10244
|
-
CreateAmagiApp.getKuaishouData = getKuaishouData;
|
|
10245
|
-
CreateAmagiApp.getXiaohongshuData = getXiaohongshuData;
|
|
10246
9471
|
CreateAmagiApp.events = amagiEvents;
|
|
10247
9472
|
CreateAmagiApp.on = amagiEvents.on.bind(amagiEvents);
|
|
10248
9473
|
CreateAmagiApp.once = amagiEvents.once.bind(amagiEvents);
|
|
@@ -10265,6 +9490,4 @@ const amagi = Client;
|
|
|
10265
9490
|
* GPL-3.0 Licensed
|
|
10266
9491
|
*/
|
|
10267
9492
|
//#endregion
|
|
10268
|
-
export { AdditionalType, ApiError, BilibiliApiRoutes, BilibiliApplyCaptchaParamsSchema, BilibiliArticleCardParamsSchema, BilibiliArticleInfoParamsSchema, BilibiliArticleParamsSchema, BilibiliAv2BvParamsSchema, BilibiliBangumiInfoParamsSchema, BilibiliBangumiStreamParamsSchema, BilibiliBv2AvParamsSchema, BilibiliColumnInfoParamsSchema, BilibiliCommentParamsSchema, BilibiliCommentReplyParamsSchema, BilibiliDanmakuParamsSchema, BilibiliDynamicParamsSchema, BilibiliEmojiParamsSchema, BilibiliFetcherMethods, BilibiliInternalMethods, BilibiliLiveParamsSchema, BilibiliLoginParamsSchema, BilibiliMethodMapping, BilibiliMethodRoutes, BilibiliMethodToFetcher, BilibiliQrcodeParamsSchema, BilibiliQrcodeStatusParamsSchema, BilibiliUserParamsSchema, BilibiliValidateCaptchaParamsSchema, BilibiliValidationSchemas, BilibiliVideoDownloadParamsSchema, BilibiliVideoParamsSchema, CommentType, CreateApp, DouyinApiRoutes, DouyinCommentParamsSchema, DouyinCommentReplyParamsSchema, DouyinDanmakuParamsSchema, DouyinEmojiListParamsSchema, DouyinEmojiProParamsSchema, DouyinFetcherMethods, DouyinHotWordsParamsSchema, DouyinInternalMethods, DouyinLiveRoomParamsSchema, DouyinMethodMapping, DouyinMethodRoutes, DouyinMethodToFetcher, DouyinMusicParamsSchema, DouyinQrcodeParamsSchema, DouyinSearchParamsSchema, DouyinUserListParamsSchema, DouyinUserParamsSchema, DouyinValidationSchemas, DouyinWorkParamsSchema, DynamicType, KuaishouApiRoutes, KuaishouCommentParamsSchema, KuaishouEmojiParamsSchema, KuaishouFetcherMethods, KuaishouInternalMethods, KuaishouLiveRoomInfoParamsSchema, KuaishouMethodMapping, KuaishouMethodRoutes, KuaishouMethodToFetcher, KuaishouUserProfileParamsSchema, KuaishouUserWorkListParamsSchema, KuaishouValidationSchemas, KuaishouVideoParamsSchema, MajorType, MethodMaps, ValidationError, XiaohongshuApiRoutes, XiaohongshuFetcherMethods, XiaohongshuInternalMethods, XiaohongshuMethodMapping, XiaohongshuMethodRoutes, XiaohongshuMethodToFetcher, XiaohongshuValidationSchemas, amagi,
|
|
10269
|
-
|
|
10270
|
-
//# sourceMappingURL=index.mjs.map
|
|
9493
|
+
export { AdditionalType, ApiError, BilibiliApiRoutes, BilibiliApplyCaptchaParamsSchema, BilibiliArticleCardParamsSchema, BilibiliArticleInfoParamsSchema, BilibiliArticleParamsSchema, BilibiliAv2BvParamsSchema, BilibiliBangumiInfoParamsSchema, BilibiliBangumiStreamParamsSchema, BilibiliBv2AvParamsSchema, BilibiliColumnInfoParamsSchema, BilibiliCommentParamsSchema, BilibiliCommentReplyParamsSchema, BilibiliDanmakuParamsSchema, BilibiliDynamicParamsSchema, BilibiliEmojiParamsSchema, BilibiliFetcherMethods, BilibiliInternalMethods, BilibiliLiveParamsSchema, BilibiliLoginParamsSchema, BilibiliMethodMapping, BilibiliMethodRoutes, BilibiliMethodToFetcher, BilibiliQrcodeParamsSchema, BilibiliQrcodeStatusParamsSchema, BilibiliUserParamsSchema, BilibiliValidateCaptchaParamsSchema, BilibiliValidationSchemas, BilibiliVideoDownloadParamsSchema, BilibiliVideoParamsSchema, CommentType, CreateApp, DouyinApiRoutes, DouyinCommentParamsSchema, DouyinCommentReplyParamsSchema, DouyinDanmakuParamsSchema, DouyinEmojiListParamsSchema, DouyinEmojiProParamsSchema, DouyinFetcherMethods, DouyinHotWordsParamsSchema, DouyinInternalMethods, DouyinLiveRoomParamsSchema, DouyinMethodMapping, DouyinMethodRoutes, DouyinMethodToFetcher, DouyinMusicParamsSchema, DouyinQrcodeParamsSchema, DouyinSearchParamsSchema, DouyinUserListParamsSchema, DouyinUserParamsSchema, DouyinValidationSchemas, DouyinWorkParamsSchema, DynamicType, KuaishouApiRoutes, KuaishouCommentParamsSchema, KuaishouEmojiParamsSchema, KuaishouFetcherMethods, KuaishouInternalMethods, KuaishouLiveRoomInfoParamsSchema, KuaishouMethodMapping, KuaishouMethodRoutes, KuaishouMethodToFetcher, KuaishouUserProfileParamsSchema, KuaishouUserWorkListParamsSchema, KuaishouValidationSchemas, KuaishouVideoParamsSchema, MajorType, MethodMaps, ValidationError, XiaohongshuApiRoutes, XiaohongshuFetcherMethods, XiaohongshuInternalMethods, XiaohongshuMethodMapping, XiaohongshuMethodRoutes, XiaohongshuMethodToFetcher, XiaohongshuValidationSchemas, amagi, amagiEvents, av2bv, bilibiliApiUrls, bilibiliErrorCodeMap, bilibiliFetcher, bilibiliUtils, bv2av, createAmagiClient, createBilibiliRoutes, createBilibiliRoutes as registerBilibiliRoutes, createBoundBilibiliFetcher, createBoundDouyinFetcher, createBoundKuaishouFetcher, createBoundXiaohongshuFetcher, createDouyinRoutes, createDouyinRoutes as registerDouyinRoutes, createErrorResponse, createKuaishouRoutes, createKuaishouRoutes as registerKuaishouRoutes, createSuccessResponse, createXiaohongshuRoutes, createXiaohongshuRoutes as registerXiaohongshuRoutes, Client as default, douyinApiUrls, douyinFetcher, douyinSign, douyinUtils, emitApiError, emitApiSuccess, emitHttpRequest, emitHttpResponse, emitLog, emitLogDebug, emitLogError, emitLogInfo, emitLogMark, emitLogWarn, emitNetworkError, emitNetworkRetry, fetchData, fetchResponse, getApiRoute, getEnglishMethodName, getHeadersAndData, handleError, isNetworkErrorResult, kuaishouApiUrls, kuaishouFetcher, kuaishouSign, kuaishouUtils, parseDmSegMobileReply, qtparam, toFetcherMethod, validateBilibiliParams, validateDouyinParams, validateKuaishouParams, validateXiaohongshuParams, wbi_sign, xiaohongshuApiUrls, xiaohongshuFetcher, xiaohongshuSign, xiaohongshuUtils };
|