@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.cjs
CHANGED
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_rolldown_runtime = require("../rolldown-runtime-
|
|
5
|
+
const require_rolldown_runtime = require("../rolldown-runtime-VH7oDXx4.cjs");
|
|
6
6
|
let node_url = require("node:url");
|
|
7
7
|
node_url = require_rolldown_runtime.__toESM(node_url, 1);
|
|
8
8
|
let node_events = require("node:events");
|
|
@@ -13,450 +13,11 @@ let node_crypto = require("node:crypto");
|
|
|
13
13
|
node_crypto = require_rolldown_runtime.__toESM(node_crypto, 1);
|
|
14
14
|
let axios = require("axios");
|
|
15
15
|
axios = require_rolldown_runtime.__toESM(axios, 1);
|
|
16
|
-
let chalk = require("chalk");
|
|
17
16
|
let protobufjs = require("protobufjs");
|
|
18
17
|
protobufjs = require_rolldown_runtime.__toESM(protobufjs, 1);
|
|
19
18
|
let express = require("express");
|
|
20
19
|
express = require_rolldown_runtime.__toESM(express, 1);
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* 废弃 API 注册表
|
|
24
|
-
* 存储所有已注册的废弃 API 配置
|
|
25
|
-
*/
|
|
26
|
-
const deprecatedApis = /* @__PURE__ */ new Map();
|
|
27
|
-
/**
|
|
28
|
-
* 注册一个废弃的 API
|
|
29
|
-
*
|
|
30
|
-
* 将 API 添加到废弃注册表中,后续可通过 checkDeprecation 检查
|
|
31
|
-
*
|
|
32
|
-
* @param config - 废弃配置对象
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```typescript
|
|
36
|
-
* registerDeprecatedApi({
|
|
37
|
-
* name: 'getDouyinData',
|
|
38
|
-
* deprecatedIn: '6.0.0',
|
|
39
|
-
* removedIn: '7.0.0',
|
|
40
|
-
* replacement: 'douyinFetcher',
|
|
41
|
-
* throwError: true
|
|
42
|
-
* })
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
|
-
function registerDeprecatedApi(config) {
|
|
46
|
-
deprecatedApis.set(config.name, config);
|
|
47
|
-
}
|
|
48
|
-
/**
|
|
49
|
-
* 检查 API 是否已废弃并进行相应处理
|
|
50
|
-
*
|
|
51
|
-
* 如果 API 已注册为废弃,根据配置决定是打印警告还是抛出错误
|
|
52
|
-
*
|
|
53
|
-
* @param apiName - 要检查的 API 名称
|
|
54
|
-
* @throws {DeprecatedApiError} 如果 API 已废弃且配置为抛出错误
|
|
55
|
-
*
|
|
56
|
-
* @example
|
|
57
|
-
* ```typescript
|
|
58
|
-
* // 在函数开头调用检查
|
|
59
|
-
* function getDouyinData(options) {
|
|
60
|
-
* checkDeprecation('getDouyinData')
|
|
61
|
-
* // ...
|
|
62
|
-
* }
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
function checkDeprecation(apiName) {
|
|
66
|
-
const config = deprecatedApis.get(apiName);
|
|
67
|
-
if (!config) return;
|
|
68
|
-
const message = buildDeprecationMessage(config);
|
|
69
|
-
if (config.throwError) throw new DeprecatedApiError(message, config);
|
|
70
|
-
else console.warn(message);
|
|
71
|
-
}
|
|
72
|
-
/**
|
|
73
|
-
* 根据配置构建废弃提示消息
|
|
74
|
-
*
|
|
75
|
-
* @param config - 废弃配置
|
|
76
|
-
* @returns 格式化的废弃提示消息字符串
|
|
77
|
-
*/
|
|
78
|
-
function buildDeprecationMessage(config) {
|
|
79
|
-
const lines = [`[DEPRECATED] "${config.name}" 已在 v${config.deprecatedIn} 版本废弃。`];
|
|
80
|
-
if (config.replacement) lines.push(`请使用 "${config.replacement}" 替代。`);
|
|
81
|
-
else lines.push("此接口已被上游删除,无法继续使用,无可用替代方案。");
|
|
82
|
-
if (config.removedIn) lines.push(`此 API 将在 v${config.removedIn} 版本移除。`);
|
|
83
|
-
if (config.migrationGuide) lines.push(`迁移指南: ${config.migrationGuide}`);
|
|
84
|
-
return lines.join("\n");
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* 废弃 API 调用错误类
|
|
88
|
-
*
|
|
89
|
-
* 当调用已废弃且配置为抛出错误的 API 时抛出此错误
|
|
90
|
-
* 包含完整的废弃配置信息,便于调试和迁移
|
|
91
|
-
*/
|
|
92
|
-
var DeprecatedApiError = class DeprecatedApiError extends Error {
|
|
93
|
-
/** 废弃配置信息,包含替代方案等详细信息 */
|
|
94
|
-
config;
|
|
95
|
-
/**
|
|
96
|
-
* 创建废弃 API 错误实例
|
|
97
|
-
*
|
|
98
|
-
* @param message - 错误消息
|
|
99
|
-
* @param config - 废弃配置对象
|
|
100
|
-
*/
|
|
101
|
-
constructor(message, config) {
|
|
102
|
-
super(message);
|
|
103
|
-
this.name = "DeprecatedApiError";
|
|
104
|
-
this.config = config;
|
|
105
|
-
Error.captureStackTrace?.(this, DeprecatedApiError);
|
|
106
|
-
}
|
|
107
|
-
};
|
|
108
|
-
registerDeprecatedApi({
|
|
109
|
-
name: "getDouyinData",
|
|
110
|
-
deprecatedIn: "6.0.0",
|
|
111
|
-
removedIn: "7.0.0",
|
|
112
|
-
replacement: "douyinFetcher 或 client.douyin.fetcher",
|
|
113
|
-
migrationGuide: "https://github.com/ikenxuan/amagi/blob/main/packages/core/MIGRATION-v6.md",
|
|
114
|
-
throwError: true
|
|
115
|
-
});
|
|
116
|
-
registerDeprecatedApi({
|
|
117
|
-
name: "getBilibiliData",
|
|
118
|
-
deprecatedIn: "6.0.0",
|
|
119
|
-
removedIn: "7.0.0",
|
|
120
|
-
replacement: "bilibiliFetcher 或 client.bilibili.fetcher",
|
|
121
|
-
migrationGuide: "https://github.com/ikenxuan/amagi/blob/main/packages/core/MIGRATION-v6.md",
|
|
122
|
-
throwError: true
|
|
123
|
-
});
|
|
124
|
-
registerDeprecatedApi({
|
|
125
|
-
name: "getKuaishouData",
|
|
126
|
-
deprecatedIn: "6.0.0",
|
|
127
|
-
removedIn: "7.0.0",
|
|
128
|
-
replacement: "kuaishouFetcher 或 client.kuaishou.fetcher",
|
|
129
|
-
migrationGuide: "https://github.com/ikenxuan/amagi/blob/main/packages/core/MIGRATION-v6.md",
|
|
130
|
-
throwError: true
|
|
131
|
-
});
|
|
132
|
-
registerDeprecatedApi({
|
|
133
|
-
name: "getXiaohongshuData",
|
|
134
|
-
deprecatedIn: "6.0.0",
|
|
135
|
-
removedIn: "7.0.0",
|
|
136
|
-
replacement: "xiaohongshuFetcher 或 client.xiaohongshu.fetcher",
|
|
137
|
-
migrationGuide: "https://github.com/ikenxuan/amagi/blob/main/packages/core/MIGRATION-v6.md",
|
|
138
|
-
throwError: true
|
|
139
|
-
});
|
|
140
|
-
[
|
|
141
|
-
{
|
|
142
|
-
name: "单个视频作品数据",
|
|
143
|
-
replacement: "fetchVideoInfo"
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
name: "单个视频下载信息数据",
|
|
147
|
-
replacement: "fetchVideoStreamUrl"
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
name: "评论数据",
|
|
151
|
-
replacement: "fetchComments"
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
name: "指定评论的回复",
|
|
155
|
-
replacement: "fetchCommentReplies"
|
|
156
|
-
},
|
|
157
|
-
{
|
|
158
|
-
name: "用户主页数据",
|
|
159
|
-
replacement: "fetchUserCard"
|
|
160
|
-
},
|
|
161
|
-
{
|
|
162
|
-
name: "用户主页动态列表数据",
|
|
163
|
-
replacement: "fetchUserDynamicList"
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
name: "用户空间详细信息",
|
|
167
|
-
replacement: "fetchUserSpaceInfo"
|
|
168
|
-
},
|
|
169
|
-
{
|
|
170
|
-
name: "获取UP主总播放量",
|
|
171
|
-
replacement: "fetchUploaderTotalViews"
|
|
172
|
-
},
|
|
173
|
-
{
|
|
174
|
-
name: "Emoji数据",
|
|
175
|
-
replacement: "fetchEmojiList"
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
name: "番剧基本信息数据",
|
|
179
|
-
replacement: "fetchBangumiInfo"
|
|
180
|
-
},
|
|
181
|
-
{
|
|
182
|
-
name: "番剧下载信息数据",
|
|
183
|
-
replacement: "fetchBangumiStreamUrl"
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
name: "动态详情数据",
|
|
187
|
-
replacement: "fetchDynamicDetail"
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
name: "直播间信息",
|
|
191
|
-
replacement: "fetchLiveRoomInfo"
|
|
192
|
-
},
|
|
193
|
-
{
|
|
194
|
-
name: "直播间初始化信息",
|
|
195
|
-
replacement: "fetchLiveRoomInitInfo"
|
|
196
|
-
},
|
|
197
|
-
{
|
|
198
|
-
name: "登录基本信息",
|
|
199
|
-
replacement: "fetchLoginStatus"
|
|
200
|
-
},
|
|
201
|
-
{
|
|
202
|
-
name: "申请二维码",
|
|
203
|
-
replacement: "requestLoginQrcode"
|
|
204
|
-
},
|
|
205
|
-
{
|
|
206
|
-
name: "二维码状态",
|
|
207
|
-
replacement: "checkQrcodeStatus"
|
|
208
|
-
},
|
|
209
|
-
{
|
|
210
|
-
name: "AV转BV",
|
|
211
|
-
replacement: "convertAvToBv"
|
|
212
|
-
},
|
|
213
|
-
{
|
|
214
|
-
name: "BV转AV",
|
|
215
|
-
replacement: "convertBvToAv"
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
name: "专栏正文内容",
|
|
219
|
-
replacement: "fetchArticleContent"
|
|
220
|
-
},
|
|
221
|
-
{
|
|
222
|
-
name: "专栏显示卡片信息",
|
|
223
|
-
replacement: "fetchArticleCards"
|
|
224
|
-
},
|
|
225
|
-
{
|
|
226
|
-
name: "专栏文章基本信息",
|
|
227
|
-
replacement: "fetchArticleInfo"
|
|
228
|
-
},
|
|
229
|
-
{
|
|
230
|
-
name: "文集基本信息",
|
|
231
|
-
replacement: "fetchArticleListInfo"
|
|
232
|
-
},
|
|
233
|
-
{
|
|
234
|
-
name: "实时弹幕",
|
|
235
|
-
replacement: "fetchVideoDanmaku"
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
name: "从_v_voucher_申请_captcha",
|
|
239
|
-
replacement: "requestCaptchaFromVoucher"
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
name: "验证验证码结果",
|
|
243
|
-
replacement: "validateCaptchaResult"
|
|
244
|
-
},
|
|
245
|
-
{
|
|
246
|
-
name: "视频作品数据",
|
|
247
|
-
replacement: "fetchVideoWork"
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
name: "图集作品数据",
|
|
251
|
-
replacement: "fetchImageAlbumWork"
|
|
252
|
-
},
|
|
253
|
-
{
|
|
254
|
-
name: "合辑作品数据",
|
|
255
|
-
replacement: "fetchSlidesWork"
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
name: "文字作品数据",
|
|
259
|
-
replacement: "fetchTextWork"
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
name: "聚合解析",
|
|
263
|
-
replacement: "parseWork"
|
|
264
|
-
},
|
|
265
|
-
{
|
|
266
|
-
name: "指定评论回复数据",
|
|
267
|
-
replacement: "fetchCommentReplies"
|
|
268
|
-
},
|
|
269
|
-
{
|
|
270
|
-
name: "用户主页视频列表数据",
|
|
271
|
-
replacement: "fetchUserVideoList"
|
|
272
|
-
},
|
|
273
|
-
{
|
|
274
|
-
name: "热点词数据",
|
|
275
|
-
replacement: "fetchSuggestWords"
|
|
276
|
-
},
|
|
277
|
-
{
|
|
278
|
-
name: "搜索数据",
|
|
279
|
-
replacement: "searchContent"
|
|
280
|
-
},
|
|
281
|
-
{
|
|
282
|
-
name: "音乐数据",
|
|
283
|
-
replacement: "fetchMusicInfo"
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
name: "直播间信息数据",
|
|
287
|
-
replacement: "fetchLiveRoomInfo"
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
name: "申请二维码数据",
|
|
291
|
-
replacement: "requestLoginQrcode"
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
name: "动态表情数据",
|
|
295
|
-
replacement: "fetchDynamicEmojiList"
|
|
296
|
-
},
|
|
297
|
-
{
|
|
298
|
-
name: "弹幕数据",
|
|
299
|
-
replacement: "fetchDanmakuList"
|
|
300
|
-
},
|
|
301
|
-
{
|
|
302
|
-
name: "单个视频作品数据",
|
|
303
|
-
replacement: "fetchVideoWork"
|
|
304
|
-
},
|
|
305
|
-
{
|
|
306
|
-
name: "首页推荐数据",
|
|
307
|
-
replacement: "fetchHomeFeed"
|
|
308
|
-
},
|
|
309
|
-
{
|
|
310
|
-
name: "单个笔记数据",
|
|
311
|
-
replacement: "fetchNoteDetail"
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
name: "用户数据",
|
|
315
|
-
replacement: "fetchUserProfile"
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
name: "用户笔记数据",
|
|
319
|
-
replacement: "fetchUserNoteList"
|
|
320
|
-
},
|
|
321
|
-
{
|
|
322
|
-
name: "表情列表",
|
|
323
|
-
replacement: "fetchEmojiList"
|
|
324
|
-
},
|
|
325
|
-
{
|
|
326
|
-
name: "搜索笔记",
|
|
327
|
-
replacement: "searchNotes"
|
|
328
|
-
}
|
|
329
|
-
].forEach(({ name, replacement }) => {
|
|
330
|
-
registerDeprecatedApi({
|
|
331
|
-
name: `methodType: '${name}'`,
|
|
332
|
-
deprecatedIn: "6.0.0",
|
|
333
|
-
removedIn: "7.0.0",
|
|
334
|
-
replacement: `fetcher.${replacement}()`,
|
|
335
|
-
throwError: true
|
|
336
|
-
});
|
|
337
|
-
});
|
|
338
|
-
registerDeprecatedApi({
|
|
339
|
-
name: `methodType: '动态卡片数据'`,
|
|
340
|
-
deprecatedIn: "6.0.0",
|
|
341
|
-
removedIn: "7.0.0",
|
|
342
|
-
migrationGuide: "https://amagi-docs.vercel.app/docs/changelog/6.1.3",
|
|
343
|
-
throwError: false
|
|
344
|
-
});
|
|
345
|
-
registerDeprecatedApi({
|
|
346
|
-
name: "fetchDynamicCard",
|
|
347
|
-
deprecatedIn: "6.1.3",
|
|
348
|
-
removedIn: "7.0.0",
|
|
349
|
-
migrationGuide: "https://amagi-docs.vercel.app/docs/changelog/6.1.3",
|
|
350
|
-
throwError: false
|
|
351
|
-
});
|
|
352
|
-
//#endregion
|
|
353
|
-
//#region src/model/DataFetchers.ts
|
|
354
|
-
/**
|
|
355
|
-
* 数据获取器模块 (已废弃)
|
|
356
|
-
*
|
|
357
|
-
* 此模块中的 getXXXData 函数已在 v6 版本废弃并移除
|
|
358
|
-
* 请使用新的 fetcher API 替代
|
|
359
|
-
*
|
|
360
|
-
* @module model/DataFetchers
|
|
361
|
-
* @deprecated v6 已废弃,请使用 fetcher API 替代
|
|
362
|
-
*/
|
|
363
|
-
/**
|
|
364
|
-
* 获取抖音数据
|
|
365
|
-
*
|
|
366
|
-
* @deprecated v6 已废弃,请使用 douyinFetcher 或 client.douyin.fetcher 替代
|
|
367
|
-
* @throws {DeprecatedApiError} 调用时抛出废弃错误
|
|
368
|
-
*
|
|
369
|
-
* @example
|
|
370
|
-
* ```typescript
|
|
371
|
-
* // 旧用法 (已废弃,会抛出错误)
|
|
372
|
-
* const data = await getDouyinData('videoWork', { aweme_id: '123' }, cookie)
|
|
373
|
-
*
|
|
374
|
-
* // 新用法
|
|
375
|
-
* import { douyinFetcher } from '@ikenxuan/amagi'
|
|
376
|
-
* const data = await douyinFetcher.fetchVideoWork({ aweme_id: '123' }, cookie)
|
|
377
|
-
*
|
|
378
|
-
* // 或使用客户端实例
|
|
379
|
-
* const client = createAmagiClient({ cookies: { douyin: cookie } })
|
|
380
|
-
* const data = await client.douyin.fetcher.fetchVideoWork({ aweme_id: '123' })
|
|
381
|
-
* ```
|
|
382
|
-
*/
|
|
383
|
-
function getDouyinData(..._args) {
|
|
384
|
-
checkDeprecation("getDouyinData");
|
|
385
|
-
throw new Error("getDouyinData 已废弃");
|
|
386
|
-
}
|
|
387
|
-
/**
|
|
388
|
-
* 获取B站数据
|
|
389
|
-
*
|
|
390
|
-
* @deprecated v6 已废弃,请使用 bilibiliFetcher 或 client.bilibili.fetcher 替代
|
|
391
|
-
* @throws {DeprecatedApiError} 调用时抛出废弃错误
|
|
392
|
-
*
|
|
393
|
-
* @example
|
|
394
|
-
* ```typescript
|
|
395
|
-
* // 旧用法 (已废弃,会抛出错误)
|
|
396
|
-
* const data = await getBilibiliData('videoInfo', { bvid: 'BV123' }, cookie)
|
|
397
|
-
*
|
|
398
|
-
* // 新用法
|
|
399
|
-
* import { bilibiliFetcher } from '@ikenxuan/amagi'
|
|
400
|
-
* const data = await bilibiliFetcher.fetchVideoInfo({ bvid: 'BV123' }, cookie)
|
|
401
|
-
*
|
|
402
|
-
* // 或使用客户端实例
|
|
403
|
-
* const client = createAmagiClient({ cookies: { bilibili: cookie } })
|
|
404
|
-
* const data = await client.bilibili.fetcher.fetchVideoInfo({ bvid: 'BV123' })
|
|
405
|
-
* ```
|
|
406
|
-
*/
|
|
407
|
-
function getBilibiliData(..._args) {
|
|
408
|
-
checkDeprecation("getBilibiliData");
|
|
409
|
-
throw new Error("getBilibiliData 已废弃");
|
|
410
|
-
}
|
|
411
|
-
/**
|
|
412
|
-
* 获取快手数据
|
|
413
|
-
*
|
|
414
|
-
* @deprecated v6 已废弃,请使用 kuaishouFetcher 或 client.kuaishou.fetcher 替代
|
|
415
|
-
* @throws {DeprecatedApiError} 调用时抛出废弃错误
|
|
416
|
-
*
|
|
417
|
-
* @example
|
|
418
|
-
* ```typescript
|
|
419
|
-
* // 旧用法 (已废弃,会抛出错误)
|
|
420
|
-
* const data = await getKuaishouData('videoWork', { photoId: '123' }, cookie)
|
|
421
|
-
*
|
|
422
|
-
* // 新用法
|
|
423
|
-
* import { kuaishouFetcher } from '@ikenxuan/amagi'
|
|
424
|
-
* const data = await kuaishouFetcher.fetchVideoWork({ photoId: '123' }, cookie)
|
|
425
|
-
*
|
|
426
|
-
* // 或使用客户端实例
|
|
427
|
-
* const client = createAmagiClient({ cookies: { kuaishou: cookie } })
|
|
428
|
-
* const data = await client.kuaishou.fetcher.fetchVideoWork({ photoId: '123' })
|
|
429
|
-
* ```
|
|
430
|
-
*/
|
|
431
|
-
function getKuaishouData(..._args) {
|
|
432
|
-
checkDeprecation("getKuaishouData");
|
|
433
|
-
throw new Error("getKuaishouData 已废弃");
|
|
434
|
-
}
|
|
435
|
-
/**
|
|
436
|
-
* 获取小红书数据
|
|
437
|
-
*
|
|
438
|
-
* @deprecated v6 已废弃,请使用 xiaohongshuFetcher 或 client.xiaohongshu.fetcher 替代
|
|
439
|
-
* @throws {DeprecatedApiError} 调用时抛出废弃错误
|
|
440
|
-
*
|
|
441
|
-
* @example
|
|
442
|
-
* ```typescript
|
|
443
|
-
* // 旧用法 (已废弃,会抛出错误)
|
|
444
|
-
* const data = await getXiaohongshuData('noteDetail', { note_id: '123' }, cookie)
|
|
445
|
-
*
|
|
446
|
-
* // 新用法
|
|
447
|
-
* import { xiaohongshuFetcher } from '@ikenxuan/amagi'
|
|
448
|
-
* const data = await xiaohongshuFetcher.fetchNoteDetail({ note_id: '123' }, cookie)
|
|
449
|
-
*
|
|
450
|
-
* // 或使用客户端实例
|
|
451
|
-
* const client = createAmagiClient({ cookies: { xiaohongshu: cookie } })
|
|
452
|
-
* const data = await client.xiaohongshu.fetcher.fetchNoteDetail({ note_id: '123' })
|
|
453
|
-
* ```
|
|
454
|
-
*/
|
|
455
|
-
function getXiaohongshuData(..._args) {
|
|
456
|
-
checkDeprecation("getXiaohongshuData");
|
|
457
|
-
throw new Error("getXiaohongshuData 已废弃");
|
|
458
|
-
}
|
|
459
|
-
//#endregion
|
|
20
|
+
let chalk = require("chalk");
|
|
460
21
|
//#region src/platform/bilibili/API.ts
|
|
461
22
|
/**
|
|
462
23
|
* B站 API URL 构建类
|
|
@@ -528,15 +89,6 @@ var BilibiliAPI = class {
|
|
|
528
89
|
getDynamicDetail(data) {
|
|
529
90
|
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`;
|
|
530
91
|
}
|
|
531
|
-
/**
|
|
532
|
-
* 获取动态卡片信息
|
|
533
|
-
*
|
|
534
|
-
* @deprecated B站官方已于 `2025-08-09` 删除原 `dynamic_svr` 接口,该接口已停用。
|
|
535
|
-
* 调用将返回错误信息,请使用 {@link getDynamicDetail} 替代。
|
|
536
|
-
*/
|
|
537
|
-
getDynamicCard(data) {
|
|
538
|
-
return this.getDynamicDetail(data);
|
|
539
|
-
}
|
|
540
92
|
/** 获取用户名片信息 */
|
|
541
93
|
getUserCard(data) {
|
|
542
94
|
return `https://api.bilibili.com/x/web-interface/card?mid=${data.host_mid}&photo=true`;
|
|
@@ -628,86 +180,6 @@ var BilibiliAPI = class {
|
|
|
628
180
|
/** B站 API URL 构建器实例 */
|
|
629
181
|
const bilibiliApiUrls = new BilibiliAPI();
|
|
630
182
|
//#endregion
|
|
631
|
-
//#region src/platform/bilibili/BilibiliApi.ts
|
|
632
|
-
/**
|
|
633
|
-
* 创建废弃的 API 存根函数
|
|
634
|
-
*/
|
|
635
|
-
const createDeprecatedStub$3 = (methodName) => {
|
|
636
|
-
return (..._args) => {
|
|
637
|
-
checkDeprecation("getBilibiliData");
|
|
638
|
-
throw new Error(`bilibili.${methodName} 已废弃,请使用 bilibiliFetcher 替代`);
|
|
639
|
-
};
|
|
640
|
-
};
|
|
641
|
-
/**
|
|
642
|
-
* B站相关 API 的命名空间。
|
|
643
|
-
*
|
|
644
|
-
* @deprecated v6 已废弃,请使用 bilibiliFetcher 或 client.bilibili.fetcher 替代
|
|
645
|
-
*/
|
|
646
|
-
const bilibili = {
|
|
647
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchVideoInfo 替代 */
|
|
648
|
-
getVideoInfo: createDeprecatedStub$3("getVideoInfo"),
|
|
649
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchVideoStreamUrl 替代 */
|
|
650
|
-
getVideoStream: createDeprecatedStub$3("getVideoStream"),
|
|
651
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchComments 替代 */
|
|
652
|
-
getComments: createDeprecatedStub$3("getComments"),
|
|
653
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchCommentReplies 替代 */
|
|
654
|
-
getCommentReply: createDeprecatedStub$3("getCommentReply"),
|
|
655
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchUserCard 替代 */
|
|
656
|
-
getUserProfile: createDeprecatedStub$3("getUserProfile"),
|
|
657
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchUserDynamicList 替代 */
|
|
658
|
-
getUserDynamic: createDeprecatedStub$3("getUserDynamic"),
|
|
659
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchEmojiList 替代 */
|
|
660
|
-
getEmojiList: createDeprecatedStub$3("getEmojiList"),
|
|
661
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchBangumiInfo 替代 */
|
|
662
|
-
getBangumiInfo: createDeprecatedStub$3("getBangumiInfo"),
|
|
663
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchBangumiStreamUrl 替代 */
|
|
664
|
-
getBangumiStream: createDeprecatedStub$3("getBangumiStream"),
|
|
665
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchDynamicDetail 替代 */
|
|
666
|
-
getDynamicInfo: createDeprecatedStub$3("getDynamicInfo"),
|
|
667
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchDynamicCard 替代 */
|
|
668
|
-
getDynamicCard: createDeprecatedStub$3("getDynamicCard"),
|
|
669
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchLiveRoomInfo 替代 */
|
|
670
|
-
getLiveRoomDetail: createDeprecatedStub$3("getLiveRoomDetail"),
|
|
671
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchLiveRoomInitInfo 替代 */
|
|
672
|
-
getLiveRoomInitInfo: createDeprecatedStub$3("getLiveRoomInitInfo"),
|
|
673
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchLoginStatus 替代 */
|
|
674
|
-
getLoginBasicInfo: createDeprecatedStub$3("getLoginBasicInfo"),
|
|
675
|
-
/** @deprecated 请使用 bilibiliFetcher.requestLoginQrcode 替代 */
|
|
676
|
-
getLoginQrcode: createDeprecatedStub$3("getLoginQrcode"),
|
|
677
|
-
/** @deprecated 请使用 bilibiliFetcher.checkQrcodeStatus 替代 */
|
|
678
|
-
checkQrcodeStatus: createDeprecatedStub$3("checkQrcodeStatus"),
|
|
679
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchUploaderTotalViews 替代 */
|
|
680
|
-
getUserTotalPlayCount: createDeprecatedStub$3("getUserTotalPlayCount"),
|
|
681
|
-
/** @deprecated 请使用 bilibiliFetcher.convertAvToBv 替代 */
|
|
682
|
-
convertAvToBv: createDeprecatedStub$3("convertAvToBv"),
|
|
683
|
-
/** @deprecated 请使用 bilibiliFetcher.convertBvToAv 替代 */
|
|
684
|
-
convertBvToAv: createDeprecatedStub$3("convertBvToAv"),
|
|
685
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchArticleContent 替代 */
|
|
686
|
-
getArticleContent: createDeprecatedStub$3("getArticleContent"),
|
|
687
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchArticleCards 替代 */
|
|
688
|
-
getArticleCard: createDeprecatedStub$3("getArticleCard"),
|
|
689
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchArticleInfo 替代 */
|
|
690
|
-
getArticleInfo: createDeprecatedStub$3("getArticleInfo"),
|
|
691
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchArticleListInfo 替代 */
|
|
692
|
-
getColumnInfo: createDeprecatedStub$3("getColumnInfo"),
|
|
693
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchUserSpaceInfo 替代 */
|
|
694
|
-
getUserProfileDetail: createDeprecatedStub$3("getUserProfileDetail"),
|
|
695
|
-
/** @deprecated 请使用 bilibiliFetcher.requestCaptchaFromVoucher 替代 */
|
|
696
|
-
applyVoucherCaptcha: createDeprecatedStub$3("applyVoucherCaptcha"),
|
|
697
|
-
/** @deprecated 请使用 bilibiliFetcher.validateCaptchaResult 替代 */
|
|
698
|
-
validateCaptcha: createDeprecatedStub$3("validateCaptcha"),
|
|
699
|
-
/** @deprecated 请使用 bilibiliFetcher.fetchVideoDanmaku 替代 */
|
|
700
|
-
getDanmaku: createDeprecatedStub$3("getDanmaku")
|
|
701
|
-
};
|
|
702
|
-
/**
|
|
703
|
-
* 创建绑定了cookie的B站API对象
|
|
704
|
-
*
|
|
705
|
-
* @deprecated v6 已废弃,请使用 createBoundBilibiliFetcher 替代
|
|
706
|
-
*/
|
|
707
|
-
const createBoundBilibiliApi = (_cookie, _requestConfig) => {
|
|
708
|
-
return { ...bilibili };
|
|
709
|
-
};
|
|
710
|
-
//#endregion
|
|
711
183
|
//#region src/model/events.ts
|
|
712
184
|
/**
|
|
713
185
|
* Amagi 事件系统
|
|
@@ -1020,7 +492,7 @@ const BilibiliBangumiStreamParamsSchema = zod.default.object({
|
|
|
1020
492
|
});
|
|
1021
493
|
/** 动态参数验证 */
|
|
1022
494
|
const BilibiliDynamicParamsSchema = zod.default.object({
|
|
1023
|
-
methodType: zod.default.
|
|
495
|
+
methodType: zod.default.literal("dynamicDetail", { error: "方法类型必须是\"dynamicDetail\"" }),
|
|
1024
496
|
dynamic_id: zod.default.string({ error: "动态ID必须是字符串" }).min(1, { error: "动态ID不能为空" })
|
|
1025
497
|
});
|
|
1026
498
|
/** 直播间参数验证 */
|
|
@@ -1102,7 +574,6 @@ const BilibiliValidationSchemas = {
|
|
|
1102
574
|
bangumiInfo: BilibiliBangumiInfoParamsSchema,
|
|
1103
575
|
bangumiStream: BilibiliBangumiStreamParamsSchema,
|
|
1104
576
|
dynamicDetail: BilibiliDynamicParamsSchema,
|
|
1105
|
-
dynamicCard: BilibiliDynamicParamsSchema,
|
|
1106
577
|
liveRoomInfo: BilibiliLiveParamsSchema,
|
|
1107
578
|
liveRoomInit: BilibiliLiveParamsSchema,
|
|
1108
579
|
loginStatus: BilibiliLoginParamsSchema,
|
|
@@ -1133,7 +604,6 @@ const BilibiliMethodRoutes = {
|
|
|
1133
604
|
bangumiInfo: "/fetch_bangumi_video_info",
|
|
1134
605
|
bangumiStream: "/fetch_bangumi_video_playurl",
|
|
1135
606
|
dynamicDetail: "/fetch_dynamic_info",
|
|
1136
|
-
dynamicCard: "/fetch_dynamic_card",
|
|
1137
607
|
liveRoomInfo: "/fetch_live_room_detail",
|
|
1138
608
|
liveRoomInit: "/fetch_liveroom_def",
|
|
1139
609
|
loginStatus: "/login_basic_info",
|
|
@@ -1710,18 +1180,20 @@ const xiaohongshuApiUrls = {
|
|
|
1710
1180
|
* @returns 完整的接口URL
|
|
1711
1181
|
*/
|
|
1712
1182
|
noteComments(data) {
|
|
1183
|
+
const baseUrl = "https://edith.xiaohongshu.com/api/sns/web/v2/comment/page";
|
|
1184
|
+
const params = {
|
|
1185
|
+
note_id: data.note_id,
|
|
1186
|
+
cursor: data.cursor ?? "",
|
|
1187
|
+
image_formats: [
|
|
1188
|
+
"jpg",
|
|
1189
|
+
"webp",
|
|
1190
|
+
"avif"
|
|
1191
|
+
].join(","),
|
|
1192
|
+
xsec_token: data.xsec_token
|
|
1193
|
+
};
|
|
1713
1194
|
return {
|
|
1714
1195
|
apiPath: "/api/sns/web/v2/comment/page",
|
|
1715
|
-
Url:
|
|
1716
|
-
note_id: data.note_id,
|
|
1717
|
-
cursor: data.cursor ?? "",
|
|
1718
|
-
image_formats: [
|
|
1719
|
-
"jpg",
|
|
1720
|
-
"webp",
|
|
1721
|
-
"avif"
|
|
1722
|
-
].join(","),
|
|
1723
|
-
xsec_token: data.xsec_token
|
|
1724
|
-
})}`
|
|
1196
|
+
Url: `${baseUrl}?${buildQueryString$1(params)}`
|
|
1725
1197
|
};
|
|
1726
1198
|
},
|
|
1727
1199
|
/**
|
|
@@ -1741,19 +1213,21 @@ const xiaohongshuApiUrls = {
|
|
|
1741
1213
|
* @returns 完整的接口URL
|
|
1742
1214
|
*/
|
|
1743
1215
|
userNoteList(data) {
|
|
1216
|
+
const baseUrl = "https://edith.xiaohongshu.com/api/sns/web/v1/user_posted";
|
|
1217
|
+
const params = {
|
|
1218
|
+
user_id: data.user_id,
|
|
1219
|
+
cursor: data.cursor ?? "",
|
|
1220
|
+
num: data.num ?? 30,
|
|
1221
|
+
image_formats: [
|
|
1222
|
+
"jpg",
|
|
1223
|
+
"webp",
|
|
1224
|
+
"avif"
|
|
1225
|
+
].join(","),
|
|
1226
|
+
xsec_source: "pc_feed"
|
|
1227
|
+
};
|
|
1744
1228
|
return {
|
|
1745
1229
|
apiPath: "/api/sns/web/v1/user_posted",
|
|
1746
|
-
Url:
|
|
1747
|
-
user_id: data.user_id,
|
|
1748
|
-
cursor: data.cursor ?? "",
|
|
1749
|
-
num: data.num ?? 30,
|
|
1750
|
-
image_formats: [
|
|
1751
|
-
"jpg",
|
|
1752
|
-
"webp",
|
|
1753
|
-
"avif"
|
|
1754
|
-
].join(","),
|
|
1755
|
-
xsec_source: "pc_feed"
|
|
1756
|
-
})}`
|
|
1230
|
+
Url: `${baseUrl}?${buildQueryString$1(params)}`
|
|
1757
1231
|
};
|
|
1758
1232
|
},
|
|
1759
1233
|
/**
|
|
@@ -1970,7 +1444,8 @@ const createErrorResponse = (error, message, code = 500, data) => {
|
|
|
1970
1444
|
async function fetchBilibiliInternal(methodType, options, config) {
|
|
1971
1445
|
const startTime = Date.now();
|
|
1972
1446
|
try {
|
|
1973
|
-
const
|
|
1447
|
+
const apiParams = { ...validateBilibiliParams(methodType, options) };
|
|
1448
|
+
const rawData = await fetchBilibili(apiParams, config.cookie, config.requestConfig);
|
|
1974
1449
|
const duration = Date.now() - startTime;
|
|
1975
1450
|
if (rawData.code !== 0) {
|
|
1976
1451
|
const errorMessage = rawData.message || "B站数据获取失败";
|
|
@@ -1982,11 +1457,12 @@ async function fetchBilibiliInternal(methodType, options, config) {
|
|
|
1982
1457
|
url: void 0,
|
|
1983
1458
|
duration
|
|
1984
1459
|
});
|
|
1985
|
-
|
|
1460
|
+
const amagiError = rawData.amagiError ?? {
|
|
1986
1461
|
errorDescription: errorMessage,
|
|
1987
1462
|
requestType: methodType,
|
|
1988
1463
|
requestUrl: void 0
|
|
1989
|
-
}
|
|
1464
|
+
};
|
|
1465
|
+
return createErrorResponse(amagiError, errorMessage, rawData.code, rawData);
|
|
1990
1466
|
}
|
|
1991
1467
|
const result = createSuccessResponse(rawData, "获取成功", 200);
|
|
1992
1468
|
emitApiSuccess({
|
|
@@ -2293,31 +1769,6 @@ async function fetchDynamicDetail(options, cookie, requestConfig) {
|
|
|
2293
1769
|
requestConfig
|
|
2294
1770
|
});
|
|
2295
1771
|
}
|
|
2296
|
-
/**
|
|
2297
|
-
* 获取B站动态卡片信息
|
|
2298
|
-
*
|
|
2299
|
-
* @deprecated v6.1.3 已废弃,B站官方已于 `2025-08-09` 删除原 `dynamic_svr` 接口。
|
|
2300
|
-
* 调用将返回错误信息
|
|
2301
|
-
* 计划于 v7.0.0 移除。
|
|
2302
|
-
*
|
|
2303
|
-
* @param options - 动态参数
|
|
2304
|
-
* @param options.dynamic_id - 动态 ID
|
|
2305
|
-
* @param cookie - B站 Cookie (可选)
|
|
2306
|
-
* @param requestConfig - 请求配置 (可选)
|
|
2307
|
-
* @returns 动态卡片数据(已停用,返回错误信息)
|
|
2308
|
-
* @example
|
|
2309
|
-
* ```typescript
|
|
2310
|
-
* const result = await fetchDynamicCard({ dynamic_id: '123456789' }, cookie)
|
|
2311
|
-
* // result.success === false,错误信息提示接口已停用
|
|
2312
|
-
* ```
|
|
2313
|
-
*/
|
|
2314
|
-
async function fetchDynamicCard(options, cookie, requestConfig) {
|
|
2315
|
-
checkDeprecation("fetchDynamicCard");
|
|
2316
|
-
return fetchBilibiliInternal("dynamicCard", options, {
|
|
2317
|
-
cookie,
|
|
2318
|
-
requestConfig
|
|
2319
|
-
});
|
|
2320
|
-
}
|
|
2321
1772
|
//#endregion
|
|
2322
1773
|
//#region src/model/fetchers/bilibili/live.ts
|
|
2323
1774
|
/**
|
|
@@ -2577,6 +2028,37 @@ async function fetchVideoDanmaku(options, cookie, requestConfig) {
|
|
|
2577
2028
|
});
|
|
2578
2029
|
}
|
|
2579
2030
|
//#endregion
|
|
2031
|
+
//#region src/model/fetchers/shared/request-config.ts
|
|
2032
|
+
/**
|
|
2033
|
+
* 合并 Fetcher 的实例级请求配置与单次请求配置。
|
|
2034
|
+
*
|
|
2035
|
+
* 单次配置优先,请求头单独合并。函数不会修改任一入参,因此同一绑定
|
|
2036
|
+
* Fetcher 可以安全地在并发任务中为不同请求使用不同配置。
|
|
2037
|
+
*/
|
|
2038
|
+
const mergeRequestConfig = (base, override) => {
|
|
2039
|
+
if (!override) return base;
|
|
2040
|
+
return {
|
|
2041
|
+
...base ?? {},
|
|
2042
|
+
...override,
|
|
2043
|
+
headers: {
|
|
2044
|
+
...base?.headers ?? {},
|
|
2045
|
+
...override.headers ?? {}
|
|
2046
|
+
}
|
|
2047
|
+
};
|
|
2048
|
+
};
|
|
2049
|
+
/**
|
|
2050
|
+
* 解析绑定 Fetcher 当前调用实际使用的 cookie 与请求配置。
|
|
2051
|
+
*
|
|
2052
|
+
* 实例级或单次配置显式提供大写 `headers.Cookie` 时,合并后的值同时替换
|
|
2053
|
+
* 底层 Fetcher 的 cookie 参数,确保平台签名、前置请求和最终请求处于同一身份状态。
|
|
2054
|
+
*/
|
|
2055
|
+
const resolveBoundRequest = (boundCookie, base, override) => {
|
|
2056
|
+
const requestConfig = mergeRequestConfig(base, override);
|
|
2057
|
+
const headers = requestConfig?.headers;
|
|
2058
|
+
const cookieOverride = Boolean(headers && Object.prototype.hasOwnProperty.call(headers, "Cookie")) ? headers.Cookie : void 0;
|
|
2059
|
+
return [typeof cookieOverride === "string" ? cookieOverride : boundCookie, requestConfig];
|
|
2060
|
+
};
|
|
2061
|
+
//#endregion
|
|
2580
2062
|
//#region src/model/fetchers/bilibili/bound.ts
|
|
2581
2063
|
/**
|
|
2582
2064
|
* 创建绑定了 Cookie 和请求配置的 B站 Fetcher
|
|
@@ -2592,36 +2074,35 @@ async function fetchVideoDanmaku(options, cookie, requestConfig) {
|
|
|
2592
2074
|
* ```
|
|
2593
2075
|
*/
|
|
2594
2076
|
function createBoundBilibiliFetcher(cookie, requestConfig) {
|
|
2077
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
2595
2078
|
return {
|
|
2596
|
-
fetchVideoInfo: (options) => fetchVideoInfo(options,
|
|
2597
|
-
fetchVideoStreamUrl: (options) => fetchVideoStreamUrl(options,
|
|
2598
|
-
fetchVideoDanmaku: (options) => fetchVideoDanmaku(options,
|
|
2599
|
-
fetchComments: (options) => fetchComments(options,
|
|
2600
|
-
fetchCommentReplies: (options) => fetchCommentReplies$1(options,
|
|
2601
|
-
fetchUserCard: (options) => fetchUserCard(options,
|
|
2602
|
-
fetchUserDynamicList: (options) => fetchUserDynamicList(options,
|
|
2603
|
-
fetchUserLiveStatus: (options) => fetchUserLiveStatus(options,
|
|
2604
|
-
fetchUserSpaceInfo: (options) => fetchUserSpaceInfo(options,
|
|
2605
|
-
fetchUploaderTotalViews: (options) => fetchUploaderTotalViews(options,
|
|
2606
|
-
fetchDynamicDetail: (options) => fetchDynamicDetail(options,
|
|
2607
|
-
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
|
|
2622
|
-
|
|
2623
|
-
convertBvToAv: (options) => convertBvToAv(options, cookie, requestConfig),
|
|
2624
|
-
fetchEmojiList: (options) => fetchEmojiList$3(options, cookie, requestConfig)
|
|
2079
|
+
fetchVideoInfo: (options, override) => fetchVideoInfo(options, ...resolveRequest(override)),
|
|
2080
|
+
fetchVideoStreamUrl: (options, override) => fetchVideoStreamUrl(options, ...resolveRequest(override)),
|
|
2081
|
+
fetchVideoDanmaku: (options, override) => fetchVideoDanmaku(options, ...resolveRequest(override)),
|
|
2082
|
+
fetchComments: (options, override) => fetchComments(options, ...resolveRequest(override)),
|
|
2083
|
+
fetchCommentReplies: (options, override) => fetchCommentReplies$1(options, ...resolveRequest(override)),
|
|
2084
|
+
fetchUserCard: (options, override) => fetchUserCard(options, ...resolveRequest(override)),
|
|
2085
|
+
fetchUserDynamicList: (options, override) => fetchUserDynamicList(options, ...resolveRequest(override)),
|
|
2086
|
+
fetchUserLiveStatus: (options, override) => fetchUserLiveStatus(options, ...resolveRequest(override)),
|
|
2087
|
+
fetchUserSpaceInfo: (options, override) => fetchUserSpaceInfo(options, ...resolveRequest(override)),
|
|
2088
|
+
fetchUploaderTotalViews: (options, override) => fetchUploaderTotalViews(options, ...resolveRequest(override)),
|
|
2089
|
+
fetchDynamicDetail: (options, override) => fetchDynamicDetail(options, ...resolveRequest(override)),
|
|
2090
|
+
fetchBangumiInfo: (options, override) => fetchBangumiInfo(options, ...resolveRequest(override)),
|
|
2091
|
+
fetchBangumiStreamUrl: (options, override) => fetchBangumiStreamUrl(options, ...resolveRequest(override)),
|
|
2092
|
+
fetchLiveRoomInfo: (options, override) => fetchLiveRoomInfo$2(options, ...resolveRequest(override)),
|
|
2093
|
+
fetchLiveRoomInitInfo: (options, override) => fetchLiveRoomInitInfo(options, ...resolveRequest(override)),
|
|
2094
|
+
fetchArticleContent: (options, override) => fetchArticleContent(options, ...resolveRequest(override)),
|
|
2095
|
+
fetchArticleCards: (options, override) => fetchArticleCards(options, ...resolveRequest(override)),
|
|
2096
|
+
fetchArticleInfo: (options, override) => fetchArticleInfo(options, ...resolveRequest(override)),
|
|
2097
|
+
fetchArticleListInfo: (options, override) => fetchArticleListInfo(options, ...resolveRequest(override)),
|
|
2098
|
+
fetchLoginStatus: (options, override) => fetchLoginStatus(options, ...resolveRequest(override)),
|
|
2099
|
+
requestLoginQrcode: (options, override) => requestLoginQrcode$1(options, ...resolveRequest(override)),
|
|
2100
|
+
checkQrcodeStatus: (options, override) => checkQrcodeStatus(options, ...resolveRequest(override)),
|
|
2101
|
+
requestCaptchaFromVoucher: (options, override) => requestCaptchaFromVoucher(options, ...resolveRequest(override)),
|
|
2102
|
+
validateCaptchaResult: (options, override) => validateCaptchaResult(options, ...resolveRequest(override)),
|
|
2103
|
+
convertAvToBv: (options, override) => convertAvToBv(options, ...resolveRequest(override)),
|
|
2104
|
+
convertBvToAv: (options, override) => convertBvToAv(options, ...resolveRequest(override)),
|
|
2105
|
+
fetchEmojiList: (options, override) => fetchEmojiList$3(options, ...resolveRequest(override))
|
|
2625
2106
|
};
|
|
2626
2107
|
}
|
|
2627
2108
|
//#endregion
|
|
@@ -2652,7 +2133,6 @@ const bilibiliFetcher = {
|
|
|
2652
2133
|
fetchUserSpaceInfo,
|
|
2653
2134
|
fetchUploaderTotalViews,
|
|
2654
2135
|
fetchDynamicDetail,
|
|
2655
|
-
fetchDynamicCard,
|
|
2656
2136
|
fetchBangumiInfo,
|
|
2657
2137
|
fetchBangumiStreamUrl,
|
|
2658
2138
|
fetchLiveRoomInfo: fetchLiveRoomInfo$2,
|
|
@@ -3034,8 +2514,6 @@ function result_encrypt(long_str, num) {
|
|
|
3034
2514
|
case 3:
|
|
3035
2515
|
temp_int = long_int & 63;
|
|
3036
2516
|
result += constant["str"].charAt(temp_int);
|
|
3037
|
-
break;
|
|
3038
|
-
default: break;
|
|
3039
2517
|
}
|
|
3040
2518
|
}
|
|
3041
2519
|
return result;
|
|
@@ -3537,7 +3015,8 @@ var DouyinAPI = class {
|
|
|
3537
3015
|
}
|
|
3538
3016
|
/** 获取视频或图集数据 */
|
|
3539
3017
|
getWorkDetail(data) {
|
|
3540
|
-
|
|
3018
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/aweme/detail/";
|
|
3019
|
+
const params = {
|
|
3541
3020
|
...this.getBaseParams(),
|
|
3542
3021
|
aweme_id: data.aweme_id,
|
|
3543
3022
|
update_version_code: "170400",
|
|
@@ -3547,11 +3026,13 @@ var DouyinAPI = class {
|
|
|
3547
3026
|
screen_height: "1310",
|
|
3548
3027
|
round_trip_time: "150",
|
|
3549
3028
|
webid: "7351848354471872041"
|
|
3550
|
-
}
|
|
3029
|
+
};
|
|
3030
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3551
3031
|
}
|
|
3552
3032
|
/** 获取评论数据 */
|
|
3553
3033
|
getComments(data) {
|
|
3554
|
-
|
|
3034
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/comment/list/";
|
|
3035
|
+
const params = {
|
|
3555
3036
|
...this.getBaseParams(),
|
|
3556
3037
|
aweme_id: data.aweme_id,
|
|
3557
3038
|
cursor: data.cursor ?? 0,
|
|
@@ -3566,11 +3047,13 @@ var DouyinAPI = class {
|
|
|
3566
3047
|
screen_width: "1552",
|
|
3567
3048
|
screen_height: "970",
|
|
3568
3049
|
round_trip_time: "50"
|
|
3569
|
-
}
|
|
3050
|
+
};
|
|
3051
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3570
3052
|
}
|
|
3571
3053
|
/** 获取二级评论数据 */
|
|
3572
3054
|
getCommentReplies(data) {
|
|
3573
|
-
|
|
3055
|
+
const baseUrl = "https://www-hj.douyin.com/aweme/v1/web/comment/list/reply/";
|
|
3056
|
+
const params = {
|
|
3574
3057
|
device_platform: "webapp",
|
|
3575
3058
|
aid: "6383",
|
|
3576
3059
|
channel: "channel_pc_web",
|
|
@@ -3608,11 +3091,13 @@ var DouyinAPI = class {
|
|
|
3608
3091
|
webid: "7487210762873685515",
|
|
3609
3092
|
verifyFp: fp,
|
|
3610
3093
|
fp
|
|
3611
|
-
}
|
|
3094
|
+
};
|
|
3095
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3612
3096
|
}
|
|
3613
3097
|
/** 获取动图数据 */
|
|
3614
3098
|
getSlidesInfo(data) {
|
|
3615
|
-
|
|
3099
|
+
const baseUrl = "https://www.iesdouyin.com/web/api/v2/aweme/slidesinfo/";
|
|
3100
|
+
const params = {
|
|
3616
3101
|
reflow_source: "reflow_page",
|
|
3617
3102
|
web_id: "7326472315356857893",
|
|
3618
3103
|
device_id: "7326472315356857893",
|
|
@@ -3621,7 +3106,8 @@ var DouyinAPI = class {
|
|
|
3621
3106
|
msToken: douyinSign.Mstoken(116),
|
|
3622
3107
|
verifyFp: fp,
|
|
3623
3108
|
fp
|
|
3624
|
-
}
|
|
3109
|
+
};
|
|
3110
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3625
3111
|
}
|
|
3626
3112
|
/** 获取表情数据 */
|
|
3627
3113
|
getEmojiList() {
|
|
@@ -3629,7 +3115,8 @@ var DouyinAPI = class {
|
|
|
3629
3115
|
}
|
|
3630
3116
|
/** 获取用户主页视频数据 */
|
|
3631
3117
|
getUserVideoList(data) {
|
|
3632
|
-
|
|
3118
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/aweme/post/";
|
|
3119
|
+
const params = {
|
|
3633
3120
|
...this.getBaseParams(),
|
|
3634
3121
|
sec_user_id: data.sec_uid,
|
|
3635
3122
|
max_cursor: data.max_cursor ?? "0",
|
|
@@ -3647,11 +3134,13 @@ var DouyinAPI = class {
|
|
|
3647
3134
|
screen_height: "970",
|
|
3648
3135
|
round_trip_time: "50",
|
|
3649
3136
|
webid: "7338423850134226495"
|
|
3650
|
-
}
|
|
3137
|
+
};
|
|
3138
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3651
3139
|
}
|
|
3652
3140
|
/** 获取用户喜欢列表数据 */
|
|
3653
3141
|
getUserFavoriteList(data) {
|
|
3654
|
-
|
|
3142
|
+
const baseUrl = "https://www-hj.douyin.com/aweme/v1/web/aweme/favorite/";
|
|
3143
|
+
const params = {
|
|
3655
3144
|
...this.getBaseParams(),
|
|
3656
3145
|
sec_user_id: data.sec_uid,
|
|
3657
3146
|
max_cursor: data.max_cursor ?? "0",
|
|
@@ -3670,11 +3159,13 @@ var DouyinAPI = class {
|
|
|
3670
3159
|
screen_height: "1310",
|
|
3671
3160
|
round_trip_time: "0",
|
|
3672
3161
|
webid: "7487210762873685515"
|
|
3673
|
-
}
|
|
3162
|
+
};
|
|
3163
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3674
3164
|
}
|
|
3675
3165
|
/** 获取用户推荐列表数据 */
|
|
3676
3166
|
getUserRecommendList(data) {
|
|
3677
|
-
|
|
3167
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/familiar/recommend/feed/";
|
|
3168
|
+
const params = {
|
|
3678
3169
|
device_platform: "",
|
|
3679
3170
|
aid: "6383",
|
|
3680
3171
|
channel: "channel_pc_web",
|
|
@@ -3713,11 +3204,13 @@ var DouyinAPI = class {
|
|
|
3713
3204
|
msToken: douyinSign.Mstoken(184),
|
|
3714
3205
|
verifyFp: fp,
|
|
3715
3206
|
fp
|
|
3716
|
-
}
|
|
3207
|
+
};
|
|
3208
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3717
3209
|
}
|
|
3718
3210
|
/** 获取用户主页信息 */
|
|
3719
3211
|
getUserProfile(data) {
|
|
3720
|
-
|
|
3212
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/user/profile/other/";
|
|
3213
|
+
const params = {
|
|
3721
3214
|
...this.getBaseParams(),
|
|
3722
3215
|
publish_video_strategy_type: "2",
|
|
3723
3216
|
source: "channel_pc_web",
|
|
@@ -3729,11 +3222,13 @@ var DouyinAPI = class {
|
|
|
3729
3222
|
screen_height: "970",
|
|
3730
3223
|
round_trip_time: "0",
|
|
3731
3224
|
webid: "7327957959955580467"
|
|
3732
|
-
}
|
|
3225
|
+
};
|
|
3226
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3733
3227
|
}
|
|
3734
3228
|
/** 获取热点词数据 */
|
|
3735
3229
|
getSuggestWords(data) {
|
|
3736
|
-
|
|
3230
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/api/suggest_words/";
|
|
3231
|
+
const params = {
|
|
3737
3232
|
...this.getBaseParams(),
|
|
3738
3233
|
query: data.query,
|
|
3739
3234
|
business_id: "30088",
|
|
@@ -3744,91 +3239,103 @@ var DouyinAPI = class {
|
|
|
3744
3239
|
screen_height: "970",
|
|
3745
3240
|
round_trip_time: "50",
|
|
3746
3241
|
webid: "7327957959955580467"
|
|
3747
|
-
}
|
|
3242
|
+
};
|
|
3243
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3748
3244
|
}
|
|
3749
3245
|
/** 获取搜索数据 */
|
|
3750
3246
|
search(data) {
|
|
3751
3247
|
const searchType = data.type ?? "general";
|
|
3752
3248
|
const { verifyFp, fp, ...baseParamsWithoutFp } = this.getBaseParams();
|
|
3753
|
-
if (searchType === "user")
|
|
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
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
|
|
3825
|
-
|
|
3826
|
-
|
|
3827
|
-
|
|
3249
|
+
if (searchType === "user") {
|
|
3250
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/discover/search/";
|
|
3251
|
+
const params = {
|
|
3252
|
+
...baseParamsWithoutFp,
|
|
3253
|
+
count: data.number ?? 10,
|
|
3254
|
+
disable_rs: "0",
|
|
3255
|
+
from_group_id: "",
|
|
3256
|
+
is_filter_search: "0",
|
|
3257
|
+
keyword: data.query,
|
|
3258
|
+
list_type: "single",
|
|
3259
|
+
need_filter_settings: "1",
|
|
3260
|
+
offset: "0",
|
|
3261
|
+
pc_libra_divert: "Windows",
|
|
3262
|
+
pc_search_top_1_params: "{\"enable_ai_search_top_1\":1}",
|
|
3263
|
+
query_correct_type: "1",
|
|
3264
|
+
round_trip_time: "250",
|
|
3265
|
+
screen_height: "1310",
|
|
3266
|
+
screen_width: "2328",
|
|
3267
|
+
search_channel: "aweme_user_web",
|
|
3268
|
+
search_source: "switch_tab",
|
|
3269
|
+
support_dash: "1",
|
|
3270
|
+
support_h265: "1",
|
|
3271
|
+
version_code: "170400",
|
|
3272
|
+
version_name: "17.4.0",
|
|
3273
|
+
webid: "7521399115230610959",
|
|
3274
|
+
...data.search_id && { search_id: data.search_id }
|
|
3275
|
+
};
|
|
3276
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3277
|
+
} else if (searchType === "video") {
|
|
3278
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/search/item/";
|
|
3279
|
+
const params = {
|
|
3280
|
+
...baseParamsWithoutFp,
|
|
3281
|
+
count: data.number ?? 10,
|
|
3282
|
+
disable_rs: "0",
|
|
3283
|
+
enable_history: "1",
|
|
3284
|
+
from_group_id: "",
|
|
3285
|
+
is_filter_search: "0",
|
|
3286
|
+
keyword: data.query,
|
|
3287
|
+
list_type: "single",
|
|
3288
|
+
need_filter_settings: "1",
|
|
3289
|
+
offset: "0",
|
|
3290
|
+
pc_libra_divert: "Windows",
|
|
3291
|
+
pc_search_top_1_params: "{\"enable_ai_search_top_1\":1}",
|
|
3292
|
+
query_correct_type: "1",
|
|
3293
|
+
round_trip_time: "50",
|
|
3294
|
+
screen_height: "1310",
|
|
3295
|
+
screen_width: "2328",
|
|
3296
|
+
search_channel: "aweme_video_web",
|
|
3297
|
+
search_source: "switch_tab",
|
|
3298
|
+
support_dash: "1",
|
|
3299
|
+
support_h265: "1",
|
|
3300
|
+
version_code: "170400",
|
|
3301
|
+
version_name: "17.4.0",
|
|
3302
|
+
webid: "7521399115230610959",
|
|
3303
|
+
...data.search_id && { search_id: data.search_id }
|
|
3304
|
+
};
|
|
3305
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3306
|
+
} else {
|
|
3307
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/general/search/stream/";
|
|
3308
|
+
const params = {
|
|
3309
|
+
...baseParamsWithoutFp,
|
|
3310
|
+
count: data.number ?? 10,
|
|
3311
|
+
disable_rs: "0",
|
|
3312
|
+
enable_history: "1",
|
|
3313
|
+
is_filter_search: "0",
|
|
3314
|
+
keyword: data.query,
|
|
3315
|
+
list_type: "",
|
|
3316
|
+
need_filter_settings: "1",
|
|
3317
|
+
offset: "0",
|
|
3318
|
+
pc_libra_divert: "Windows",
|
|
3319
|
+
pc_search_top_1_params: "{\"enable_ai_search_top_1\":1}",
|
|
3320
|
+
query_correct_type: "1",
|
|
3321
|
+
round_trip_time: "0",
|
|
3322
|
+
screen_height: "1310",
|
|
3323
|
+
screen_width: "2328",
|
|
3324
|
+
search_channel: "aweme_general",
|
|
3325
|
+
search_source: "normal_search",
|
|
3326
|
+
support_dash: "1",
|
|
3327
|
+
support_h265: "1",
|
|
3328
|
+
version_code: "190600",
|
|
3329
|
+
version_name: "19.6.0",
|
|
3330
|
+
webid: "7521399115230610959"
|
|
3331
|
+
};
|
|
3332
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3333
|
+
}
|
|
3828
3334
|
}
|
|
3829
3335
|
/** 获取互动表情数据 */
|
|
3830
3336
|
getDynamicEmojiList() {
|
|
3831
|
-
|
|
3337
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/im/strategy/config";
|
|
3338
|
+
const params = {
|
|
3832
3339
|
device_platform: "webapp",
|
|
3833
3340
|
aid: "1128",
|
|
3834
3341
|
channel: "channel_pc_web",
|
|
@@ -3860,11 +3367,13 @@ var DouyinAPI = class {
|
|
|
3860
3367
|
msToken: douyinSign.Mstoken(116),
|
|
3861
3368
|
verifyFp: fp,
|
|
3862
3369
|
fp
|
|
3863
|
-
}
|
|
3370
|
+
};
|
|
3371
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3864
3372
|
}
|
|
3865
3373
|
/** 获取背景音乐数据 */
|
|
3866
3374
|
getMusicInfo(data) {
|
|
3867
|
-
|
|
3375
|
+
const baseUrl = "https://www.douyin.com/aweme/v1/web/music/detail/";
|
|
3376
|
+
const params = {
|
|
3868
3377
|
device_platform: "webapp",
|
|
3869
3378
|
aid: "6383",
|
|
3870
3379
|
channel: "channel_pc_web",
|
|
@@ -3895,11 +3404,13 @@ var DouyinAPI = class {
|
|
|
3895
3404
|
msToken: douyinSign.Mstoken(116),
|
|
3896
3405
|
verifyFp: fp,
|
|
3897
3406
|
fp
|
|
3898
|
-
}
|
|
3407
|
+
};
|
|
3408
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3899
3409
|
}
|
|
3900
3410
|
/** 获取直播间信息 */
|
|
3901
3411
|
getLiveRoomInfo(data) {
|
|
3902
|
-
|
|
3412
|
+
const baseUrl = "https://live.douyin.com/webcast/room/web/enter/";
|
|
3413
|
+
const params = {
|
|
3903
3414
|
aid: "6383",
|
|
3904
3415
|
app_name: "douyin_web",
|
|
3905
3416
|
live_id: "1",
|
|
@@ -3922,18 +3433,22 @@ var DouyinAPI = class {
|
|
|
3922
3433
|
msToken: douyinSign.Mstoken(116),
|
|
3923
3434
|
verifyFp: fp,
|
|
3924
3435
|
fp
|
|
3925
|
-
}
|
|
3436
|
+
};
|
|
3437
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3926
3438
|
}
|
|
3927
3439
|
/** 申请登录二维码 */
|
|
3928
3440
|
getLoginQrcode(data) {
|
|
3929
|
-
|
|
3441
|
+
const baseUrl = "https://sso.douyin.com/get_qrcode/";
|
|
3442
|
+
const params = {
|
|
3930
3443
|
verifyFp: data.verify_fp,
|
|
3931
3444
|
fp: data.verify_fp
|
|
3932
|
-
}
|
|
3445
|
+
};
|
|
3446
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3933
3447
|
}
|
|
3934
3448
|
/** 获取弹幕数据 */
|
|
3935
3449
|
getDanmakuList(data) {
|
|
3936
|
-
|
|
3450
|
+
const baseUrl = "https://www-hj.douyin.com/aweme/v1/web/danmaku/get_v2/";
|
|
3451
|
+
const params = {
|
|
3937
3452
|
...this.getBaseParams(),
|
|
3938
3453
|
app_name: "aweme",
|
|
3939
3454
|
format: "json",
|
|
@@ -3960,7 +3475,8 @@ var DouyinAPI = class {
|
|
|
3960
3475
|
msToken: douyinSign.Mstoken(116),
|
|
3961
3476
|
verifyFp: fp,
|
|
3962
3477
|
fp
|
|
3963
|
-
}
|
|
3478
|
+
};
|
|
3479
|
+
return `${baseUrl}?${buildQueryString(params)}`;
|
|
3964
3480
|
}
|
|
3965
3481
|
};
|
|
3966
3482
|
/**
|
|
@@ -3982,7 +3498,6 @@ const douyinApiUrls = new DouyinAPI();
|
|
|
3982
3498
|
* 提供抖音各类数据的获取功能,包括视频、评论、用户等
|
|
3983
3499
|
*
|
|
3984
3500
|
* 注意:为避免循环依赖,此文件直接从具体模块导入,而不是从平台 index 文件导入
|
|
3985
|
-
* 循环依赖链:DataFetchers → getdata → platform/douyin → DataFetchers
|
|
3986
3501
|
*
|
|
3987
3502
|
* @module platform/douyin/getdata
|
|
3988
3503
|
*/
|
|
@@ -4259,7 +3774,8 @@ const DouyinData = async (data, cookie, requestConfig) => {
|
|
|
4259
3774
|
signType: null,
|
|
4260
3775
|
processRawResponse: (raw) => {
|
|
4261
3776
|
if (!isUserSearch && !isVideoSearch) {
|
|
4262
|
-
const
|
|
3777
|
+
const chunks = typeof raw === "string" ? parseDouyinMultiJson(raw) : [raw];
|
|
3778
|
+
const responses = filterSearchResponses(chunks);
|
|
4263
3779
|
if (responses.length === 0) return raw;
|
|
4264
3780
|
const mergedData = [];
|
|
4265
3781
|
let lastValid = {};
|
|
@@ -4638,7 +4154,8 @@ const filterSearchResponses = (objs) => {
|
|
|
4638
4154
|
async function fetchDouyinInternal(methodType, options, config) {
|
|
4639
4155
|
const startTime = Date.now();
|
|
4640
4156
|
try {
|
|
4641
|
-
const
|
|
4157
|
+
const apiParams = { ...validateDouyinParams(methodType, options) };
|
|
4158
|
+
const rawData = await DouyinData(apiParams, config.cookie, config.requestConfig);
|
|
4642
4159
|
const duration = Date.now() - startTime;
|
|
4643
4160
|
if (rawData.data === "" || rawData.status_code !== 0) {
|
|
4644
4161
|
emitApiError({
|
|
@@ -5079,26 +4596,27 @@ async function fetchDanmakuList(options, cookie, requestConfig) {
|
|
|
5079
4596
|
* ```
|
|
5080
4597
|
*/
|
|
5081
4598
|
function createBoundDouyinFetcher(cookie, requestConfig) {
|
|
4599
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
5082
4600
|
return {
|
|
5083
|
-
fetchVideoWork: (options,
|
|
5084
|
-
fetchImageAlbumWork: (options,
|
|
5085
|
-
fetchSlidesWork: (options,
|
|
5086
|
-
fetchTextWork: (options,
|
|
5087
|
-
parseWork: (options,
|
|
5088
|
-
fetchDanmakuList: (options,
|
|
5089
|
-
fetchWorkComments: (options,
|
|
5090
|
-
fetchCommentReplies: (options,
|
|
5091
|
-
fetchUserProfile: (options,
|
|
5092
|
-
fetchUserVideoList: (options,
|
|
5093
|
-
fetchUserFavoriteList: (options,
|
|
5094
|
-
fetchUserRecommendList: (options,
|
|
5095
|
-
searchContent: (options,
|
|
5096
|
-
fetchSuggestWords: (options,
|
|
5097
|
-
fetchMusicInfo: (options,
|
|
5098
|
-
fetchLiveRoomInfo: (options,
|
|
5099
|
-
requestLoginQrcode: (options,
|
|
5100
|
-
fetchEmojiList: (options,
|
|
5101
|
-
fetchDynamicEmojiList: (options,
|
|
4601
|
+
fetchVideoWork: (options, override) => fetchVideoWork$1(options, ...resolveRequest(override)),
|
|
4602
|
+
fetchImageAlbumWork: (options, override) => fetchImageAlbumWork(options, ...resolveRequest(override)),
|
|
4603
|
+
fetchSlidesWork: (options, override) => fetchSlidesWork(options, ...resolveRequest(override)),
|
|
4604
|
+
fetchTextWork: (options, override) => fetchTextWork(options, ...resolveRequest(override)),
|
|
4605
|
+
parseWork: (options, override) => parseWork(options, ...resolveRequest(override)),
|
|
4606
|
+
fetchDanmakuList: (options, override) => fetchDanmakuList(options, ...resolveRequest(override)),
|
|
4607
|
+
fetchWorkComments: (options, override) => fetchWorkComments$1(options, ...resolveRequest(override)),
|
|
4608
|
+
fetchCommentReplies: (options, override) => fetchCommentReplies(options, ...resolveRequest(override)),
|
|
4609
|
+
fetchUserProfile: (options, override) => fetchUserProfile$2(options, ...resolveRequest(override)),
|
|
4610
|
+
fetchUserVideoList: (options, override) => fetchUserVideoList(options, ...resolveRequest(override)),
|
|
4611
|
+
fetchUserFavoriteList: (options, override) => fetchUserFavoriteList(options, ...resolveRequest(override)),
|
|
4612
|
+
fetchUserRecommendList: (options, override) => fetchUserRecommendList(options, ...resolveRequest(override)),
|
|
4613
|
+
searchContent: (options, override) => searchContent(options, ...resolveRequest(override)),
|
|
4614
|
+
fetchSuggestWords: (options, override) => fetchSuggestWords(options, ...resolveRequest(override)),
|
|
4615
|
+
fetchMusicInfo: (options, override) => fetchMusicInfo(options, ...resolveRequest(override)),
|
|
4616
|
+
fetchLiveRoomInfo: (options, override) => fetchLiveRoomInfo$1(options, ...resolveRequest(override)),
|
|
4617
|
+
requestLoginQrcode: (options, override) => requestLoginQrcode(options, ...resolveRequest(override)),
|
|
4618
|
+
fetchEmojiList: (options, override) => fetchEmojiList$2(options, ...resolveRequest(override)),
|
|
4619
|
+
fetchDynamicEmojiList: (options, override) => fetchDynamicEmojiList(options, ...resolveRequest(override))
|
|
5102
4620
|
};
|
|
5103
4621
|
}
|
|
5104
4622
|
//#endregion
|
|
@@ -5245,11 +4763,13 @@ var API = class {
|
|
|
5245
4763
|
* @returns 请求配置
|
|
5246
4764
|
*/
|
|
5247
4765
|
profilePublic(data) {
|
|
4766
|
+
const count = "count" in data ? data.count ?? 12 : 12;
|
|
4767
|
+
const pcursor = "pcursor" in data ? data.pcursor ?? "" : "";
|
|
5248
4768
|
return createKuaishouLiveApiRequest("profilePublic", "/live_api/profile/public", {
|
|
5249
4769
|
caver: 2,
|
|
5250
|
-
count
|
|
4770
|
+
count,
|
|
5251
4771
|
hasMore: true,
|
|
5252
|
-
pcursor
|
|
4772
|
+
pcursor,
|
|
5253
4773
|
principalId: data.principalId,
|
|
5254
4774
|
privacy: "public"
|
|
5255
4775
|
}, { signPath: "/rest/k/feed/profile" });
|
|
@@ -5413,6 +4933,7 @@ var API = class {
|
|
|
5413
4933
|
* @returns 请求配置
|
|
5414
4934
|
*/
|
|
5415
4935
|
liveReco(gameId) {
|
|
4936
|
+
const normalizedGameId = Number(gameId) > 0 ? Number(gameId) : 1001;
|
|
5416
4937
|
return createKuaishouLiveApiRequest("liveReco", "/live_api/liveroom/reco", {}, {
|
|
5417
4938
|
method: "POST",
|
|
5418
4939
|
requiresSign: false,
|
|
@@ -5422,7 +4943,7 @@ var API = class {
|
|
|
5422
4943
|
followingWeight: 50
|
|
5423
4944
|
},
|
|
5424
4945
|
gameFavour: [{
|
|
5425
|
-
gameId:
|
|
4946
|
+
gameId: normalizedGameId,
|
|
5426
4947
|
totalStayLength: 100
|
|
5427
4948
|
}]
|
|
5428
4949
|
}
|
|
@@ -5655,8 +5176,10 @@ const maskKuaishouHudrPayload = (payload) => {
|
|
|
5655
5176
|
* @returns `HUDR_` 的完整结果及若干中间态,便于对拍与调试
|
|
5656
5177
|
*/
|
|
5657
5178
|
const deriveKuaishouHudrBody = (context) => {
|
|
5658
|
-
const
|
|
5659
|
-
const
|
|
5179
|
+
const payload = buildKuaishouHudrPayload(context);
|
|
5180
|
+
const maskedPayload = maskKuaishouHudrPayload(payload);
|
|
5181
|
+
const encrypted = new KuaishouChaChaCipher(KUAISHOU_HUDR_CHACHA_KEY, KUAISHOU_HUDR_CHACHA_NONCE).encrypt(maskedPayload);
|
|
5182
|
+
const body = encodeBase64Url(encrypted);
|
|
5660
5183
|
return {
|
|
5661
5184
|
body,
|
|
5662
5185
|
full: `${KUAISHOU_HUDR_PREFIX}${body}`,
|
|
@@ -6168,7 +5691,9 @@ const KUAISHOU_HE_RANDOM_MAX = 0xffffffffffff;
|
|
|
6168
5691
|
* @returns `$HE_` 载荷中的 4 字节 hash field hex
|
|
6169
5692
|
*/
|
|
6170
5693
|
const deriveKuaishouHeHashFieldHex = (signInput, hudrBody) => {
|
|
6171
|
-
|
|
5694
|
+
const hashInput = `${signInput}HUDR_${hudrBody}`;
|
|
5695
|
+
const digestHex = bytesToLowerHex(deriveKuaishouCts(deriveKuaishouB2sa(hashInput))).slice(0, 8);
|
|
5696
|
+
return bytesToLowerHex(xorByteArrays(hexToSignedBytes(digestHex), KUAISHOU_HE_INPUT_XOR_MASK));
|
|
6172
5697
|
};
|
|
6173
5698
|
/**
|
|
6174
5699
|
* 推导快手签名中的 `$HE_` 段。
|
|
@@ -6508,7 +6033,6 @@ var kuaishouSign = class {
|
|
|
6508
6033
|
* 快手数据获取模块
|
|
6509
6034
|
*
|
|
6510
6035
|
* 注意:为避免循环依赖,此文件直接从具体模块导入,而不是从平台 index 文件导入
|
|
6511
|
-
* 循环依赖链:DataFetchers → getdata → platform/kuaishou → DataFetchers
|
|
6512
6036
|
*/
|
|
6513
6037
|
const KUAISHOU_PROFILE_TAB_TYPE_MAP = {
|
|
6514
6038
|
public: "public",
|
|
@@ -7190,7 +6714,8 @@ const KuaishouData = async (data, cookie, requestConfig) => {
|
|
|
7190
6714
|
if (!liveDetailData) return liveRoomInfo;
|
|
7191
6715
|
const userInfo = isErrorDetailLike(userInfoPayload) ? void 0 : userInfoPayload?.data?.userInfo;
|
|
7192
6716
|
const sensitiveInfo = isErrorDetailLike(sensitivePayload) ? void 0 : sensitivePayload?.data?.sensitiveUserInfo;
|
|
7193
|
-
const
|
|
6717
|
+
const currentAuthor = mergeKuaishouLiveAuthor(liveDetailData?.author, userInfo, sensitiveInfo);
|
|
6718
|
+
const currentLiveRoomItem = mapLiveDetailToLiveRoomPlayItem(liveDetailData, currentAuthor);
|
|
7194
6719
|
const liveStreamId = currentLiveRoomItem.liveStream?.id ?? currentLiveRoomItem.config?.liveStreamId;
|
|
7195
6720
|
const currentGameId = liveDetailData?.gameInfo?.id ?? liveDetailData?.gameInfo?.gameId;
|
|
7196
6721
|
const liveDetailWebsocketMeta = resolveKuaishouLiveDetailWebsocketMeta(liveDetailData);
|
|
@@ -7208,7 +6733,8 @@ const KuaishouData = async (data, cookie, requestConfig) => {
|
|
|
7208
6733
|
shouldFetchRecommendList ? fetchKuaishouLiveApiPayload(data.methodType, kuaishouApiUrls.liveReco(currentGameId), refererPath, { allowResult2: true }) : Promise.resolve(null)
|
|
7209
6734
|
]);
|
|
7210
6735
|
const resolvedRecommendList = !isErrorDetailLike(recoPayload) && Array.isArray(recoPayload?.data?.list) ? recoPayload.data.list : liveDetailRecommendList;
|
|
7211
|
-
const
|
|
6736
|
+
const recoPlayList = Array.isArray(resolvedRecommendList) ? resolvedRecommendList.map((item) => mapRecoItemToLiveRoomPlayItem(item)) : [];
|
|
6737
|
+
const nextPlayList = dedupeLiveRoomPlayList([currentLiveRoomItem, ...recoPlayList]);
|
|
7212
6738
|
return {
|
|
7213
6739
|
...liveRoomInfo,
|
|
7214
6740
|
principalId: data.principalId,
|
|
@@ -7319,7 +6845,8 @@ const GlobalGetData$2 = async (type, options, config) => {
|
|
|
7319
6845
|
async function fetchKuaishouInternal(methodType, options, config) {
|
|
7320
6846
|
const startTime = Date.now();
|
|
7321
6847
|
try {
|
|
7322
|
-
const
|
|
6848
|
+
const apiParams = { ...validateKuaishouParams(methodType, options) };
|
|
6849
|
+
const rawData = await KuaishouData(apiParams, config.cookie, config.requestConfig);
|
|
7323
6850
|
const duration = Date.now() - startTime;
|
|
7324
6851
|
if (rawData.code && Object.values(kuaishouAPIErrorCode).includes(rawData.code)) {
|
|
7325
6852
|
emitApiError({
|
|
@@ -7491,13 +7018,14 @@ const kuaishouFetcher = {
|
|
|
7491
7018
|
* ```
|
|
7492
7019
|
*/
|
|
7493
7020
|
function createBoundKuaishouFetcher(cookie, requestConfig) {
|
|
7021
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
7494
7022
|
return {
|
|
7495
|
-
fetchVideoWork: (options,
|
|
7496
|
-
fetchWorkComments: (options,
|
|
7497
|
-
fetchUserProfile: (options,
|
|
7498
|
-
fetchUserWorkList: (options,
|
|
7499
|
-
fetchLiveRoomInfo: (options,
|
|
7500
|
-
fetchEmojiList: (options,
|
|
7023
|
+
fetchVideoWork: (options, override) => fetchVideoWork(options, ...resolveRequest(override)),
|
|
7024
|
+
fetchWorkComments: (options, override) => fetchWorkComments(options, ...resolveRequest(override)),
|
|
7025
|
+
fetchUserProfile: (options, override) => fetchUserProfile$1(options, ...resolveRequest(override)),
|
|
7026
|
+
fetchUserWorkList: (options, override) => fetchUserWorkList(options, ...resolveRequest(override)),
|
|
7027
|
+
fetchLiveRoomInfo: (options, override) => fetchLiveRoomInfo(options, ...resolveRequest(override)),
|
|
7028
|
+
fetchEmojiList: (options, override) => fetchEmojiList$1(options, ...resolveRequest(override))
|
|
7501
7029
|
};
|
|
7502
7030
|
}
|
|
7503
7031
|
//#endregion
|
|
@@ -7577,18 +7105,19 @@ const XiaohongshuData = async (data, cookie, requestConfig) => {
|
|
|
7577
7105
|
...requestConfig?.headers ?? {}
|
|
7578
7106
|
}
|
|
7579
7107
|
};
|
|
7108
|
+
const userData = await GlobalGetData$1(data.methodType, {
|
|
7109
|
+
...baseRequestConfig,
|
|
7110
|
+
url: xiaohongshuApiUrls.userProfile(data).Url,
|
|
7111
|
+
headers: {
|
|
7112
|
+
...baseRequestConfig.headers,
|
|
7113
|
+
"x-s": xiaohongshuSign.generateXSGet(xiaohongshuApiUrls.userProfile(data).apiPath, xiaohongshuSign.extractA1FromCookie(requestCookie), "xhs-pc-web"),
|
|
7114
|
+
"x-s-common": xiaohongshuSign.generateXSCommon(requestCookie),
|
|
7115
|
+
"x-t": xiaohongshuSign.generateXT()
|
|
7116
|
+
}
|
|
7117
|
+
});
|
|
7580
7118
|
return {
|
|
7581
7119
|
code: 0,
|
|
7582
|
-
data: extractCreatorInfoFromHtml(
|
|
7583
|
-
...baseRequestConfig,
|
|
7584
|
-
url: xiaohongshuApiUrls.userProfile(data).Url,
|
|
7585
|
-
headers: {
|
|
7586
|
-
...baseRequestConfig.headers,
|
|
7587
|
-
"x-s": xiaohongshuSign.generateXSGet(xiaohongshuApiUrls.userProfile(data).apiPath, xiaohongshuSign.extractA1FromCookie(requestCookie), "xhs-pc-web"),
|
|
7588
|
-
"x-s-common": xiaohongshuSign.generateXSCommon(requestCookie),
|
|
7589
|
-
"x-t": xiaohongshuSign.generateXT()
|
|
7590
|
-
}
|
|
7591
|
-
})),
|
|
7120
|
+
data: extractCreatorInfoFromHtml(userData),
|
|
7592
7121
|
msg: "success"
|
|
7593
7122
|
};
|
|
7594
7123
|
}
|
|
@@ -7702,7 +7231,8 @@ const sortTypeMapping = {
|
|
|
7702
7231
|
async function fetchXiaohongshuInternal(methodType, options, config) {
|
|
7703
7232
|
const startTime = Date.now();
|
|
7704
7233
|
try {
|
|
7705
|
-
const
|
|
7234
|
+
const apiParams = { ...validateXiaohongshuParams(methodType, options) };
|
|
7235
|
+
const rawData = await XiaohongshuData(apiParams, config.cookie, config.requestConfig);
|
|
7706
7236
|
const duration = Date.now() - startTime;
|
|
7707
7237
|
if (rawData.code && Object.values(xiaohongshuAPIErrorCode).includes(rawData.code)) {
|
|
7708
7238
|
emitApiError({
|
|
@@ -7936,14 +7466,15 @@ const xiaohongshuFetcher = {
|
|
|
7936
7466
|
* ```
|
|
7937
7467
|
*/
|
|
7938
7468
|
function createBoundXiaohongshuFetcher(cookie, requestConfig) {
|
|
7469
|
+
const resolveRequest = (override) => resolveBoundRequest(cookie, requestConfig, override);
|
|
7939
7470
|
return {
|
|
7940
|
-
fetchHomeFeed: (options = {},
|
|
7941
|
-
fetchNoteDetail: (options,
|
|
7942
|
-
fetchNoteComments: (options,
|
|
7943
|
-
fetchUserProfile: (options,
|
|
7944
|
-
fetchUserNoteList: (options,
|
|
7945
|
-
searchNotes: (options,
|
|
7946
|
-
fetchEmojiList: (options,
|
|
7471
|
+
fetchHomeFeed: (options = {}, override) => fetchHomeFeed(options, ...resolveRequest(override)),
|
|
7472
|
+
fetchNoteDetail: (options, override) => fetchNoteDetail(options, ...resolveRequest(override)),
|
|
7473
|
+
fetchNoteComments: (options, override) => fetchNoteComments(options, ...resolveRequest(override)),
|
|
7474
|
+
fetchUserProfile: (options, override) => fetchUserProfile(options, ...resolveRequest(override)),
|
|
7475
|
+
fetchUserNoteList: (options, override) => fetchUserNoteList(options, ...resolveRequest(override)),
|
|
7476
|
+
searchNotes: (options, override) => searchNotes(options, ...resolveRequest(override)),
|
|
7477
|
+
fetchEmojiList: (options, override) => fetchEmojiList(options, ...resolveRequest(override))
|
|
7947
7478
|
};
|
|
7948
7479
|
}
|
|
7949
7480
|
//#endregion
|
|
@@ -8125,106 +7656,6 @@ const getHeadersAndData = async (config, maxRetries = DEFAULT_MAX_RETRIES) => {
|
|
|
8125
7656
|
};
|
|
8126
7657
|
};
|
|
8127
7658
|
//#endregion
|
|
8128
|
-
//#region src/model/logger.ts
|
|
8129
|
-
/**
|
|
8130
|
-
* @deprecated v6 已废弃日志模块,请使用事件系统替代
|
|
8131
|
-
* @see {@link ../events.ts} 使用 amagiEvents 监听日志事件
|
|
8132
|
-
*
|
|
8133
|
-
* 迁移示例:
|
|
8134
|
-
* ```typescript
|
|
8135
|
-
* import { amagiEvents } from '@ikenxuan/amagi'
|
|
8136
|
-
*
|
|
8137
|
-
* amagiEvents.on('log:info', (data) => console.log(data.message))
|
|
8138
|
-
* amagiEvents.on('log:error', (data) => console.error(data.message))
|
|
8139
|
-
* ```
|
|
8140
|
-
*/
|
|
8141
|
-
/**
|
|
8142
|
-
* @deprecated v6 已废弃,请使用事件系统替代
|
|
8143
|
-
* 初始化 logger 配置 - 此函数现在为空操作
|
|
8144
|
-
*/
|
|
8145
|
-
const initLogger = () => {};
|
|
8146
|
-
/**
|
|
8147
|
-
* @deprecated v6 已废弃,请使用事件系统替代
|
|
8148
|
-
* 简化的日志类,仅发射事件,不再依赖 log4js
|
|
8149
|
-
*/
|
|
8150
|
-
var SimpleLogger = class {
|
|
8151
|
-
chalk;
|
|
8152
|
-
red;
|
|
8153
|
-
green;
|
|
8154
|
-
yellow;
|
|
8155
|
-
blue;
|
|
8156
|
-
magenta;
|
|
8157
|
-
cyan;
|
|
8158
|
-
white;
|
|
8159
|
-
gray;
|
|
8160
|
-
constructor() {
|
|
8161
|
-
this.chalk = new chalk.Chalk();
|
|
8162
|
-
this.red = this.chalk.red;
|
|
8163
|
-
this.green = this.chalk.green;
|
|
8164
|
-
this.yellow = this.chalk.yellow;
|
|
8165
|
-
this.blue = this.chalk.blue;
|
|
8166
|
-
this.magenta = this.chalk.magenta;
|
|
8167
|
-
this.cyan = this.chalk.cyan;
|
|
8168
|
-
this.white = this.chalk.white;
|
|
8169
|
-
this.gray = this.chalk.gray;
|
|
8170
|
-
}
|
|
8171
|
-
info(message, ...args) {
|
|
8172
|
-
emitLog("info", String(message), ...args);
|
|
8173
|
-
}
|
|
8174
|
-
warn(message, ...args) {
|
|
8175
|
-
emitLog("warn", String(message), ...args);
|
|
8176
|
-
}
|
|
8177
|
-
error(message, ...args) {
|
|
8178
|
-
emitLog("error", String(message), ...args);
|
|
8179
|
-
}
|
|
8180
|
-
mark(message, ...args) {
|
|
8181
|
-
emitLog("mark", String(message), ...args);
|
|
8182
|
-
}
|
|
8183
|
-
debug(message, ...args) {
|
|
8184
|
-
emitLog("debug", String(message), ...args);
|
|
8185
|
-
}
|
|
8186
|
-
};
|
|
8187
|
-
/**
|
|
8188
|
-
* @deprecated v6 已废弃,请使用事件系统替代
|
|
8189
|
-
*/
|
|
8190
|
-
const logger = new SimpleLogger();
|
|
8191
|
-
/**
|
|
8192
|
-
* @deprecated v6 已废弃,请使用事件系统替代
|
|
8193
|
-
*/
|
|
8194
|
-
const httpLogger = new SimpleLogger();
|
|
8195
|
-
/**
|
|
8196
|
-
* @deprecated v6 已废弃,请使用事件系统监听 http:response 事件
|
|
8197
|
-
* 创建一个日志中间件,用于记录特定请求的详细信息
|
|
8198
|
-
* @param pathsToLog 指定需要记录日志的请求路径数组如果未提供,则记录所有请求的日志
|
|
8199
|
-
* @returns
|
|
8200
|
-
*/
|
|
8201
|
-
const logMiddleware = (pathsToLog) => {
|
|
8202
|
-
return (req, res, next) => {
|
|
8203
|
-
if (!pathsToLog || pathsToLog.some((path) => req.url.startsWith(path))) {
|
|
8204
|
-
const startTime = Date.now();
|
|
8205
|
-
const url = req.url;
|
|
8206
|
-
const method = req.method;
|
|
8207
|
-
const clientIP = req.headers["x-forwarded-for"] ?? req.socket.remoteAddress;
|
|
8208
|
-
res.on("finish", () => {
|
|
8209
|
-
const responseTime = Date.now() - startTime;
|
|
8210
|
-
const statusCode = res.statusCode;
|
|
8211
|
-
const requestSize = req.headers["content-length"] ?? "0";
|
|
8212
|
-
const responseSize = res.get("content-length") ?? "0";
|
|
8213
|
-
emitHttpResponse({
|
|
8214
|
-
method,
|
|
8215
|
-
url,
|
|
8216
|
-
statusCode,
|
|
8217
|
-
responseTime,
|
|
8218
|
-
clientIP: String(clientIP),
|
|
8219
|
-
requestSize: `${requestSize}B`,
|
|
8220
|
-
responseSize: `${responseSize}B`
|
|
8221
|
-
});
|
|
8222
|
-
});
|
|
8223
|
-
}
|
|
8224
|
-
next();
|
|
8225
|
-
};
|
|
8226
|
-
};
|
|
8227
|
-
//#endregion
|
|
8228
7659
|
//#region src/platform/bilibili/qtparam.ts
|
|
8229
7660
|
/**
|
|
8230
7661
|
* 生成B站视频流请求参数
|
|
@@ -8543,7 +7974,6 @@ const wbi_sign = async (BASEURL, cookie) => {
|
|
|
8543
7974
|
* 提供 B站各类数据的获取功能,包括视频、评论、用户、番剧等
|
|
8544
7975
|
*
|
|
8545
7976
|
* 注意:为避免循环依赖,此文件直接从具体模块导入,而不是从平台 index 文件导入
|
|
8546
|
-
* 循环依赖链:DataFetchers → getdata → platform/bilibili → DataFetchers
|
|
8547
7977
|
*
|
|
8548
7978
|
* @module platform/bilibili/getdata
|
|
8549
7979
|
*/
|
|
@@ -8563,10 +7993,11 @@ const fetchBilibili = async (data, cookie, requestConfig) => {
|
|
|
8563
7993
|
url: bilibiliApiUrls.getVideoInfo({ bvid: data.bvid })
|
|
8564
7994
|
});
|
|
8565
7995
|
case "videoStream": {
|
|
8566
|
-
const
|
|
7996
|
+
const baseUrl = bilibiliApiUrls.getVideoStream({
|
|
8567
7997
|
avid: data.avid,
|
|
8568
7998
|
cid: data.cid
|
|
8569
|
-
})
|
|
7999
|
+
});
|
|
8000
|
+
const sign = await qtparam(baseUrl, baseRequestConfig.headers?.Cookie);
|
|
8570
8001
|
return await GlobalGetData(data.methodType, {
|
|
8571
8002
|
...baseRequestConfig,
|
|
8572
8003
|
url: bilibiliApiUrls.getVideoStream({
|
|
@@ -8653,10 +8084,11 @@ const fetchBilibili = async (data, cookie, requestConfig) => {
|
|
|
8653
8084
|
});
|
|
8654
8085
|
}
|
|
8655
8086
|
case "bangumiStream": {
|
|
8656
|
-
const
|
|
8087
|
+
const baseUrl = bilibiliApiUrls.getBangumiStream({
|
|
8657
8088
|
cid: data.cid,
|
|
8658
8089
|
ep_id: data.ep_id.replace("ep", "")
|
|
8659
|
-
})
|
|
8090
|
+
});
|
|
8091
|
+
const sign = await qtparam(baseUrl, baseRequestConfig.headers?.cookie);
|
|
8660
8092
|
return await GlobalGetData(data.methodType, {
|
|
8661
8093
|
...baseRequestConfig,
|
|
8662
8094
|
url: bilibiliApiUrls.getBangumiStream({
|
|
@@ -8692,12 +8124,6 @@ const fetchBilibili = async (data, cookie, requestConfig) => {
|
|
|
8692
8124
|
url: bilibiliApiUrls.getDynamicDetail({ dynamic_id: data.dynamic_id })
|
|
8693
8125
|
});
|
|
8694
8126
|
}
|
|
8695
|
-
case "dynamicCard": return {
|
|
8696
|
-
code: -404,
|
|
8697
|
-
message: "接口已停用:B站官方已于 `2025-08-09` 删除 dynamic_svr 接口,fetchDynamicCard 方法已废弃,调用讲返回错误信息",
|
|
8698
|
-
ttl: 1,
|
|
8699
|
-
data: null
|
|
8700
|
-
};
|
|
8701
8127
|
case "userCard": {
|
|
8702
8128
|
const { host_mid } = data;
|
|
8703
8129
|
return await GlobalGetData(data.methodType, {
|
|
@@ -8710,7 +8136,8 @@ const fetchBilibili = async (data, cookie, requestConfig) => {
|
|
|
8710
8136
|
url: bilibiliApiUrls.getUserLiveStatus({ host_mid: data.host_mid })
|
|
8711
8137
|
});
|
|
8712
8138
|
case "userSpaceInfo": {
|
|
8713
|
-
const
|
|
8139
|
+
const baseUrl = bilibiliApiUrls.getUserSpaceInfo({ host_mid: data.host_mid });
|
|
8140
|
+
const wbiSignQuery = await wbi_sign(baseUrl, baseRequestConfig.headers?.cookie);
|
|
8714
8141
|
return await GlobalGetData(data.methodType, {
|
|
8715
8142
|
...baseRequestConfig,
|
|
8716
8143
|
url: bilibiliApiUrls.getUserSpaceInfo({ host_mid: data.host_mid }) + wbiSignQuery
|
|
@@ -9061,10 +8488,11 @@ var ValidationError = class ValidationError extends Error {
|
|
|
9061
8488
|
* @returns 验证错误实例
|
|
9062
8489
|
*/
|
|
9063
8490
|
static fromZodError(zodError, requestPath) {
|
|
9064
|
-
|
|
8491
|
+
const errors = zodError.issues.map((err) => ({
|
|
9065
8492
|
field: err.path.join("."),
|
|
9066
8493
|
message: err.message
|
|
9067
|
-
}))
|
|
8494
|
+
}));
|
|
8495
|
+
return new ValidationError("参数验证失败", errors, requestPath);
|
|
9068
8496
|
}
|
|
9069
8497
|
};
|
|
9070
8498
|
/**
|
|
@@ -9088,7 +8516,10 @@ const handleError = (error, requestPath) => {
|
|
|
9088
8516
|
platform: error.platform,
|
|
9089
8517
|
requestPath
|
|
9090
8518
|
};
|
|
9091
|
-
if (error instanceof zod.default.ZodError)
|
|
8519
|
+
if (error instanceof zod.default.ZodError) {
|
|
8520
|
+
const validationError = ValidationError.fromZodError(error, requestPath);
|
|
8521
|
+
return handleError(validationError, requestPath);
|
|
8522
|
+
}
|
|
9092
8523
|
return {
|
|
9093
8524
|
code: 500,
|
|
9094
8525
|
message: error instanceof Error ? error.message : "未知错误",
|
|
@@ -9199,71 +8630,7 @@ const bilibiliUtils = {
|
|
|
9199
8630
|
bv2av
|
|
9200
8631
|
},
|
|
9201
8632
|
danmaku: { parseDmSegMobileReply },
|
|
9202
|
-
bilibiliApiUrls
|
|
9203
|
-
api: bilibili
|
|
9204
|
-
};
|
|
9205
|
-
//#endregion
|
|
9206
|
-
//#region src/platform/douyin/DouyinApi.ts
|
|
9207
|
-
/**
|
|
9208
|
-
* 创建废弃的 API 存根函数
|
|
9209
|
-
*/
|
|
9210
|
-
const createDeprecatedStub$2 = (methodName) => {
|
|
9211
|
-
return (..._args) => {
|
|
9212
|
-
checkDeprecation("getDouyinData");
|
|
9213
|
-
throw new Error(`douyin.${methodName} 已废弃,请使用 douyinFetcher 替代`);
|
|
9214
|
-
};
|
|
9215
|
-
};
|
|
9216
|
-
/**
|
|
9217
|
-
* 封装了所有抖音相关的API请求,采用对象化的方式组织。
|
|
9218
|
-
*
|
|
9219
|
-
* @deprecated v6 已废弃,请使用 douyinFetcher 或 client.douyin.fetcher 替代
|
|
9220
|
-
*/
|
|
9221
|
-
const douyin = {
|
|
9222
|
-
/** @deprecated 请使用 douyinFetcher.fetchTextWork 替代 */
|
|
9223
|
-
getTextWorkInfo: createDeprecatedStub$2("getTextWorkInfo"),
|
|
9224
|
-
/** @deprecated 请使用 douyinFetcher.parseWork 替代 */
|
|
9225
|
-
getWorkInfo: createDeprecatedStub$2("getWorkInfo"),
|
|
9226
|
-
/** @deprecated 请使用 douyinFetcher.fetchVideoWork 替代 */
|
|
9227
|
-
getVideoWorkInfo: createDeprecatedStub$2("getVideoWorkInfo"),
|
|
9228
|
-
/** @deprecated 请使用 douyinFetcher.fetchImageAlbumWork 替代 */
|
|
9229
|
-
getImageAlbumWorkInfo: createDeprecatedStub$2("getImageAlbumWorkInfo"),
|
|
9230
|
-
/** @deprecated 请使用 douyinFetcher.fetchSlidesWork 替代 */
|
|
9231
|
-
getSlidesWorkInfo: createDeprecatedStub$2("getSlidesWorkInfo"),
|
|
9232
|
-
/** @deprecated 请使用 douyinFetcher.fetchComments 替代 */
|
|
9233
|
-
getComments: createDeprecatedStub$2("getComments"),
|
|
9234
|
-
/** @deprecated 请使用 douyinFetcher.fetchCommentReplies 替代 */
|
|
9235
|
-
getCommentReplies: createDeprecatedStub$2("getCommentReplies"),
|
|
9236
|
-
/** @deprecated 请使用 douyinFetcher.fetchUserProfile 替代 */
|
|
9237
|
-
getUserProfile: createDeprecatedStub$2("getUserProfile"),
|
|
9238
|
-
/** @deprecated 请使用 douyinFetcher.fetchEmojiList 替代 */
|
|
9239
|
-
getEmojiList: createDeprecatedStub$2("getEmojiList"),
|
|
9240
|
-
/** @deprecated 请使用 douyinFetcher.fetchDynamicEmojiList 替代 */
|
|
9241
|
-
getEmojiProList: createDeprecatedStub$2("getEmojiProList"),
|
|
9242
|
-
/** @deprecated 请使用 douyinFetcher.fetchUserVideoList 替代 */
|
|
9243
|
-
getUserVideos: createDeprecatedStub$2("getUserVideos"),
|
|
9244
|
-
/** @deprecated 请使用 douyinFetcher.fetchMusicInfo 替代 */
|
|
9245
|
-
getMusicInfo: createDeprecatedStub$2("getMusicInfo"),
|
|
9246
|
-
/** @deprecated 请使用 douyinFetcher.fetchSuggestWords 替代 */
|
|
9247
|
-
getSuggestWords: createDeprecatedStub$2("getSuggestWords"),
|
|
9248
|
-
/** @deprecated 请使用 douyinFetcher.searchContent 替代 */
|
|
9249
|
-
search: createDeprecatedStub$2("search"),
|
|
9250
|
-
/** @deprecated 请使用 douyinFetcher.fetchLiveRoomInfo 替代 */
|
|
9251
|
-
getLiveRoomInfo: createDeprecatedStub$2("getLiveRoomInfo"),
|
|
9252
|
-
/** @deprecated 请使用 douyinFetcher.fetchDanmakuList 替代 */
|
|
9253
|
-
getDanmaku: createDeprecatedStub$2("getDanmaku"),
|
|
9254
|
-
/** @deprecated 请使用 douyinFetcher 的具体方法替代 */
|
|
9255
|
-
invoke: createDeprecatedStub$2("invoke")
|
|
9256
|
-
};
|
|
9257
|
-
/**
|
|
9258
|
-
* 创建绑定了cookie的抖音API对象
|
|
9259
|
-
*
|
|
9260
|
-
* @deprecated v6 已废弃,请使用 createBoundDouyinFetcher 替代
|
|
9261
|
-
*/
|
|
9262
|
-
const createBoundDouyinApi = (_cookie, _requestConfig) => {
|
|
9263
|
-
return {
|
|
9264
|
-
...douyin,
|
|
9265
|
-
getSearchData: createDeprecatedStub$2("getSearchData")
|
|
9266
|
-
};
|
|
8633
|
+
bilibiliApiUrls
|
|
9267
8634
|
};
|
|
9268
8635
|
//#endregion
|
|
9269
8636
|
//#region src/platform/douyin/routes.ts
|
|
@@ -9317,46 +8684,7 @@ const createDouyinRoutes = (cookie, requestConfig = getDouyinDefaultConfig(cooki
|
|
|
9317
8684
|
/** 抖音相关功能模块 (工具集) */
|
|
9318
8685
|
const douyinUtils = {
|
|
9319
8686
|
sign: douyinSign,
|
|
9320
|
-
douyinApiUrls
|
|
9321
|
-
api: douyin
|
|
9322
|
-
};
|
|
9323
|
-
//#endregion
|
|
9324
|
-
//#region src/platform/kuaishou/KuaishouApi.ts
|
|
9325
|
-
/**
|
|
9326
|
-
* 创建废弃的 API 存根函数
|
|
9327
|
-
*/
|
|
9328
|
-
const createDeprecatedStub$1 = (methodName) => {
|
|
9329
|
-
return (..._args) => {
|
|
9330
|
-
checkDeprecation("getKuaishouData");
|
|
9331
|
-
throw new Error(`kuaishou.${methodName} 已废弃,请使用 kuaishouFetcher 替代`);
|
|
9332
|
-
};
|
|
9333
|
-
};
|
|
9334
|
-
/**
|
|
9335
|
-
* 快手相关 API 的命名空间。
|
|
9336
|
-
*
|
|
9337
|
-
* @deprecated v6 已废弃,请使用 kuaishouFetcher 或 client.kuaishou.fetcher 替代
|
|
9338
|
-
*/
|
|
9339
|
-
const kuaishou = {
|
|
9340
|
-
/** @deprecated 请使用 kuaishouFetcher.fetchVideoWork 替代 */
|
|
9341
|
-
getWorkInfo: createDeprecatedStub$1("getWorkInfo"),
|
|
9342
|
-
/** @deprecated 请使用 kuaishouFetcher.fetchWorkComments 替代 */
|
|
9343
|
-
getComments: createDeprecatedStub$1("getComments"),
|
|
9344
|
-
/** @deprecated 请使用 kuaishouFetcher.fetchUserProfile 替代 */
|
|
9345
|
-
getUserProfile: createDeprecatedStub$1("getUserProfile"),
|
|
9346
|
-
/** @deprecated 请使用 kuaishouFetcher.fetchUserWorkList 替代 */
|
|
9347
|
-
getUserWorkList: createDeprecatedStub$1("getUserWorkList"),
|
|
9348
|
-
/** @deprecated 请使用 kuaishouFetcher.fetchLiveRoomInfo 替代 */
|
|
9349
|
-
getLiveRoomInfo: createDeprecatedStub$1("getLiveRoomInfo"),
|
|
9350
|
-
/** @deprecated 请使用 kuaishouFetcher.fetchEmojiList 替代 */
|
|
9351
|
-
getEmojiList: createDeprecatedStub$1("getEmojiList")
|
|
9352
|
-
};
|
|
9353
|
-
/**
|
|
9354
|
-
* 创建绑定了cookie的快手API对象
|
|
9355
|
-
*
|
|
9356
|
-
* @deprecated v6 已废弃,请使用 createBoundKuaishouFetcher 替代
|
|
9357
|
-
*/
|
|
9358
|
-
const createBoundKuaishouApi = (_cookie, _requestConfig) => {
|
|
9359
|
-
return { ...kuaishou };
|
|
8687
|
+
douyinApiUrls
|
|
9360
8688
|
};
|
|
9361
8689
|
//#endregion
|
|
9362
8690
|
//#region src/platform/kuaishou/routes.ts
|
|
@@ -9410,48 +8738,7 @@ const createKuaishouRoutes = (cookie, requestConfig = getKuaishouDefaultConfig(c
|
|
|
9410
8738
|
/** 快手相关功能模块 (工具集) */
|
|
9411
8739
|
const kuaishouUtils = {
|
|
9412
8740
|
sign: kuaishouSign,
|
|
9413
|
-
kuaishouApiUrls
|
|
9414
|
-
api: kuaishou
|
|
9415
|
-
};
|
|
9416
|
-
//#endregion
|
|
9417
|
-
//#region src/platform/xiaohongshu/XiaohongshuApi.ts
|
|
9418
|
-
/**
|
|
9419
|
-
* 创建废弃的 API 存根函数
|
|
9420
|
-
*/
|
|
9421
|
-
const createDeprecatedStub = (methodName) => {
|
|
9422
|
-
return (..._args) => {
|
|
9423
|
-
checkDeprecation("getXiaohongshuData");
|
|
9424
|
-
throw new Error(`xiaohongshu.${methodName} 已废弃,请使用 xiaohongshuFetcher 替代`);
|
|
9425
|
-
};
|
|
9426
|
-
};
|
|
9427
|
-
/**
|
|
9428
|
-
* 封装了所有小红书相关的API请求,采用对象化的方式组织。
|
|
9429
|
-
*
|
|
9430
|
-
* @deprecated v6 已废弃,请使用 xiaohongshuFetcher 或 client.xiaohongshu.fetcher 替代
|
|
9431
|
-
*/
|
|
9432
|
-
const xiaohongshu = {
|
|
9433
|
-
/** @deprecated 请使用 xiaohongshuFetcher.fetchHomeFeed 替代 */
|
|
9434
|
-
getHomeFeed: createDeprecatedStub("getHomeFeed"),
|
|
9435
|
-
/** @deprecated 请使用 xiaohongshuFetcher.fetchNoteDetail 替代 */
|
|
9436
|
-
getNote: createDeprecatedStub("getNote"),
|
|
9437
|
-
/** @deprecated 请使用 xiaohongshuFetcher.fetchNoteComments 替代 */
|
|
9438
|
-
getComments: createDeprecatedStub("getComments"),
|
|
9439
|
-
/** @deprecated 请使用 xiaohongshuFetcher.fetchUserProfile 替代 */
|
|
9440
|
-
getUser: createDeprecatedStub("getUser"),
|
|
9441
|
-
/** @deprecated 请使用 xiaohongshuFetcher.fetchUserNoteList 替代 */
|
|
9442
|
-
getUserNotes: createDeprecatedStub("getUserNotes"),
|
|
9443
|
-
/** @deprecated 请使用 xiaohongshuFetcher.searchNotes 替代 */
|
|
9444
|
-
getSearchNotes: createDeprecatedStub("getSearchNotes"),
|
|
9445
|
-
/** @deprecated 请使用 xiaohongshuFetcher.fetchEmojiList 替代 */
|
|
9446
|
-
getEmojiList: createDeprecatedStub("getEmojiList")
|
|
9447
|
-
};
|
|
9448
|
-
/**
|
|
9449
|
-
* 创建绑定了cookie的小红书API对象
|
|
9450
|
-
*
|
|
9451
|
-
* @deprecated v6 已废弃,请使用 createBoundXiaohongshuFetcher 替代
|
|
9452
|
-
*/
|
|
9453
|
-
const createBoundXiaohongshuApi = (_cookie, _requestConfig) => {
|
|
9454
|
-
return { ...xiaohongshu };
|
|
8741
|
+
kuaishouApiUrls
|
|
9455
8742
|
};
|
|
9456
8743
|
//#endregion
|
|
9457
8744
|
//#region src/platform/xiaohongshu/routes.ts
|
|
@@ -9505,8 +8792,7 @@ const createXiaohongshuRoutes = (cookie, requestConfig = getXiaohongshuDefaultCo
|
|
|
9505
8792
|
/** 小红书相关功能模块 (工具集) */
|
|
9506
8793
|
const xiaohongshuUtils = {
|
|
9507
8794
|
sign: xiaohongshuSign,
|
|
9508
|
-
xiaohongshuApiUrls
|
|
9509
|
-
api: xiaohongshu
|
|
8795
|
+
xiaohongshuApiUrls
|
|
9510
8796
|
};
|
|
9511
8797
|
//#endregion
|
|
9512
8798
|
//#region src/server/index.ts
|
|
@@ -9553,38 +8839,6 @@ const createAmagiClient = (options) => {
|
|
|
9553
8839
|
});
|
|
9554
8840
|
return app;
|
|
9555
8841
|
};
|
|
9556
|
-
/**
|
|
9557
|
-
* @deprecated v6 已废弃,请使用 douyin.fetcher 替代
|
|
9558
|
-
* @throws {DeprecatedApiError} 调用时抛出废弃错误
|
|
9559
|
-
*/
|
|
9560
|
-
const getDouyinData = (..._args) => {
|
|
9561
|
-
checkDeprecation("getDouyinData");
|
|
9562
|
-
throw new Error("getDouyinData 已废弃");
|
|
9563
|
-
};
|
|
9564
|
-
/**
|
|
9565
|
-
* @deprecated v6 已废弃,请使用 bilibili.fetcher 替代
|
|
9566
|
-
* @throws {DeprecatedApiError} 调用时抛出废弃错误
|
|
9567
|
-
*/
|
|
9568
|
-
const getBilibiliData = (..._args) => {
|
|
9569
|
-
checkDeprecation("getBilibiliData");
|
|
9570
|
-
throw new Error("getBilibiliData 已废弃");
|
|
9571
|
-
};
|
|
9572
|
-
/**
|
|
9573
|
-
* @deprecated v6 已废弃,请使用 kuaishou.fetcher 替代
|
|
9574
|
-
* @throws {DeprecatedApiError} 调用时抛出废弃错误
|
|
9575
|
-
*/
|
|
9576
|
-
const getKuaishouData = (..._args) => {
|
|
9577
|
-
checkDeprecation("getKuaishouData");
|
|
9578
|
-
throw new Error("getKuaishouData 已废弃");
|
|
9579
|
-
};
|
|
9580
|
-
/**
|
|
9581
|
-
* @deprecated v6 已废弃,请使用 xiaohongshu.fetcher 替代
|
|
9582
|
-
* @throws {DeprecatedApiError} 调用时抛出废弃错误
|
|
9583
|
-
*/
|
|
9584
|
-
const getXiaohongshuData = (..._args) => {
|
|
9585
|
-
checkDeprecation("getXiaohongshuData");
|
|
9586
|
-
throw new Error("getXiaohongshuData 已废弃");
|
|
9587
|
-
};
|
|
9588
8842
|
return {
|
|
9589
8843
|
/** 启动本地HTTP服务 */
|
|
9590
8844
|
startServer,
|
|
@@ -9602,39 +8856,23 @@ const createAmagiClient = (options) => {
|
|
|
9602
8856
|
* @param listener - 事件处理函数 (只触发一次)
|
|
9603
8857
|
*/
|
|
9604
8858
|
once: (event, listener) => amagiEvents.once(event, listener),
|
|
9605
|
-
/** @deprecated v6 已废弃,请使用 douyin.fetcher 替代 */
|
|
9606
|
-
getDouyinData,
|
|
9607
|
-
/** @deprecated v6 已废弃,请使用 bilibili.fetcher 替代 */
|
|
9608
|
-
getBilibiliData,
|
|
9609
|
-
/** @deprecated v6 已废弃,请使用 kuaishou.fetcher 替代 */
|
|
9610
|
-
getKuaishouData,
|
|
9611
|
-
/** @deprecated v6 已废弃,请使用 xiaohongshu.fetcher 替代 */
|
|
9612
|
-
getXiaohongshuData,
|
|
9613
8859
|
douyin: {
|
|
9614
8860
|
...douyinUtils,
|
|
9615
|
-
/** @deprecated 请使用 fetcher 替代 */
|
|
9616
|
-
api: createBoundDouyinApi(douyinCookie, requestConfig),
|
|
9617
8861
|
/** fetcher */
|
|
9618
8862
|
fetcher: createBoundDouyinFetcher(douyinCookie, requestConfig)
|
|
9619
8863
|
},
|
|
9620
8864
|
bilibili: {
|
|
9621
8865
|
...bilibiliUtils,
|
|
9622
|
-
/** @deprecated 请使用 fetcher 替代 */
|
|
9623
|
-
api: createBoundBilibiliApi(bilibiliCookie, requestConfig),
|
|
9624
8866
|
/** fetcher */
|
|
9625
8867
|
fetcher: createBoundBilibiliFetcher(bilibiliCookie, requestConfig)
|
|
9626
8868
|
},
|
|
9627
8869
|
kuaishou: {
|
|
9628
8870
|
...kuaishouUtils,
|
|
9629
|
-
/** @deprecated 请使用 fetcher 替代 */
|
|
9630
|
-
api: createBoundKuaishouApi(kuaishouCookie, requestConfig),
|
|
9631
8871
|
/** fetcher */
|
|
9632
8872
|
fetcher: createBoundKuaishouFetcher(kuaishouCookie, requestConfig)
|
|
9633
8873
|
},
|
|
9634
8874
|
xiaohongshu: {
|
|
9635
8875
|
...xiaohongshuUtils,
|
|
9636
|
-
/** @deprecated 请使用 fetcher 替代 */
|
|
9637
|
-
api: createBoundXiaohongshuApi(xiaohongshuCookie, requestConfig),
|
|
9638
8876
|
/** fetcher */
|
|
9639
8877
|
fetcher: createBoundXiaohongshuFetcher(xiaohongshuCookie, requestConfig)
|
|
9640
8878
|
}
|
|
@@ -9798,7 +9036,6 @@ const BilibiliInternalMethods = {
|
|
|
9798
9036
|
USER_SPACE_INFO: "用户空间详细信息",
|
|
9799
9037
|
USER_TOTAL_VIEWS: "获取UP主总播放量",
|
|
9800
9038
|
DYNAMIC_DETAIL: "动态详情数据",
|
|
9801
|
-
DYNAMIC_CARD: "动态卡片数据",
|
|
9802
9039
|
BANGUMI_INFO: "番剧基本信息数据",
|
|
9803
9040
|
BANGUMI_STREAM: "番剧下载信息数据",
|
|
9804
9041
|
LIVE_ROOM_INFO: "直播间信息",
|
|
@@ -9829,7 +9066,6 @@ const BilibiliFetcherMethods = {
|
|
|
9829
9066
|
USER_SPACE_INFO: "fetchUserSpaceInfo",
|
|
9830
9067
|
USER_TOTAL_VIEWS: "fetchUploaderTotalViews",
|
|
9831
9068
|
DYNAMIC_DETAIL: "fetchDynamicDetail",
|
|
9832
|
-
DYNAMIC_CARD: "fetchDynamicCard",
|
|
9833
9069
|
BANGUMI_INFO: "fetchBangumiInfo",
|
|
9834
9070
|
BANGUMI_STREAM: "fetchBangumiStreamUrl",
|
|
9835
9071
|
LIVE_ROOM_INFO: "fetchLiveRoomInfo",
|
|
@@ -9938,7 +9174,6 @@ const BilibiliMethodToFetcher = {
|
|
|
9938
9174
|
[BilibiliInternalMethods.USER_SPACE_INFO]: BilibiliFetcherMethods.USER_SPACE_INFO,
|
|
9939
9175
|
[BilibiliInternalMethods.USER_TOTAL_VIEWS]: BilibiliFetcherMethods.USER_TOTAL_VIEWS,
|
|
9940
9176
|
[BilibiliInternalMethods.DYNAMIC_DETAIL]: BilibiliFetcherMethods.DYNAMIC_DETAIL,
|
|
9941
|
-
[BilibiliInternalMethods.DYNAMIC_CARD]: BilibiliFetcherMethods.DYNAMIC_CARD,
|
|
9942
9177
|
[BilibiliInternalMethods.BANGUMI_INFO]: BilibiliFetcherMethods.BANGUMI_INFO,
|
|
9943
9178
|
[BilibiliInternalMethods.BANGUMI_STREAM]: BilibiliFetcherMethods.BANGUMI_STREAM,
|
|
9944
9179
|
[BilibiliInternalMethods.LIVE_ROOM_INFO]: BilibiliFetcherMethods.LIVE_ROOM_INFO,
|
|
@@ -10070,7 +9305,6 @@ const BilibiliMethodMapping = {
|
|
|
10070
9305
|
用户空间详细信息: "fetchUserSpaceInfo",
|
|
10071
9306
|
获取UP主总播放量: "fetchUploaderTotalViews",
|
|
10072
9307
|
动态详情数据: "fetchDynamicDetail",
|
|
10073
|
-
动态卡片数据: "fetchDynamicCard",
|
|
10074
9308
|
番剧基本信息数据: "fetchBangumiInfo",
|
|
10075
9309
|
番剧下载信息数据: "fetchBangumiStreamUrl",
|
|
10076
9310
|
直播间信息: "fetchLiveRoomInfo",
|
|
@@ -10153,7 +9387,6 @@ const BilibiliApiRoutes = {
|
|
|
10153
9387
|
userSpaceInfo: "/user/space",
|
|
10154
9388
|
uploaderTotalViews: "/user/total-views",
|
|
10155
9389
|
dynamicDetail: "/dynamic",
|
|
10156
|
-
dynamicCard: "/dynamic/card",
|
|
10157
9390
|
bangumiInfo: "/bangumi",
|
|
10158
9391
|
bangumiStream: "/bangumi/stream",
|
|
10159
9392
|
liveRoomInfo: "/live",
|
|
@@ -10223,14 +9456,10 @@ function getApiRoute(platform, methodType) {
|
|
|
10223
9456
|
* 构建后使用 __VERSION__,开发环境从 package.json 读取
|
|
10224
9457
|
*/
|
|
10225
9458
|
const getVersion = () => {
|
|
10226
|
-
return "6.
|
|
9459
|
+
return "6.5.0";
|
|
10227
9460
|
};
|
|
10228
9461
|
const VERSION = getVersion();
|
|
10229
9462
|
/**
|
|
10230
|
-
* @deprecated 请使用 createAmagiClient 替代
|
|
10231
|
-
*/
|
|
10232
|
-
const amagiClient = createAmagiClient;
|
|
10233
|
-
/**
|
|
10234
9463
|
* 创建一个新的 amagi 客户端实例
|
|
10235
9464
|
* 用于创建和初始化一个新的 amagi 客户端实例,支持通过 new 关键字或函数调用方式使用
|
|
10236
9465
|
* @param options - cookies 配置选项,用于设置客户端的 cookies 相关参数
|
|
@@ -10250,10 +9479,6 @@ CreateAmagiApp.douyin = douyinUtils;
|
|
|
10250
9479
|
CreateAmagiApp.bilibili = bilibiliUtils;
|
|
10251
9480
|
CreateAmagiApp.kuaishou = kuaishouUtils;
|
|
10252
9481
|
CreateAmagiApp.xiaohongshu = xiaohongshuUtils;
|
|
10253
|
-
CreateAmagiApp.getDouyinData = getDouyinData;
|
|
10254
|
-
CreateAmagiApp.getBilibiliData = getBilibiliData;
|
|
10255
|
-
CreateAmagiApp.getKuaishouData = getKuaishouData;
|
|
10256
|
-
CreateAmagiApp.getXiaohongshuData = getXiaohongshuData;
|
|
10257
9482
|
CreateAmagiApp.events = amagiEvents;
|
|
10258
9483
|
CreateAmagiApp.on = amagiEvents.on.bind(amagiEvents);
|
|
10259
9484
|
CreateAmagiApp.once = amagiEvents.once.bind(amagiEvents);
|
|
@@ -10354,10 +9579,8 @@ exports.XiaohongshuMethodRoutes = XiaohongshuMethodRoutes;
|
|
|
10354
9579
|
exports.XiaohongshuMethodToFetcher = XiaohongshuMethodToFetcher;
|
|
10355
9580
|
exports.XiaohongshuValidationSchemas = XiaohongshuValidationSchemas;
|
|
10356
9581
|
exports.amagi = amagi;
|
|
10357
|
-
exports.amagiClient = amagiClient;
|
|
10358
9582
|
exports.amagiEvents = amagiEvents;
|
|
10359
9583
|
exports.av2bv = av2bv;
|
|
10360
|
-
exports.bilibili = bilibili;
|
|
10361
9584
|
exports.bilibiliApiUrls = bilibiliApiUrls;
|
|
10362
9585
|
exports.bilibiliErrorCodeMap = bilibiliErrorCodeMap;
|
|
10363
9586
|
exports.bilibiliFetcher = bilibiliFetcher;
|
|
@@ -10365,13 +9588,9 @@ exports.bilibiliUtils = bilibiliUtils;
|
|
|
10365
9588
|
exports.bv2av = bv2av;
|
|
10366
9589
|
exports.createAmagiClient = createAmagiClient;
|
|
10367
9590
|
exports.createBilibiliRoutes = createBilibiliRoutes;
|
|
10368
|
-
exports.createBoundBilibiliApi = createBoundBilibiliApi;
|
|
10369
9591
|
exports.createBoundBilibiliFetcher = createBoundBilibiliFetcher;
|
|
10370
|
-
exports.createBoundDouyinApi = createBoundDouyinApi;
|
|
10371
9592
|
exports.createBoundDouyinFetcher = createBoundDouyinFetcher;
|
|
10372
|
-
exports.createBoundKuaishouApi = createBoundKuaishouApi;
|
|
10373
9593
|
exports.createBoundKuaishouFetcher = createBoundKuaishouFetcher;
|
|
10374
|
-
exports.createBoundXiaohongshuApi = createBoundXiaohongshuApi;
|
|
10375
9594
|
exports.createBoundXiaohongshuFetcher = createBoundXiaohongshuFetcher;
|
|
10376
9595
|
exports.createDouyinRoutes = createDouyinRoutes;
|
|
10377
9596
|
exports.createErrorResponse = createErrorResponse;
|
|
@@ -10379,7 +9598,6 @@ exports.createKuaishouRoutes = createKuaishouRoutes;
|
|
|
10379
9598
|
exports.createSuccessResponse = createSuccessResponse;
|
|
10380
9599
|
exports.createXiaohongshuRoutes = createXiaohongshuRoutes;
|
|
10381
9600
|
exports.default = Client;
|
|
10382
|
-
exports.douyin = douyin;
|
|
10383
9601
|
exports.douyinApiUrls = douyinApiUrls;
|
|
10384
9602
|
exports.douyinFetcher = douyinFetcher;
|
|
10385
9603
|
exports.douyinSign = douyinSign;
|
|
@@ -10399,22 +9617,14 @@ exports.emitNetworkRetry = emitNetworkRetry;
|
|
|
10399
9617
|
exports.fetchData = fetchData;
|
|
10400
9618
|
exports.fetchResponse = fetchResponse;
|
|
10401
9619
|
exports.getApiRoute = getApiRoute;
|
|
10402
|
-
exports.getBilibiliData = getBilibiliData;
|
|
10403
|
-
exports.getDouyinData = getDouyinData;
|
|
10404
9620
|
exports.getEnglishMethodName = getEnglishMethodName;
|
|
10405
9621
|
exports.getHeadersAndData = getHeadersAndData;
|
|
10406
|
-
exports.getKuaishouData = getKuaishouData;
|
|
10407
9622
|
exports.handleError = handleError;
|
|
10408
|
-
exports.httpLogger = httpLogger;
|
|
10409
|
-
exports.initLogger = initLogger;
|
|
10410
9623
|
exports.isNetworkErrorResult = isNetworkErrorResult;
|
|
10411
|
-
exports.kuaishou = kuaishou;
|
|
10412
9624
|
exports.kuaishouApiUrls = kuaishouApiUrls;
|
|
10413
9625
|
exports.kuaishouFetcher = kuaishouFetcher;
|
|
10414
9626
|
exports.kuaishouSign = kuaishouSign;
|
|
10415
9627
|
exports.kuaishouUtils = kuaishouUtils;
|
|
10416
|
-
exports.logMiddleware = logMiddleware;
|
|
10417
|
-
exports.logger = logger;
|
|
10418
9628
|
exports.parseDmSegMobileReply = parseDmSegMobileReply;
|
|
10419
9629
|
exports.qtparam = qtparam;
|
|
10420
9630
|
exports.registerBilibiliRoutes = createBilibiliRoutes;
|
|
@@ -10427,7 +9637,6 @@ exports.validateDouyinParams = validateDouyinParams;
|
|
|
10427
9637
|
exports.validateKuaishouParams = validateKuaishouParams;
|
|
10428
9638
|
exports.validateXiaohongshuParams = validateXiaohongshuParams;
|
|
10429
9639
|
exports.wbi_sign = wbi_sign;
|
|
10430
|
-
exports.xiaohongshu = xiaohongshu;
|
|
10431
9640
|
exports.xiaohongshuApiUrls = xiaohongshuApiUrls;
|
|
10432
9641
|
exports.xiaohongshuFetcher = xiaohongshuFetcher;
|
|
10433
9642
|
exports.xiaohongshuSign = xiaohongshuSign;
|