@ikenxuan/amagi 5.6.1 → 5.6.3
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/README.md +228 -104
- package/dist/default/cjs/index.cjs +14 -9
- package/dist/default/esm/index.mjs +13 -8
- package/dist/default/index.d.ts +177 -182
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,156 +1,280 @@
|
|
|
1
|
-
# amagi
|
|
1
|
+
# @ikenxuan/amagi
|
|
2
2
|
|
|
3
|
-
抖音、
|
|
3
|
+
> 抖音、B站、快手、小红书 Web 端相关数据接口的 Node.js 封装与服务。支持“直接调用(SDK)”与“本地 HTTP 服务”两种使用方式,并内置严格的参数校验与统一响应格式。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
文档站点(API 文档):https://amagi.apifox.cn
|
|
6
|
+
开发者文档(Typedoc):https://ikenxuan.github.io/amagi
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
本项目最初的代码从 [kkkkkk-10086](https://github.com/ikenxuan/kkkkkk-10086) 解耦。主要负责相关数据接口的封装。
|
|
8
9
|
|
|
9
|
-
|
|
10
|
+
[@ikenxuan/amagi](https://www.npmjs.com/package/@ikenxuan/amagi) 将作为一个独立的上游模块,提供给下游 [karin-plugin-kkk](https://github.com/ikenxuan/karin-plugin-kkk) 和 [kkkkkk-10086](https://github.com/ikenxuan/kkkkkk-10086) 进行视频解析相关业务使用。这两个项目已完成了几乎所有由 ikenxuan 安排的功能和任务,所以它们如果没有什么新的业务需求,本项目大概再也不会封装新的任何接口。
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
当然,如果你的下游有新的业务需求,欢迎提 issue 或 pr。(作者本人很菜,尤其不会逆向工程,所以 issue 不一定能解决)
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
## 特性
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
- 多平台支持:抖音、B站、快手、小红书的主流数据接口
|
|
17
|
+
- 两种使用姿势:
|
|
18
|
+
- 直接调用:通过 SDK 获取数据,支持绑定 Cookie
|
|
19
|
+
- 本地服务:一键启动 Express 服务,REST 风格路由
|
|
20
|
+
- 参数校验:基于 Zod,按方法类型校验必填与可选参数
|
|
21
|
+
- 统一响应:约定化 `ApiResponse` 返回结构,含 `success`/`code`/`message`/`data`
|
|
22
|
+
- 类型模式:`strict` 与 `loose` 可选,开发友好与容错可控
|
|
23
|
+
- 工具集齐全:签名算法、URL 拼接器、AV/BV 转换等常用工具
|
|
24
|
+
- 双模块输出:同时支持 ESM 与 CJS 引入
|
|
16
25
|
|
|
17
|
-
##
|
|
26
|
+
## 安装
|
|
27
|
+
|
|
28
|
+
使用 npm:
|
|
18
29
|
|
|
19
30
|
```bash
|
|
20
|
-
|
|
31
|
+
npm i @ikenxuan/amagi
|
|
21
32
|
```
|
|
22
33
|
|
|
34
|
+
或使用 pnpm / yarn:
|
|
23
35
|
|
|
24
|
-
|
|
25
|
-
|
|
36
|
+
```bash
|
|
37
|
+
pnpm add @ikenxuan/amagi
|
|
38
|
+
```
|
|
26
39
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
> * 第三个参数是用户的 cookies。
|
|
31
|
-
> * 得益于函数重载,参数二和参数三可以互换位置
|
|
40
|
+
```bash
|
|
41
|
+
yarn add @ikenxuan/amagi
|
|
42
|
+
```
|
|
32
43
|
|
|
33
|
-
|
|
34
|
-
|
|
44
|
+
## 快速上手
|
|
45
|
+
|
|
46
|
+
### 1) 直接调用(推荐)
|
|
47
|
+
|
|
48
|
+
SDK 方式最灵活,适合在 Node.js 程序里按需拉取数据。
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
import amagi from '@ikenxuan/amagi'
|
|
52
|
+
|
|
53
|
+
// 绑定各平台 Cookie(可选)与请求配置(可选)
|
|
54
|
+
const client = amagi({
|
|
55
|
+
cookies: {
|
|
56
|
+
bilibili: 'SESSDATA=xxx; bili_jct=yyy; ...',
|
|
57
|
+
douyin: 'ttwid=...; ...',
|
|
58
|
+
kuaishou: 'did=...; ...',
|
|
59
|
+
xiaohongshu: 'a1=...; ...',
|
|
60
|
+
},
|
|
61
|
+
request: {
|
|
62
|
+
// 例如自定义 headers、代理等
|
|
63
|
+
headers: { 'User-Agent': 'Mozilla/5.0 ...' }
|
|
64
|
+
}
|
|
65
|
+
})
|
|
66
|
+
|
|
67
|
+
// B站:获取单个视频信息(bvid)
|
|
68
|
+
const video = await client.getBilibiliData('单个视频作品数据', {
|
|
69
|
+
bvid: 'BV1xx411c7mD',
|
|
70
|
+
typeMode: 'strict' // 严格类型(可选,默认 loose)
|
|
71
|
+
})
|
|
72
|
+
if (video.success) {
|
|
73
|
+
console.log(video.data)
|
|
74
|
+
}
|
|
35
75
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
76
|
+
// 抖音:获取评论数据(aweme_id)
|
|
77
|
+
const comments = await client.getDouyinData('评论数据', {
|
|
78
|
+
aweme_id: '1234567890123456789',
|
|
79
|
+
number: 20
|
|
80
|
+
})
|
|
81
|
+
console.log(comments)
|
|
40
82
|
|
|
41
|
-
//
|
|
42
|
-
const
|
|
43
|
-
const amagi = new Client({...options})
|
|
83
|
+
// 也可使用绑定 Cookie 的 API 对象:不再传 cookie
|
|
84
|
+
const { bilibili, douyin, kuaishou, xiaohongshu } = client
|
|
44
85
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
{ ...opt }
|
|
51
|
-
)
|
|
86
|
+
const bInfo = await bilibili.api.getVideoInfo({ bvid: 'BV1xx411c7mD' })
|
|
87
|
+
const dCom = await douyin.api.getComments({ aweme_id: '1234567890123456789', number: 10 })
|
|
88
|
+
const kInfo = await kuaishou.api.getWorkInfo({ photoId: '3xqxxxxxx' })
|
|
89
|
+
const xNote = await xiaohongshu.api.getNote({ note_id: '64xxxxxxxx', xsec_token: 'xsec_xxx' })
|
|
90
|
+
```
|
|
52
91
|
|
|
53
|
-
|
|
54
|
-
const videoData = await amagi.getBilibiliData(
|
|
55
|
-
'单个视频作品数据',
|
|
56
|
-
{ ...opt }
|
|
57
|
-
)
|
|
92
|
+
也可以不用实例,直接调用静态方法(手动给 cookie):
|
|
58
93
|
|
|
59
|
-
|
|
60
|
-
|
|
94
|
+
```ts
|
|
95
|
+
import amagi from '@ikenxuan/amagi'
|
|
61
96
|
|
|
62
|
-
|
|
97
|
+
const res = await amagi.getBilibiliData('单个视频作品数据', { bvid: 'BV1xx411c7mD' }, 'SESSDATA=...')
|
|
98
|
+
console.log(res)
|
|
63
99
|
```
|
|
64
100
|
|
|
65
|
-
|
|
101
|
+
### 2) 启动本地 HTTP 服务
|
|
102
|
+
|
|
103
|
+
一行代码启动 Express 服务,路由自动注册。
|
|
66
104
|
|
|
67
|
-
|
|
105
|
+
```ts
|
|
106
|
+
import amagi from '@ikenxuan/amagi'
|
|
68
107
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
108
|
+
// 端口默认 4567,可自定义
|
|
109
|
+
amagi({
|
|
110
|
+
cookies: {
|
|
111
|
+
bilibili: 'SESSDATA=xxx; bili_jct=yyy; ...',
|
|
112
|
+
douyin: 'ttwid=...; ...',
|
|
113
|
+
kuaishou: 'did=...; ...',
|
|
114
|
+
xiaohongshu: 'a1=...; ...',
|
|
115
|
+
}
|
|
116
|
+
}).startServer(4567)
|
|
117
|
+
|
|
118
|
+
// 打开 http://localhost:4567/ 或 http://localhost:4567/docs
|
|
119
|
+
// 文档自动重定向至 https://amagi.apifox.cn
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
## 服务端路由(HTTP API)
|
|
123
|
+
|
|
124
|
+
- 路由与参数请直接参考 API 文档:https://amagi.apifox.cn
|
|
125
|
+
- 本地启动示例:`amagi({ cookies: {...} }).startServer(4567)`
|
|
126
|
+
|
|
127
|
+
启动服务后,默认挂载在 `/api/<platform>` 下。以下列出主要路由与典型参数(查询串/JSON 皆可):
|
|
128
|
+
|
|
129
|
+
- Douyin `/api/douyin`
|
|
130
|
+
- `GET /fetch_one_work` 聚合解析(`aweme_id`)
|
|
131
|
+
- `GET /fetch_work_comments` 评论数据(`aweme_id`, `number?`, `cursor?`)
|
|
132
|
+
- `GET /fetch_user_info` 用户主页数据(`sec_uid`)
|
|
133
|
+
- `GET /fetch_user_post_videos` 用户主页视频列表(`sec_uid`)
|
|
134
|
+
- `GET /fetch_search_info` 搜索/热点词(`query`, `number?`, `search_id?`)
|
|
135
|
+
- `GET /fetch_suggest_words` 热点词数据(`query`, `number?`)
|
|
136
|
+
- `GET /fetch_music_work` 音乐数据(`music_id`)
|
|
137
|
+
- `GET /fetch_emoji_list` Emoji 列表
|
|
138
|
+
- `GET /fetch_emoji_pro_list` 动态表情列表
|
|
139
|
+
- `GET /fetch_user_live_videos` 直播间信息(`sec_uid`)
|
|
140
|
+
- `GET /fetch_video_comment_replies` 指定评论回复(`aweme_id`, `comment_id`, `number?`, `cursor?`)
|
|
141
|
+
- `GET /fetch_work_danmaku` 弹幕数据(`aweme_id`, `duration`, `start_time?`, `end_time?`)
|
|
142
|
+
|
|
143
|
+
- Bilibili `/api/bilibili`
|
|
144
|
+
- `GET /fetch_one_video` 单个视频作品数据(`bvid`)
|
|
145
|
+
- `GET /fetch_video_playurl` 单个视频下载信息(`avid`, `cid`)
|
|
146
|
+
- `GET /fetch_work_comments` 评论数据(`oid`, `type`, `pn?`, `number?`)
|
|
147
|
+
- `GET /fetch_user_profile` 用户主页数据(`host_mid`)
|
|
148
|
+
- `GET /fetch_user_dynamic` 用户主页动态列表(`host_mid`)
|
|
149
|
+
- `GET /fetch_emoji_list` Emoji 列表
|
|
150
|
+
- `GET /fetch_bangumi_video_info` 番剧基本信息(二选一:`ep_id` 或 `season_id`)
|
|
151
|
+
- `GET /fetch_bangumi_video_playurl` 番剧下载信息(`cid`, `ep_id`)
|
|
152
|
+
- `GET /fetch_dynamic_info` 动态详情(`dynamic_id`)
|
|
153
|
+
- `GET /fetch_dynamic_card` 动态卡片(`dynamic_id`)
|
|
154
|
+
- `GET /fetch_live_room_detail` 直播间信息(`room_id`)
|
|
155
|
+
- `GET /fetch_liveroom_def` 直播间初始化信息(`room_id`)
|
|
156
|
+
- `GET /login_basic_info` 登录基本信息
|
|
157
|
+
- `GET /new_login_qrcode` 申请二维码
|
|
158
|
+
- `GET /check_qrcode` 二维码状态(`qrcode_key`)
|
|
159
|
+
- `GET /fetch_user_full_view` UP 主总播放量(`host_mid`)
|
|
160
|
+
- `GET /av_to_bv` AV 转 BV(`avid`)
|
|
161
|
+
- `GET /bv_to_av` BV 转 AV(`bvid`)
|
|
162
|
+
|
|
163
|
+
- Kuaishou `/api/kuaishou`
|
|
164
|
+
- `GET /fetch_one_work` 单个视频作品数据(`photoId`)
|
|
165
|
+
- `GET /fetch_work_comments` 评论数据(`photoId`)
|
|
166
|
+
- `GET /fetch_emoji_list` Emoji 列表
|
|
167
|
+
|
|
168
|
+
- Xiaohongshu `/api/xiaohongshu`
|
|
169
|
+
- `GET /fetch_home_feed` 首页推荐(`cursor_score?`, `num?`, `refresh_type?`, `note_index?`, `category?`, `search_key?`)
|
|
170
|
+
- `GET /fetch_one_note` 单个笔记数据(`note_id`, `xsec_token`)
|
|
171
|
+
- `GET /fetch_note_comments` 评论数据(`note_id`, `xsec_token`, `cursor?`)
|
|
172
|
+
- `GET /fetch_user_profile` 用户数据(`user_id`)
|
|
173
|
+
- `GET /fetch_user_notes` 用户笔记(`user_id`, `cursor?`, `num?`)
|
|
174
|
+
- `GET /fetch_emoji_list` 表情列表
|
|
175
|
+
- `GET /fetch_search_notes` 搜索笔记(`keyword`, `page?`, `page_size?`, `sort?`, `note_type?`)
|
|
176
|
+
|
|
177
|
+
说明:
|
|
178
|
+
- 路由内部已固定 `methodType`,你只需传具体业务参数即可。
|
|
179
|
+
- 抖音的 `/fetch_one_work` 同路径注册了多个方法(视频 / 图集 / 合辑 / 聚合),推荐使用“聚合解析”。
|
|
180
|
+
|
|
181
|
+
## 统一响应结构
|
|
182
|
+
|
|
183
|
+
所有 API 返回统一结构:
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
{
|
|
187
|
+
"success": true,
|
|
188
|
+
"code": 200,
|
|
189
|
+
"message": "获取成功",
|
|
190
|
+
"data": { ... },
|
|
191
|
+
"requestPath": "/api/bilibili/fetch_one_video?bvid=BV1xx411c7mD"
|
|
75
192
|
}
|
|
76
193
|
```
|
|
77
194
|
|
|
78
|
-
|
|
195
|
+
错误时:
|
|
79
196
|
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
197
|
+
```json
|
|
198
|
+
{
|
|
199
|
+
"success": false,
|
|
200
|
+
"code": 400,
|
|
201
|
+
"message": "参数错误",
|
|
202
|
+
"error": { "name": "ZodError", "details": [ ... ] },
|
|
203
|
+
"requestPath": "/api/douyin/fetch_work_comments?aweme_id=..."
|
|
87
204
|
}
|
|
88
205
|
```
|
|
89
206
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
> 接口返回数据的类型类型为自动生成,仅供参考,不保证 100% 准确。
|
|
207
|
+
## 类型模式与参数校验
|
|
93
208
|
|
|
94
|
-
|
|
209
|
+
- 类型模式 `typeMode`
|
|
210
|
+
- `strict`:返回严格类型(基于已知响应结构,可能缺少平台新增字段)
|
|
211
|
+
- `loose`:返回 `any`,容错更强(默认)
|
|
212
|
+
- 使用位置:仅 SDK 直接调用可指定 `typeMode`,HTTP 路由默认等价于 `loose`
|
|
95
213
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
'搜索数据',
|
|
100
|
-
{ keyword: '测试', typeMode: 'strict' }
|
|
101
|
-
)
|
|
214
|
+
- 参数校验(Zod)
|
|
215
|
+
- 每个方法类型对应一套完整参数校验规则
|
|
216
|
+
- 请求入参不合法时将返回错误响应(含详细错误信息)
|
|
102
217
|
|
|
103
|
-
|
|
104
|
-
const looseResult = await client.getDouyinData(
|
|
105
|
-
'搜索数据',
|
|
106
|
-
{ keyword: '测试', typeMode: 'loose' }
|
|
107
|
-
)
|
|
108
|
-
```
|
|
218
|
+
## 工具集与常用能力
|
|
109
219
|
|
|
110
|
-
|
|
220
|
+
所有平台工具集从包顶层导出,可直接使用:
|
|
111
221
|
|
|
112
|
-
|
|
222
|
+
```ts
|
|
223
|
+
import { douyinUtils, bilibiliUtils, kuaishouUtils } from '@ikenxuan/amagi'
|
|
224
|
+
import { xiaohongshuUtils } from '@ikenxuan/amagi'
|
|
225
|
+
```
|
|
113
226
|
|
|
114
|
-
|
|
115
|
-
|
|
227
|
+
- 抖音 `douyinUtils`
|
|
228
|
+
- `sign`: `douyinSign.Mstoken(length)`, `douyinSign.AB(url, ua)`, `douyinSign.XB(url, ua)`, `douyinSign.VerifyFpManager()`
|
|
229
|
+
- `douyinApiUrls`: 仅负责拼接基础 URL,需要再次以该 URL 生成反爬参数
|
|
230
|
+
- `api`: 原始 API 调用(需传 cookie);若使用 `client.douyin.api` 则已绑定 cookie
|
|
116
231
|
|
|
117
|
-
|
|
232
|
+
- B站 `bilibiliUtils`
|
|
233
|
+
- `sign`: `wbi_sign(baseUrl, cookie)`, `av2bv(aid: number)`, `bv2av(bvid: string)`
|
|
234
|
+
- `bilibiliApiUrls`: 仅拼接基础 URL
|
|
235
|
+
- `api`: 原始 API 调用(同上)
|
|
118
236
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
// const app = amagi.startClient(8080)
|
|
123
|
-
```
|
|
237
|
+
- 快手 `kuaishouUtils`
|
|
238
|
+
- `kuaishouApiUrls`: 仅拼接基础 URL
|
|
239
|
+
- `api`: 原始 API 调用(同上)
|
|
124
240
|
|
|
125
|
-
|
|
241
|
+
- 小红书 `xiaohongshuUtils`
|
|
242
|
+
- `sign`: `xiaohongshuSign.generateXSGet(path, a1Cookie, clientType?, params?)`,`generateXSPost(...)`,`generateXS(url, body, ua?, method?, a1Cookie?)`,`generateXSCommon(length?)`,`generateXT()`,`generateXB3Traceid()`,`extractA1FromCookie(cookieString)`,`getSearchId()`
|
|
243
|
+
- `xiaohongshuApiUrls`: 拼接 URL + POST 参数
|
|
244
|
+
- `api`: 原始 API 调用(同上)
|
|
126
245
|
|
|
127
|
-
|
|
128
|
-
- bilibili API: `http://localhost:4567/api/bilibili/...` 📺
|
|
246
|
+
### AV/BV 转换示例
|
|
129
247
|
|
|
130
|
-
|
|
248
|
+
```ts
|
|
249
|
+
import { bilibiliUtils } from '@ikenxuan/amagi'
|
|
131
250
|
|
|
132
|
-
|
|
251
|
+
const bv = bilibiliUtils.sign.av2bv(170001)
|
|
252
|
+
const av = bilibiliUtils.sign.bv2av('BV1xx411c7mD')
|
|
253
|
+
```
|
|
133
254
|
|
|
134
|
-
|
|
255
|
+
## 运行建议与注意事项
|
|
135
256
|
|
|
136
|
-
|
|
257
|
+
- Cookie 与 UA:部分接口需要有效 Cookie 与合理的 `User-Agent`;请遵循平台使用政策
|
|
258
|
+
- 频率与限流:避免高频调用,合理设置请求重试与指数退避
|
|
259
|
+
- ESM/CJS:包 `type` 为 `module`,同时提供 ESM/CJS 两类入口
|
|
260
|
+
- ESM:`import amagi from '@ikenxuan/amagi'`
|
|
261
|
+
- CJS:`const amagi = require('@ikenxuan/amagi')`
|
|
137
262
|
|
|
138
|
-
|
|
139
|
-
- 🛡️ 本项目的作者不承担任何责任,包括但不限于因使用本项目而导致的任何损失或损害。
|
|
140
|
-
- 📚 本项目仅供学习和研究使用,不得用于任何商业目的。
|
|
141
|
-
- 🔒 本项目的作者不对因使用本项目而产生的任何后果负责。
|
|
142
|
-
- 📝 本项目的使用者在下载、安装、运行或使用本工具时,即表示已阅读并同意本免责声明。如有异议,请立即停止使用本工具,并删除所有相关文件。
|
|
143
|
-
- 🔄 本项目的作者保留随时修改、更新、删除或终止本工具的权利,无需事先通知或承担任何义务。
|
|
263
|
+
## 许可证
|
|
144
264
|
|
|
145
|
-
|
|
265
|
+
GPL-3.0-only
|
|
146
266
|
|
|
147
|
-
|
|
267
|
+
## 变更日志与反馈
|
|
148
268
|
|
|
149
|
-
|
|
269
|
+
- 变更日志:请查看 GitHub Releases 或提交记录
|
|
270
|
+
- 问题反馈:GitHub Issues https://github.com/ikenxuan/amagi/issues
|
|
271
|
+
- 文档站点:https://amagi.apifox.cn
|
|
150
272
|
|
|
151
|
-
|
|
273
|
+
## 鸣谢
|
|
274
|
+
请求签名部分参考了以下项目的实现:
|
|
152
275
|
|
|
153
|
-
-
|
|
154
|
-
-
|
|
155
|
-
-
|
|
156
|
-
-
|
|
276
|
+
- [SocialSisterYi/bilibili-API-collect](https://github.com/SocialSisterYi/bilibili-API-collect)
|
|
277
|
+
- [NearHuiwen/TiktokDouyinCrawler](https://github.com/NearHuiwen/TiktokDouyinCrawler)
|
|
278
|
+
- [Evil0ctal/Douyin_TikTok_Download_API](https://github.com/Evil0ctal/Douyin_TikTok_Download_API)
|
|
279
|
+
- [Johnserf-Seed/f2](https://github.com/Johnserf-Seed/f2)
|
|
280
|
+
- [ikenxuan/xhshow-ts](https://github.com/ikenxuan/xhshow-ts)
|
|
@@ -29,7 +29,7 @@ var express__default = /*#__PURE__*/_interopDefault(express);
|
|
|
29
29
|
* GPL-3.0 Licensed
|
|
30
30
|
*/
|
|
31
31
|
|
|
32
|
-
// node_modules/.pnpm/tsup@8.5.0_@swc+core@1.13.20_tsx@4.20.6_typescript@5.
|
|
32
|
+
// node_modules/.pnpm/tsup@8.5.0_@swc+core@1.13.20_tsx@4.20.6_typescript@5.8.3_yaml@2.8.1/node_modules/tsup/assets/cjs_shims.js
|
|
33
33
|
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
34
34
|
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
35
35
|
var getPackageLogsPath = () => {
|
|
@@ -183,11 +183,7 @@ var fetchData = async (config) => {
|
|
|
183
183
|
if (cleanedConfig.headers && cleanedConfig.headers["User-Agent"]) {
|
|
184
184
|
cleanedConfig.headers["User-Agent"] = cleanUserAgent(cleanedConfig.headers["User-Agent"]);
|
|
185
185
|
}
|
|
186
|
-
const response = await axios__default.default(cleanedConfig);
|
|
187
|
-
if (response.status === 429) {
|
|
188
|
-
logger.error("HTTP \u54CD\u5E94\u72B6\u6001\u7801: 429");
|
|
189
|
-
throw new Error("ratelimit triggered, \u89E6\u53D1\u901F\u7387\u9650\u5236\uFF01");
|
|
190
|
-
}
|
|
186
|
+
const response = await axios__default.default({ ...cleanedConfig, validateStatus: () => true });
|
|
191
187
|
return response.data;
|
|
192
188
|
} catch (error) {
|
|
193
189
|
if (error instanceof axios.AxiosError) {
|
|
@@ -197,13 +193,19 @@ var fetchData = async (config) => {
|
|
|
197
193
|
throw error;
|
|
198
194
|
}
|
|
199
195
|
};
|
|
196
|
+
var normalizeHeaders = (headers) => {
|
|
197
|
+
if (headers && typeof headers.toJSON === "function") {
|
|
198
|
+
return headers.toJSON();
|
|
199
|
+
}
|
|
200
|
+
return headers || {};
|
|
201
|
+
};
|
|
200
202
|
var fetchResponse = async (config) => {
|
|
201
203
|
try {
|
|
202
204
|
const cleanedConfig = { ...config };
|
|
203
205
|
if (cleanedConfig.headers && cleanedConfig.headers["User-Agent"]) {
|
|
204
206
|
cleanedConfig.headers["User-Agent"] = cleanUserAgent(cleanedConfig.headers["User-Agent"]);
|
|
205
207
|
}
|
|
206
|
-
return await axios__default.default(cleanedConfig);
|
|
208
|
+
return await axios__default.default({ ...cleanedConfig, validateStatus: () => true });
|
|
207
209
|
} catch (error) {
|
|
208
210
|
if (error instanceof axios.AxiosError) {
|
|
209
211
|
throw error;
|
|
@@ -215,12 +217,15 @@ var getHeadersAndData = async (config) => {
|
|
|
215
217
|
try {
|
|
216
218
|
const response = await fetchResponse(config);
|
|
217
219
|
return {
|
|
218
|
-
headers: response.headers,
|
|
220
|
+
headers: normalizeHeaders(response.headers),
|
|
219
221
|
data: response.data
|
|
220
222
|
};
|
|
221
223
|
} catch (error) {
|
|
222
224
|
logger.error("\u83B7\u53D6\u54CD\u5E94\u5934\u548C\u6570\u636E\u5931\u8D25:", error);
|
|
223
|
-
return {
|
|
225
|
+
return {
|
|
226
|
+
headers: {},
|
|
227
|
+
data: {}
|
|
228
|
+
};
|
|
224
229
|
}
|
|
225
230
|
};
|
|
226
231
|
|
|
@@ -166,11 +166,7 @@ var fetchData = async (config) => {
|
|
|
166
166
|
if (cleanedConfig.headers && cleanedConfig.headers["User-Agent"]) {
|
|
167
167
|
cleanedConfig.headers["User-Agent"] = cleanUserAgent(cleanedConfig.headers["User-Agent"]);
|
|
168
168
|
}
|
|
169
|
-
const response = await axios(cleanedConfig);
|
|
170
|
-
if (response.status === 429) {
|
|
171
|
-
logger.error("HTTP \u54CD\u5E94\u72B6\u6001\u7801: 429");
|
|
172
|
-
throw new Error("ratelimit triggered, \u89E6\u53D1\u901F\u7387\u9650\u5236\uFF01");
|
|
173
|
-
}
|
|
169
|
+
const response = await axios({ ...cleanedConfig, validateStatus: () => true });
|
|
174
170
|
return response.data;
|
|
175
171
|
} catch (error) {
|
|
176
172
|
if (error instanceof AxiosError) {
|
|
@@ -180,13 +176,19 @@ var fetchData = async (config) => {
|
|
|
180
176
|
throw error;
|
|
181
177
|
}
|
|
182
178
|
};
|
|
179
|
+
var normalizeHeaders = (headers) => {
|
|
180
|
+
if (headers && typeof headers.toJSON === "function") {
|
|
181
|
+
return headers.toJSON();
|
|
182
|
+
}
|
|
183
|
+
return headers || {};
|
|
184
|
+
};
|
|
183
185
|
var fetchResponse = async (config) => {
|
|
184
186
|
try {
|
|
185
187
|
const cleanedConfig = { ...config };
|
|
186
188
|
if (cleanedConfig.headers && cleanedConfig.headers["User-Agent"]) {
|
|
187
189
|
cleanedConfig.headers["User-Agent"] = cleanUserAgent(cleanedConfig.headers["User-Agent"]);
|
|
188
190
|
}
|
|
189
|
-
return await axios(cleanedConfig);
|
|
191
|
+
return await axios({ ...cleanedConfig, validateStatus: () => true });
|
|
190
192
|
} catch (error) {
|
|
191
193
|
if (error instanceof AxiosError) {
|
|
192
194
|
throw error;
|
|
@@ -198,12 +200,15 @@ var getHeadersAndData = async (config) => {
|
|
|
198
200
|
try {
|
|
199
201
|
const response = await fetchResponse(config);
|
|
200
202
|
return {
|
|
201
|
-
headers: response.headers,
|
|
203
|
+
headers: normalizeHeaders(response.headers),
|
|
202
204
|
data: response.data
|
|
203
205
|
};
|
|
204
206
|
} catch (error) {
|
|
205
207
|
logger.error("\u83B7\u53D6\u54CD\u5E94\u5934\u548C\u6570\u636E\u5931\u8D25:", error);
|
|
206
|
-
return {
|
|
208
|
+
return {
|
|
209
|
+
headers: {},
|
|
210
|
+
data: {}
|
|
211
|
+
};
|
|
207
212
|
}
|
|
208
213
|
};
|
|
209
214
|
|
package/dist/default/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AxiosResponse, AxiosRequestConfig } from 'axios';
|
|
1
|
+
import { AxiosResponse, AxiosRequestConfig, RawAxiosResponseHeaders } from 'axios';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import * as express from 'express';
|
|
4
4
|
import express__default, { Router, RequestHandler } from 'express';
|
|
@@ -9114,6 +9114,158 @@ type LogPb$2 = {
|
|
|
9114
9114
|
[property: string]: any;
|
|
9115
9115
|
};
|
|
9116
9116
|
|
|
9117
|
+
type CommentReply = {
|
|
9118
|
+
comments: Comment$8[];
|
|
9119
|
+
cursor: number;
|
|
9120
|
+
extra: Extra;
|
|
9121
|
+
has_more: number;
|
|
9122
|
+
log_pb: LogPb$1;
|
|
9123
|
+
status_code: number;
|
|
9124
|
+
total: number;
|
|
9125
|
+
[property: string]: any;
|
|
9126
|
+
};
|
|
9127
|
+
type Comment$8 = {
|
|
9128
|
+
aweme_id: string;
|
|
9129
|
+
can_share: boolean;
|
|
9130
|
+
cid: string;
|
|
9131
|
+
comment_reply_total: number;
|
|
9132
|
+
content_type: number;
|
|
9133
|
+
create_time: number;
|
|
9134
|
+
digg_count: number;
|
|
9135
|
+
image_list: null;
|
|
9136
|
+
ip_label: string;
|
|
9137
|
+
is_author_digged: boolean;
|
|
9138
|
+
is_folded: boolean;
|
|
9139
|
+
is_hot: boolean;
|
|
9140
|
+
is_note_comment: number;
|
|
9141
|
+
label_list: null;
|
|
9142
|
+
label_text: string;
|
|
9143
|
+
label_type: number;
|
|
9144
|
+
level: number;
|
|
9145
|
+
reply_comment: null;
|
|
9146
|
+
reply_id: string;
|
|
9147
|
+
reply_to_reply_id: string;
|
|
9148
|
+
reply_to_user_sec_id: string;
|
|
9149
|
+
reply_to_userid: string;
|
|
9150
|
+
reply_to_username: string;
|
|
9151
|
+
root_comment_id: string;
|
|
9152
|
+
status: number;
|
|
9153
|
+
text: string;
|
|
9154
|
+
text_extra: TextExtra$1[];
|
|
9155
|
+
text_music_info: null;
|
|
9156
|
+
user: User;
|
|
9157
|
+
user_buried: boolean;
|
|
9158
|
+
user_digged: number;
|
|
9159
|
+
video_list: null;
|
|
9160
|
+
[property: string]: any;
|
|
9161
|
+
};
|
|
9162
|
+
type TextExtra$1 = {
|
|
9163
|
+
end?: number;
|
|
9164
|
+
hashtag_id?: string;
|
|
9165
|
+
hashtag_name?: string;
|
|
9166
|
+
sec_uid?: string;
|
|
9167
|
+
start?: number;
|
|
9168
|
+
type?: number;
|
|
9169
|
+
user_id?: string;
|
|
9170
|
+
[property: string]: any;
|
|
9171
|
+
};
|
|
9172
|
+
type User = {
|
|
9173
|
+
ad_cover_url: null;
|
|
9174
|
+
avatar_schema_list: null;
|
|
9175
|
+
avatar_thumb: AvatarThumb;
|
|
9176
|
+
aweme_control: AwemeControl$1;
|
|
9177
|
+
ban_user_functions: any[] | null;
|
|
9178
|
+
batch_unfollow_contain_tabs: null;
|
|
9179
|
+
batch_unfollow_relation_desc: null;
|
|
9180
|
+
can_set_geofencing: null;
|
|
9181
|
+
card_entries: null;
|
|
9182
|
+
card_entries_not_display: null;
|
|
9183
|
+
card_sort_priority: null;
|
|
9184
|
+
cf_list: null;
|
|
9185
|
+
cha_list: null;
|
|
9186
|
+
close_friend_type: number;
|
|
9187
|
+
comment_setting: number;
|
|
9188
|
+
commerce_user_level: number;
|
|
9189
|
+
contrail_list: null;
|
|
9190
|
+
cover_url: null;
|
|
9191
|
+
creator_tag_list: null;
|
|
9192
|
+
custom_verify: string;
|
|
9193
|
+
data_label_list: null;
|
|
9194
|
+
disable_image_comment_saved: number;
|
|
9195
|
+
display_info: null;
|
|
9196
|
+
endorsement_info_list: null;
|
|
9197
|
+
enterprise_verify_reason: string;
|
|
9198
|
+
familiar_visitor_user: null;
|
|
9199
|
+
follow_status: number;
|
|
9200
|
+
follower_list_secondary_information_struct: null;
|
|
9201
|
+
follower_status: number;
|
|
9202
|
+
geofencing: null;
|
|
9203
|
+
homepage_bottom_toast: null;
|
|
9204
|
+
identity_labels: null;
|
|
9205
|
+
im_role_ids: null;
|
|
9206
|
+
interest_tags: null;
|
|
9207
|
+
is_ad_fake: boolean;
|
|
9208
|
+
is_block: boolean;
|
|
9209
|
+
is_blocked_v2: boolean;
|
|
9210
|
+
is_blocking_v2: boolean;
|
|
9211
|
+
is_star: boolean;
|
|
9212
|
+
item_list: null;
|
|
9213
|
+
link_item_list: null;
|
|
9214
|
+
need_points: null;
|
|
9215
|
+
new_story_cover: null;
|
|
9216
|
+
nickname: string;
|
|
9217
|
+
not_seen_item_id_list: null;
|
|
9218
|
+
not_seen_item_id_list_v2: null;
|
|
9219
|
+
offline_info_list: null;
|
|
9220
|
+
personal_tag_list: null;
|
|
9221
|
+
platform_sync_info: null;
|
|
9222
|
+
private_relation_list: null;
|
|
9223
|
+
profile_component_disabled: null;
|
|
9224
|
+
profile_mob_params: null;
|
|
9225
|
+
region: string;
|
|
9226
|
+
relative_users: null;
|
|
9227
|
+
sec_uid: string;
|
|
9228
|
+
secret: number;
|
|
9229
|
+
short_id: string;
|
|
9230
|
+
signature_extra: null;
|
|
9231
|
+
special_people_labels: null;
|
|
9232
|
+
status: number;
|
|
9233
|
+
text_extra: null;
|
|
9234
|
+
type_label: null;
|
|
9235
|
+
uid: string;
|
|
9236
|
+
unique_id: string;
|
|
9237
|
+
user_canceled: boolean;
|
|
9238
|
+
user_permissions: null;
|
|
9239
|
+
user_tags: null;
|
|
9240
|
+
verification_permission_ids: null;
|
|
9241
|
+
white_cover_url: null;
|
|
9242
|
+
[property: string]: any;
|
|
9243
|
+
};
|
|
9244
|
+
type AvatarThumb = {
|
|
9245
|
+
height: number;
|
|
9246
|
+
uri: string;
|
|
9247
|
+
url_list: string[];
|
|
9248
|
+
width: number;
|
|
9249
|
+
[property: string]: any;
|
|
9250
|
+
};
|
|
9251
|
+
type AwemeControl$1 = {
|
|
9252
|
+
can_comment: boolean;
|
|
9253
|
+
can_forward: boolean;
|
|
9254
|
+
can_share: boolean;
|
|
9255
|
+
can_show_comment: boolean;
|
|
9256
|
+
[property: string]: any;
|
|
9257
|
+
};
|
|
9258
|
+
type Extra = {
|
|
9259
|
+
fatal_item_ids: null;
|
|
9260
|
+
now: number;
|
|
9261
|
+
scenes: null;
|
|
9262
|
+
[property: string]: any;
|
|
9263
|
+
};
|
|
9264
|
+
type LogPb$1 = {
|
|
9265
|
+
impr_id: string;
|
|
9266
|
+
[property: string]: any;
|
|
9267
|
+
};
|
|
9268
|
+
|
|
9117
9269
|
type BiliAv2Bv = {
|
|
9118
9270
|
code: number;
|
|
9119
9271
|
data: Data$e;
|
|
@@ -12688,12 +12840,12 @@ type ThreePointItem$7 = {
|
|
|
12688
12840
|
[property: string]: any;
|
|
12689
12841
|
};
|
|
12690
12842
|
type ModuleStat$7 = {
|
|
12691
|
-
comment: Comment$
|
|
12843
|
+
comment: Comment$7;
|
|
12692
12844
|
forward: Forward$7;
|
|
12693
12845
|
like: Like$7;
|
|
12694
12846
|
[property: string]: any;
|
|
12695
12847
|
};
|
|
12696
|
-
type Comment$
|
|
12848
|
+
type Comment$7 = {
|
|
12697
12849
|
count: number;
|
|
12698
12850
|
forbidden: boolean;
|
|
12699
12851
|
[property: string]: any;
|
|
@@ -12996,12 +13148,12 @@ type ThreePointItem$6 = {
|
|
|
12996
13148
|
[property: string]: any;
|
|
12997
13149
|
};
|
|
12998
13150
|
type ModuleStat$6 = {
|
|
12999
|
-
comment: Comment$
|
|
13151
|
+
comment: Comment$6;
|
|
13000
13152
|
forward: Forward$6;
|
|
13001
13153
|
like: Like$6;
|
|
13002
13154
|
[property: string]: any;
|
|
13003
13155
|
};
|
|
13004
|
-
type Comment$
|
|
13156
|
+
type Comment$6 = {
|
|
13005
13157
|
count: number;
|
|
13006
13158
|
forbidden: boolean;
|
|
13007
13159
|
[property: string]: any;
|
|
@@ -13277,12 +13429,12 @@ type Params$3 = {
|
|
|
13277
13429
|
[property: string]: any;
|
|
13278
13430
|
};
|
|
13279
13431
|
type ModuleStat$5 = {
|
|
13280
|
-
comment: Comment$
|
|
13432
|
+
comment: Comment$5;
|
|
13281
13433
|
forward: Forward$5;
|
|
13282
13434
|
like: Like$5;
|
|
13283
13435
|
[property: string]: any;
|
|
13284
13436
|
};
|
|
13285
|
-
type Comment$
|
|
13437
|
+
type Comment$5 = {
|
|
13286
13438
|
count: number;
|
|
13287
13439
|
forbidden: boolean;
|
|
13288
13440
|
[property: string]: any;
|
|
@@ -13811,12 +13963,12 @@ type Params$2 = {
|
|
|
13811
13963
|
[property: string]: any;
|
|
13812
13964
|
};
|
|
13813
13965
|
type ModuleStat$4 = {
|
|
13814
|
-
comment: Comment$
|
|
13966
|
+
comment: Comment$4;
|
|
13815
13967
|
forward: Forward$4;
|
|
13816
13968
|
like: Like$4;
|
|
13817
13969
|
[property: string]: any;
|
|
13818
13970
|
};
|
|
13819
|
-
type Comment$
|
|
13971
|
+
type Comment$4 = {
|
|
13820
13972
|
count: number;
|
|
13821
13973
|
forbidden: boolean;
|
|
13822
13974
|
[property: string]: any;
|
|
@@ -14348,12 +14500,12 @@ type Params$1 = {
|
|
|
14348
14500
|
[property: string]: any;
|
|
14349
14501
|
};
|
|
14350
14502
|
type ModuleStat$3 = {
|
|
14351
|
-
comment: Comment$
|
|
14503
|
+
comment: Comment$3;
|
|
14352
14504
|
forward: Forward$3;
|
|
14353
14505
|
like: Like$3;
|
|
14354
14506
|
[property: string]: any;
|
|
14355
14507
|
};
|
|
14356
|
-
type Comment$
|
|
14508
|
+
type Comment$3 = {
|
|
14357
14509
|
count: number;
|
|
14358
14510
|
forbidden: boolean;
|
|
14359
14511
|
[property: string]: any;
|
|
@@ -14828,12 +14980,12 @@ type Params = {
|
|
|
14828
14980
|
[property: string]: any;
|
|
14829
14981
|
};
|
|
14830
14982
|
type ModuleStat$2 = {
|
|
14831
|
-
comment: Comment$
|
|
14983
|
+
comment: Comment$2;
|
|
14832
14984
|
forward: Forward$2;
|
|
14833
14985
|
like: Like$2;
|
|
14834
14986
|
[property: string]: any;
|
|
14835
14987
|
};
|
|
14836
|
-
type Comment$
|
|
14988
|
+
type Comment$2 = {
|
|
14837
14989
|
count: number;
|
|
14838
14990
|
forbidden: boolean;
|
|
14839
14991
|
[property: string]: any;
|
|
@@ -15388,12 +15540,12 @@ type ThreePointItem$1 = {
|
|
|
15388
15540
|
[property: string]: any;
|
|
15389
15541
|
};
|
|
15390
15542
|
type ModuleStat$1 = {
|
|
15391
|
-
comment: Comment$
|
|
15543
|
+
comment: Comment$1;
|
|
15392
15544
|
forward: Forward$1;
|
|
15393
15545
|
like: Like$1;
|
|
15394
15546
|
[property: string]: any;
|
|
15395
15547
|
};
|
|
15396
|
-
type Comment$
|
|
15548
|
+
type Comment$1 = {
|
|
15397
15549
|
count: number;
|
|
15398
15550
|
forbidden: boolean;
|
|
15399
15551
|
hidden: boolean;
|
|
@@ -15716,12 +15868,12 @@ type ThreePointItem = {
|
|
|
15716
15868
|
[property: string]: any;
|
|
15717
15869
|
};
|
|
15718
15870
|
type ModuleStat = {
|
|
15719
|
-
comment: Comment
|
|
15871
|
+
comment: Comment;
|
|
15720
15872
|
forward: Forward;
|
|
15721
15873
|
like: Like;
|
|
15722
15874
|
[property: string]: any;
|
|
15723
15875
|
};
|
|
15724
|
-
type Comment
|
|
15876
|
+
type Comment = {
|
|
15725
15877
|
count: number;
|
|
15726
15878
|
forbidden: boolean;
|
|
15727
15879
|
[property: string]: any;
|
|
@@ -16756,7 +16908,7 @@ type SubComment = {
|
|
|
16756
16908
|
|
|
16757
16909
|
type DyTextWork = {
|
|
16758
16910
|
aweme_detail: AwemeDetail;
|
|
16759
|
-
log_pb: LogPb
|
|
16911
|
+
log_pb: LogPb;
|
|
16760
16912
|
status_code: number;
|
|
16761
16913
|
[property: string]: any;
|
|
16762
16914
|
};
|
|
@@ -16768,7 +16920,7 @@ type AwemeDetail = {
|
|
|
16768
16920
|
author_mask_tag: number;
|
|
16769
16921
|
author_user_id: number;
|
|
16770
16922
|
aweme_acl: Awemeacl;
|
|
16771
|
-
aweme_control: AwemeControl
|
|
16923
|
+
aweme_control: AwemeControl;
|
|
16772
16924
|
aweme_id: string;
|
|
16773
16925
|
aweme_listen_struct: AwemeListenStruct;
|
|
16774
16926
|
aweme_type: number;
|
|
@@ -16894,7 +17046,7 @@ type AwemeDetail = {
|
|
|
16894
17046
|
statistics: Statistics;
|
|
16895
17047
|
status: Status;
|
|
16896
17048
|
suggest_words: SuggestWords;
|
|
16897
|
-
text_extra: TextExtra
|
|
17049
|
+
text_extra: TextExtra[];
|
|
16898
17050
|
trends_event_track: string;
|
|
16899
17051
|
uniqid_position: null;
|
|
16900
17052
|
user_digged: number;
|
|
@@ -17012,7 +17164,7 @@ type DownloadMaskPanel = {
|
|
|
17012
17164
|
show_type: number;
|
|
17013
17165
|
[property: string]: any;
|
|
17014
17166
|
};
|
|
17015
|
-
type AwemeControl
|
|
17167
|
+
type AwemeControl = {
|
|
17016
17168
|
can_comment: boolean;
|
|
17017
17169
|
can_forward: boolean;
|
|
17018
17170
|
can_share: boolean;
|
|
@@ -17353,7 +17505,7 @@ type Word = {
|
|
|
17353
17505
|
word_id: string;
|
|
17354
17506
|
[property: string]: any;
|
|
17355
17507
|
};
|
|
17356
|
-
type TextExtra
|
|
17508
|
+
type TextExtra = {
|
|
17357
17509
|
caption_end: number;
|
|
17358
17510
|
caption_start: number;
|
|
17359
17511
|
end: number;
|
|
@@ -17472,7 +17624,7 @@ type XiguaBaseInfo = {
|
|
|
17472
17624
|
status: number;
|
|
17473
17625
|
[property: string]: any;
|
|
17474
17626
|
};
|
|
17475
|
-
type LogPb
|
|
17627
|
+
type LogPb = {
|
|
17476
17628
|
impr_id: string;
|
|
17477
17629
|
[property: string]: any;
|
|
17478
17630
|
};
|
|
@@ -17573,158 +17725,6 @@ declare const validateXiaohongshuParams: <T extends XiaohongshuMethodType>(metho
|
|
|
17573
17725
|
note_type?: string | undefined;
|
|
17574
17726
|
};
|
|
17575
17727
|
|
|
17576
|
-
type CommentReply = {
|
|
17577
|
-
comments: Comment[];
|
|
17578
|
-
cursor: number;
|
|
17579
|
-
extra: Extra;
|
|
17580
|
-
has_more: number;
|
|
17581
|
-
log_pb: LogPb;
|
|
17582
|
-
status_code: number;
|
|
17583
|
-
total: number;
|
|
17584
|
-
[property: string]: any;
|
|
17585
|
-
};
|
|
17586
|
-
type Comment = {
|
|
17587
|
-
aweme_id: string;
|
|
17588
|
-
can_share: boolean;
|
|
17589
|
-
cid: string;
|
|
17590
|
-
comment_reply_total: number;
|
|
17591
|
-
content_type: number;
|
|
17592
|
-
create_time: number;
|
|
17593
|
-
digg_count: number;
|
|
17594
|
-
image_list: null;
|
|
17595
|
-
ip_label: string;
|
|
17596
|
-
is_author_digged: boolean;
|
|
17597
|
-
is_folded: boolean;
|
|
17598
|
-
is_hot: boolean;
|
|
17599
|
-
is_note_comment: number;
|
|
17600
|
-
label_list: null;
|
|
17601
|
-
label_text: string;
|
|
17602
|
-
label_type: number;
|
|
17603
|
-
level: number;
|
|
17604
|
-
reply_comment: null;
|
|
17605
|
-
reply_id: string;
|
|
17606
|
-
reply_to_reply_id: string;
|
|
17607
|
-
reply_to_user_sec_id: string;
|
|
17608
|
-
reply_to_userid: string;
|
|
17609
|
-
reply_to_username: string;
|
|
17610
|
-
root_comment_id: string;
|
|
17611
|
-
status: number;
|
|
17612
|
-
text: string;
|
|
17613
|
-
text_extra: TextExtra[];
|
|
17614
|
-
text_music_info: null;
|
|
17615
|
-
user: User;
|
|
17616
|
-
user_buried: boolean;
|
|
17617
|
-
user_digged: number;
|
|
17618
|
-
video_list: null;
|
|
17619
|
-
[property: string]: any;
|
|
17620
|
-
};
|
|
17621
|
-
type TextExtra = {
|
|
17622
|
-
end?: number;
|
|
17623
|
-
hashtag_id?: string;
|
|
17624
|
-
hashtag_name?: string;
|
|
17625
|
-
sec_uid?: string;
|
|
17626
|
-
start?: number;
|
|
17627
|
-
type?: number;
|
|
17628
|
-
user_id?: string;
|
|
17629
|
-
[property: string]: any;
|
|
17630
|
-
};
|
|
17631
|
-
type User = {
|
|
17632
|
-
ad_cover_url: null;
|
|
17633
|
-
avatar_schema_list: null;
|
|
17634
|
-
avatar_thumb: AvatarThumb;
|
|
17635
|
-
aweme_control: AwemeControl;
|
|
17636
|
-
ban_user_functions: any[] | null;
|
|
17637
|
-
batch_unfollow_contain_tabs: null;
|
|
17638
|
-
batch_unfollow_relation_desc: null;
|
|
17639
|
-
can_set_geofencing: null;
|
|
17640
|
-
card_entries: null;
|
|
17641
|
-
card_entries_not_display: null;
|
|
17642
|
-
card_sort_priority: null;
|
|
17643
|
-
cf_list: null;
|
|
17644
|
-
cha_list: null;
|
|
17645
|
-
close_friend_type: number;
|
|
17646
|
-
comment_setting: number;
|
|
17647
|
-
commerce_user_level: number;
|
|
17648
|
-
contrail_list: null;
|
|
17649
|
-
cover_url: null;
|
|
17650
|
-
creator_tag_list: null;
|
|
17651
|
-
custom_verify: string;
|
|
17652
|
-
data_label_list: null;
|
|
17653
|
-
disable_image_comment_saved: number;
|
|
17654
|
-
display_info: null;
|
|
17655
|
-
endorsement_info_list: null;
|
|
17656
|
-
enterprise_verify_reason: string;
|
|
17657
|
-
familiar_visitor_user: null;
|
|
17658
|
-
follow_status: number;
|
|
17659
|
-
follower_list_secondary_information_struct: null;
|
|
17660
|
-
follower_status: number;
|
|
17661
|
-
geofencing: null;
|
|
17662
|
-
homepage_bottom_toast: null;
|
|
17663
|
-
identity_labels: null;
|
|
17664
|
-
im_role_ids: null;
|
|
17665
|
-
interest_tags: null;
|
|
17666
|
-
is_ad_fake: boolean;
|
|
17667
|
-
is_block: boolean;
|
|
17668
|
-
is_blocked_v2: boolean;
|
|
17669
|
-
is_blocking_v2: boolean;
|
|
17670
|
-
is_star: boolean;
|
|
17671
|
-
item_list: null;
|
|
17672
|
-
link_item_list: null;
|
|
17673
|
-
need_points: null;
|
|
17674
|
-
new_story_cover: null;
|
|
17675
|
-
nickname: string;
|
|
17676
|
-
not_seen_item_id_list: null;
|
|
17677
|
-
not_seen_item_id_list_v2: null;
|
|
17678
|
-
offline_info_list: null;
|
|
17679
|
-
personal_tag_list: null;
|
|
17680
|
-
platform_sync_info: null;
|
|
17681
|
-
private_relation_list: null;
|
|
17682
|
-
profile_component_disabled: null;
|
|
17683
|
-
profile_mob_params: null;
|
|
17684
|
-
region: string;
|
|
17685
|
-
relative_users: null;
|
|
17686
|
-
sec_uid: string;
|
|
17687
|
-
secret: number;
|
|
17688
|
-
short_id: string;
|
|
17689
|
-
signature_extra: null;
|
|
17690
|
-
special_people_labels: null;
|
|
17691
|
-
status: number;
|
|
17692
|
-
text_extra: null;
|
|
17693
|
-
type_label: null;
|
|
17694
|
-
uid: string;
|
|
17695
|
-
unique_id: string;
|
|
17696
|
-
user_canceled: boolean;
|
|
17697
|
-
user_permissions: null;
|
|
17698
|
-
user_tags: null;
|
|
17699
|
-
verification_permission_ids: null;
|
|
17700
|
-
white_cover_url: null;
|
|
17701
|
-
[property: string]: any;
|
|
17702
|
-
};
|
|
17703
|
-
type AvatarThumb = {
|
|
17704
|
-
height: number;
|
|
17705
|
-
uri: string;
|
|
17706
|
-
url_list: string[];
|
|
17707
|
-
width: number;
|
|
17708
|
-
[property: string]: any;
|
|
17709
|
-
};
|
|
17710
|
-
type AwemeControl = {
|
|
17711
|
-
can_comment: boolean;
|
|
17712
|
-
can_forward: boolean;
|
|
17713
|
-
can_share: boolean;
|
|
17714
|
-
can_show_comment: boolean;
|
|
17715
|
-
[property: string]: any;
|
|
17716
|
-
};
|
|
17717
|
-
type Extra = {
|
|
17718
|
-
fatal_item_ids: null;
|
|
17719
|
-
now: number;
|
|
17720
|
-
scenes: null;
|
|
17721
|
-
[property: string]: any;
|
|
17722
|
-
};
|
|
17723
|
-
type LogPb = {
|
|
17724
|
-
impr_id: string;
|
|
17725
|
-
[property: string]: any;
|
|
17726
|
-
};
|
|
17727
|
-
|
|
17728
17728
|
/**
|
|
17729
17729
|
* 移除methodType字段的工具类型
|
|
17730
17730
|
*/
|
|
@@ -20565,11 +20565,6 @@ declare const logMiddleware: (pathsToLog?: string[]) => RequestHandler;
|
|
|
20565
20565
|
* @returns 响应数据
|
|
20566
20566
|
*/
|
|
20567
20567
|
declare const fetchData: <T = any>(config: AxiosRequestConfig) => Promise<T>;
|
|
20568
|
-
/**
|
|
20569
|
-
* 执行网络请求并返回完整响应对象
|
|
20570
|
-
* @param config - axios请求配置
|
|
20571
|
-
* @returns axios响应对象
|
|
20572
|
-
*/
|
|
20573
20568
|
declare const fetchResponse: <T = unknown>(config: AxiosRequestConfig) => Promise<AxiosResponse<T>>;
|
|
20574
20569
|
/**
|
|
20575
20570
|
* 获取响应头和数据
|
|
@@ -20577,7 +20572,7 @@ declare const fetchResponse: <T = unknown>(config: AxiosRequestConfig) => Promis
|
|
|
20577
20572
|
* @returns 包含headers和data的对象
|
|
20578
20573
|
*/
|
|
20579
20574
|
declare const getHeadersAndData: <T = any>(config: AxiosRequestConfig) => Promise<{
|
|
20580
|
-
headers:
|
|
20575
|
+
headers: RawAxiosResponseHeaders;
|
|
20581
20576
|
data: T;
|
|
20582
20577
|
}>;
|
|
20583
20578
|
|
|
@@ -21117,4 +21112,4 @@ declare const CreateApp: AmagiConstructor;
|
|
|
21117
21112
|
declare const Client: AmagiConstructor;
|
|
21118
21113
|
declare const amagi: AmagiConstructor;
|
|
21119
21114
|
|
|
21120
|
-
export { type APIErrorType, AdditionalType, ApiError, type ApiResponse, type BaseResponse, type BiliAv2Bv, type BiliBangumiVideoInfo, type BiliBangumiVideoPlayurlIsLogin, type BiliBangumiVideoPlayurlNoLogin, type BiliBiliVideoPlayurlNoLogin, type BiliBv2AV, type BiliCheckQrcode, type BiliDynamicCard, type BiliDynamicInfo, type BiliDynamicInfoUnion, type BiliEmojiList, type BiliLiveRoomDef, type BiliLiveRoomDetail, type BiliNewLoginQrcode, type BiliOneWork, type BiliUserDynamic, type BiliUserFullView, type BiliUserProfile, type BiliVideoPlayurlIsLogin, type BiliWorkComments, type BilibiliAv2BvParams, BilibiliAv2BvParamsSchema, type BilibiliBangumiInfoParams, BilibiliBangumiInfoParamsSchema, type BilibiliBangumiStreamParams, BilibiliBangumiStreamParamsSchema, type BilibiliBv2AvParams, BilibiliBv2AvParamsSchema, type BilibiliCommentParams, BilibiliCommentParamsSchema, type BilibiliDataOptions, type BilibiliDataOptionsMap, type BilibiliDynamicParams, BilibiliDynamicParamsSchema, type BilibiliEmojiParams, BilibiliEmojiParamsSchema, type BilibiliLiveParams, BilibiliLiveParamsSchema, type BilibiliLoginParams, BilibiliLoginParamsSchema, type BilibiliMethodOptionsMap, type BilibiliMethodType, type BilibiliQrcodeParams, BilibiliQrcodeParamsSchema, type BilibiliQrcodeStatusParams, BilibiliQrcodeStatusParamsSchema, type BilibiliUserParams, BilibiliUserParamsSchema, BilibiliValidationSchemas, type BilibiliVideoDownloadParams, BilibiliVideoDownloadParamsSchema, type BilibiliVideoParams, BilibiliVideoParamsSchema, type BoundBilibiliApi, type BoundDouyinApi, type BoundKuaishouApi, type BoundXiaohongshuApi, type CookieConfig, CreateApp, type DouyinCommentParams, DouyinCommentParamsSchema, type DouyinCommentReplyParams, DouyinCommentReplyParamsSchema, type DouyinDanmakuParams, DouyinDanmakuParamsSchema, type DouyinDataOptions, type DouyinDataOptionsMap, type DouyinEmojiListParams, DouyinEmojiListParamsSchema, type DouyinEmojiProParams, DouyinEmojiProParamsSchema, type DouyinLiveRoomParams, type DouyinMethodOptionsMap, type DouyinMethodType, type DouyinMusicParams, DouyinMusicParamsSchema, type DouyinQrcodeParams, DouyinQrcodeParamsSchema, type DouyinSearchParams, DouyinSearchParamsSchema, type DouyinUserParams, DouyinUserParamsSchema, DouyinValidationSchemas, type DouyinWorkParams, DouyinWorkParamsSchema, type DyDanmakuList, type DyEmojiList, type DyEmojiProList, type DyImageAlbumWork, type DyMusicWork, type DySearchInfo, type DySlidesWork, type DySuggestWords, type DyUserInfo, type DyUserLiveVideos, type DyUserPostVideos, type DyVideoWork, type DyWorkComments, DynamicType, type DynamicTypeAV$1 as DynamicTypeAV, type DynamicTypeDraw$1 as DynamicTypeDraw, type DynamicTypeForward, type DynamicTypeForwardUnion, type DynamicTypeLiveRcmd, type DynamicTypeWord, type ErrorResponse, type KsEmojiList, type KsOneWork, type KsWorkComments, type KuaishouCommentParams, KuaishouCommentParamsSchema, type KuaishouDataOptions, type KuaishouDataOptionsMap, type KuaishouEmojiParams, KuaishouEmojiParamsSchema, type KuaishouMethodOptionsMap, type KuaishouMethodType, KuaishouValidationSchemas, type KuaishouVideoParams, KuaishouVideoParamsSchema, MajorType, type NetworksConfigType, type OmitMethodType, type Options, type RequestConfig, type SuccessResponse, type TypeControl, ValidationError, type XiaohongshuDataOptions, type XiaohongshuDataOptionsMap, type XiaohongshuMethodType, XiaohongshuValidationSchemas, amagi, amagiClient, av2bv, bilibili, bilibiliApiUrls, bilibiliErrorCodeMap, bilibiliUtils, bv2av, createAmagiClient, createBilibiliRoutes, createBoundBilibiliApi, createBoundDouyinApi, createBoundKuaishouApi, createBoundXiaohongshuApi, createDouyinRoutes, createErrorResponse, createKuaishouRoutes, createSuccessResponse, createXiaohongshuRoutes, Client as default, douyin, douyinApiUrls, douyinSign, douyinUtils, fetchData, fetchResponse, getBilibiliData, getDouyinData, getHeadersAndData, getKuaishouData, handleError, httpLogger, kuaishou, kuaishouApiUrls, kuaishouUtils, logMiddleware, logger, qtparam, createBilibiliRoutes as registerBilibiliRoutes, createDouyinRoutes as registerDouyinRoutes, createKuaishouRoutes as registerKuaishouRoutes, createXiaohongshuRoutes as registerXiaohongshuRoutes, validateBilibiliParams, validateDouyinParams, validateKuaishouParams, validateXiaohongshuParams, wbi_sign, xiaohongshu, xiaohongshuApiUrls, xiaohongshuSign, xiaohongshuUtils };
|
|
21115
|
+
export { type APIErrorType, AdditionalType, ApiError, type ApiResponse, type BaseResponse, type BiliAv2Bv, type BiliBangumiVideoInfo, type BiliBangumiVideoPlayurlIsLogin, type BiliBangumiVideoPlayurlNoLogin, type BiliBiliVideoPlayurlNoLogin, type BiliBv2AV, type BiliCheckQrcode, type BiliDynamicCard, type BiliDynamicInfo, type BiliDynamicInfoUnion, type BiliEmojiList, type BiliLiveRoomDef, type BiliLiveRoomDetail, type BiliNewLoginQrcode, type BiliOneWork, type BiliUserDynamic, type BiliUserFullView, type BiliUserProfile, type BiliVideoPlayurlIsLogin, type BiliWorkComments, type BilibiliAv2BvParams, BilibiliAv2BvParamsSchema, type BilibiliBangumiInfoParams, BilibiliBangumiInfoParamsSchema, type BilibiliBangumiStreamParams, BilibiliBangumiStreamParamsSchema, type BilibiliBv2AvParams, BilibiliBv2AvParamsSchema, type BilibiliCommentParams, BilibiliCommentParamsSchema, type BilibiliDataOptions, type BilibiliDataOptionsMap, type BilibiliDynamicParams, BilibiliDynamicParamsSchema, type BilibiliEmojiParams, BilibiliEmojiParamsSchema, type BilibiliLiveParams, BilibiliLiveParamsSchema, type BilibiliLoginParams, BilibiliLoginParamsSchema, type BilibiliMethodOptionsMap, type BilibiliMethodType, type BilibiliQrcodeParams, BilibiliQrcodeParamsSchema, type BilibiliQrcodeStatusParams, BilibiliQrcodeStatusParamsSchema, type BilibiliUserParams, BilibiliUserParamsSchema, BilibiliValidationSchemas, type BilibiliVideoDownloadParams, BilibiliVideoDownloadParamsSchema, type BilibiliVideoParams, BilibiliVideoParamsSchema, type BoundBilibiliApi, type BoundDouyinApi, type BoundKuaishouApi, type BoundXiaohongshuApi, type CommentReply, type CookieConfig, CreateApp, type DouyinCommentParams, DouyinCommentParamsSchema, type DouyinCommentReplyParams, DouyinCommentReplyParamsSchema, type DouyinDanmakuParams, DouyinDanmakuParamsSchema, type DouyinDataOptions, type DouyinDataOptionsMap, type DouyinEmojiListParams, DouyinEmojiListParamsSchema, type DouyinEmojiProParams, DouyinEmojiProParamsSchema, type DouyinLiveRoomParams, type DouyinMethodOptionsMap, type DouyinMethodType, type DouyinMusicParams, DouyinMusicParamsSchema, type DouyinQrcodeParams, DouyinQrcodeParamsSchema, type DouyinSearchParams, DouyinSearchParamsSchema, type DouyinUserParams, DouyinUserParamsSchema, DouyinValidationSchemas, type DouyinWorkParams, DouyinWorkParamsSchema, type DyDanmakuList, type DyEmojiList, type DyEmojiProList, type DyImageAlbumWork, type DyMusicWork, type DySearchInfo, type DySlidesWork, type DySuggestWords, type DyUserInfo, type DyUserLiveVideos, type DyUserPostVideos, type DyVideoWork, type DyWorkComments, DynamicType, type DynamicTypeAV$1 as DynamicTypeAV, type DynamicTypeDraw$1 as DynamicTypeDraw, type DynamicTypeForward, type DynamicTypeForwardUnion, type DynamicTypeLiveRcmd, type DynamicTypeWord, type ErrorResponse, type KsEmojiList, type KsOneWork, type KsWorkComments, type KuaishouCommentParams, KuaishouCommentParamsSchema, type KuaishouDataOptions, type KuaishouDataOptionsMap, type KuaishouEmojiParams, KuaishouEmojiParamsSchema, type KuaishouMethodOptionsMap, type KuaishouMethodType, KuaishouValidationSchemas, type KuaishouVideoParams, KuaishouVideoParamsSchema, MajorType, type NetworksConfigType, type OmitMethodType, type Options, type RequestConfig, type SuccessResponse, type TypeControl, ValidationError, type XiaohongshuDataOptions, type XiaohongshuDataOptionsMap, type XiaohongshuMethodType, XiaohongshuValidationSchemas, amagi, amagiClient, av2bv, bilibili, bilibiliApiUrls, bilibiliErrorCodeMap, bilibiliUtils, bv2av, createAmagiClient, createBilibiliRoutes, createBoundBilibiliApi, createBoundDouyinApi, createBoundKuaishouApi, createBoundXiaohongshuApi, createDouyinRoutes, createErrorResponse, createKuaishouRoutes, createSuccessResponse, createXiaohongshuRoutes, Client as default, douyin, douyinApiUrls, douyinSign, douyinUtils, fetchData, fetchResponse, getBilibiliData, getDouyinData, getHeadersAndData, getKuaishouData, handleError, httpLogger, kuaishou, kuaishouApiUrls, kuaishouUtils, logMiddleware, logger, qtparam, createBilibiliRoutes as registerBilibiliRoutes, createDouyinRoutes as registerDouyinRoutes, createKuaishouRoutes as registerKuaishouRoutes, createXiaohongshuRoutes as registerXiaohongshuRoutes, validateBilibiliParams, validateDouyinParams, validateKuaishouParams, validateXiaohongshuParams, wbi_sign, xiaohongshu, xiaohongshuApiUrls, xiaohongshuSign, xiaohongshuUtils };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikenxuan/amagi",
|
|
3
|
-
"version": "5.6.
|
|
3
|
+
"version": "5.6.3",
|
|
4
4
|
"description": "抖音、B站的 web 端相关数据接口基于 Node.js 的实现",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"douyin",
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
73
|
"@ikenxuan/xhshow-ts": "^1.0.0",
|
|
74
|
-
"axios": "
|
|
74
|
+
"axios": "^1.12.2",
|
|
75
75
|
"chalk": "5.6.2",
|
|
76
76
|
"express": "npm:@karinjs/express@^1.0.3",
|
|
77
77
|
"log4js": "npm:@karinjs/log4js@1.1.4",
|