@ikenxuan/amagi 4.4.16 → 4.4.18
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 +46 -46
- package/dist/default/cjs/index.cjs +142 -74
- package/dist/default/esm/index.mjs +143 -75
- package/dist/default/index.d.ts +169 -6
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,68 +1,75 @@
|
|
|
1
|
-
# amagi
|
|
1
|
+
# amagi
|
|
2
2
|
|
|
3
3
|
抖音、bilibili 的 web 端相关数据接口基于 Node.js 的实现。支持最低 node 版本为 v18 🚀
|
|
4
4
|
|
|
5
5
|
## 我是真爱粉 🧩
|
|
6
6
|
|
|
7
|
-
"amagi" /ˈæmədʒi/
|
|
7
|
+
"amagi" /ˈæmədʒi/ 名称灵感来源于网络谐音梗,在网络上 [BV1St41137jm](https://www.bilibili.com/video/BV1St41137jm) / [BV1DL411X7jE](https://www.bilibili.com/video/BV1DL411X7jE) 上广泛传播。🎤💃
|
|
8
8
|
|
|
9
|
-
此生必看 [BV1DL411X7jE](https://www.bilibili.com/video/BV1DL411X7jE)
|
|
10
9
|
|
|
11
10
|
## 项目简介 📝
|
|
12
11
|
|
|
13
12
|
本项目最初的代码从 [kkkkkk-10086](https://github.com/ikenxuan/kkkkkk-10086) 抽离。主要负责相关数据接口的封装。
|
|
14
13
|
|
|
15
|
-
amagi 将作为一个独立的上游模块,提供给下游 [karin-plugin-kkk](https://github.com/ikenxuan/karin-plugin-kkk) 和 [kkkkkk-10086](https://github.com/ikenxuan/kkkkkk-10086)
|
|
14
|
+
amagi 将作为一个独立的上游模块,提供给下游 [karin-plugin-kkk](https://github.com/ikenxuan/karin-plugin-kkk) 和 [kkkkkk-10086](https://github.com/ikenxuan/kkkkkk-10086) 进行视频解析相关业务使用。这两个项目已完成了几乎所有由 ikenxuan 安排的功能和任务,所以它们如果没有什么新的业务需求,本项目大概再也不会封装新的任何接口。
|
|
16
15
|
|
|
17
|
-
当然,如果你的下游有新的业务需求,欢迎提 issue 或 pr
|
|
16
|
+
当然,如果你的下游有新的业务需求,欢迎提 issue 或 pr。(作者本人很菜,issue 不一定能解决)
|
|
18
17
|
|
|
19
|
-
##
|
|
18
|
+
## 安装/更新 📦
|
|
20
19
|
|
|
21
20
|
```bash
|
|
22
21
|
pnpm add @ikenxuan/amagi@latest
|
|
23
22
|
```
|
|
24
23
|
|
|
25
|
-
##
|
|
24
|
+
## 快速开始 🚀
|
|
26
25
|
|
|
27
26
|
### 基本用法 ✨
|
|
27
|
+
主要就两个方法,`getDouyinData` 和 `getBilibiliData`。
|
|
28
|
+
|
|
29
|
+
> 它接收三个参数,
|
|
30
|
+
> * 第一个参数是对应平台封装好的数据接口名称
|
|
31
|
+
> * 第二个参数是接口所需的参数
|
|
32
|
+
> * 第三个参数是用户的 cookies。
|
|
33
|
+
> * 得益于函数重载,参数二和参数三可以互换位置
|
|
34
|
+
|
|
35
|
+
你可以通过直接导入或者构造器创建实例。
|
|
36
|
+
若通过构造器创建实例,就不需要传入 cookies 参数了,参数二默认接口所需参数。
|
|
28
37
|
|
|
29
38
|
```javascript
|
|
30
39
|
import Client from '@ikenxuan/amagi'
|
|
40
|
+
// or
|
|
41
|
+
// import { getDouyinData, getBilibiliData } from '@ikenxuan/amagi'
|
|
31
42
|
|
|
32
|
-
//
|
|
33
|
-
const amagi =
|
|
34
|
-
|
|
35
|
-
bilibili: '', // B站 cookie(可选)
|
|
36
|
-
})
|
|
43
|
+
// you can use it as a class/function/object
|
|
44
|
+
const amagi = Client({...options})
|
|
45
|
+
const amagi = new Client({...options})
|
|
37
46
|
|
|
38
47
|
// 使用示例
|
|
39
48
|
async function example() {
|
|
40
49
|
// 获取抖音搜索数据
|
|
41
|
-
const searchData = await amagi.getDouyinData(
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
50
|
+
const searchData = await amagi.getDouyinData(
|
|
51
|
+
'搜索数据',
|
|
52
|
+
{ ...opt }
|
|
53
|
+
)
|
|
45
54
|
|
|
46
55
|
// 获取B站视频数据
|
|
47
|
-
const videoData = await amagi.getBilibiliData(
|
|
48
|
-
|
|
49
|
-
|
|
56
|
+
const videoData = await amagi.getBilibiliData(
|
|
57
|
+
'单个视频作品数据',
|
|
58
|
+
{ ...opt }
|
|
59
|
+
)
|
|
50
60
|
|
|
51
61
|
console.log(searchData)
|
|
52
62
|
}
|
|
53
63
|
|
|
54
64
|
example()
|
|
55
65
|
```
|
|
56
|
-
|
|
66
|
+
## Advanced
|
|
57
67
|
### 启动本地 HTTP 服务 🌐
|
|
58
68
|
|
|
59
69
|
```javascript
|
|
60
70
|
import Client from '@ikenxuan/amagi'
|
|
61
71
|
|
|
62
|
-
const amagi = new Client({
|
|
63
|
-
douyin: '你的抖音cookie',
|
|
64
|
-
bilibili: '你的B站cookie',
|
|
65
|
-
})
|
|
72
|
+
const amagi = new Client({...options})
|
|
66
73
|
|
|
67
74
|
// 启动本地服务,默认端口 4567
|
|
68
75
|
const app = amagi.startClient()
|
|
@@ -95,24 +102,20 @@ const abSign = douyinUtils.sign.AB('需要签名的地址')
|
|
|
95
102
|
|
|
96
103
|
// 使用 API 接口
|
|
97
104
|
const videoData = await douyinUtils.api.getWorkInfo(
|
|
98
|
-
{
|
|
99
|
-
|
|
100
|
-
},
|
|
101
|
-
'有效的用户 Cookie'
|
|
105
|
+
{ ...opt },
|
|
106
|
+
'cookies'
|
|
102
107
|
)
|
|
103
108
|
|
|
104
109
|
const userInfo = await douyinUtils.api.getUserProfile(
|
|
105
|
-
{
|
|
106
|
-
|
|
107
|
-
},
|
|
108
|
-
'有效的用户 Cookie'
|
|
110
|
+
{ ...opt },
|
|
111
|
+
'cookies'
|
|
109
112
|
)
|
|
110
113
|
|
|
111
114
|
// 直接获取数据
|
|
112
|
-
const searchResult = await douyinUtils.getDouyinData(
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
const searchResult = await douyinUtils.getDouyinData(
|
|
116
|
+
'搜索数据',
|
|
117
|
+
{ ...opt }
|
|
118
|
+
)
|
|
116
119
|
```
|
|
117
120
|
|
|
118
121
|
主要功能:
|
|
@@ -133,20 +136,16 @@ bilibili 相关功能模块提供了获取 bilibili 平台数据的工具和 API
|
|
|
133
136
|
import { bilibiliUtils } from '@ikenxuan/amagi'
|
|
134
137
|
|
|
135
138
|
// 获取视频信息
|
|
136
|
-
const videoInfo = await bilibiliUtils.api.getVideoInfo({
|
|
137
|
-
bvid: 'BV1fK4y1q79u',
|
|
138
|
-
})
|
|
139
|
+
const videoInfo = await bilibiliUtils.api.getVideoInfo({ ...opt })
|
|
139
140
|
|
|
140
141
|
// 获取评论数据
|
|
141
|
-
const comments = await bilibiliUtils.api.getComments({
|
|
142
|
-
oid: 111111, // 稿件ID,也就是AV号去除前缀后的内容
|
|
143
|
-
type: 1,
|
|
144
|
-
})
|
|
142
|
+
const comments = await bilibiliUtils.api.getComments({ ...opt })
|
|
145
143
|
|
|
146
144
|
// 直接获取数据
|
|
147
|
-
const userInfo = await bilibiliUtils.getBilibiliData(
|
|
148
|
-
|
|
149
|
-
}
|
|
145
|
+
const userInfo = await bilibiliUtils.getBilibiliData(
|
|
146
|
+
'用户主页数据',
|
|
147
|
+
{ ...opt }
|
|
148
|
+
)
|
|
150
149
|
```
|
|
151
150
|
|
|
152
151
|
主要功能:
|
|
@@ -162,6 +161,7 @@ const userInfo = await bilibiliUtils.getBilibiliData('用户主页数据', {
|
|
|
162
161
|
## 类型支持 🧰
|
|
163
162
|
|
|
164
163
|
该库提供完整的 TypeScript 类型支持,可以获得良好的代码提示和类型检查。✅
|
|
164
|
+
虽有类型但写得和迷宫一样
|
|
165
165
|
|
|
166
166
|
## 许可证 📜
|
|
167
167
|
|
|
@@ -13,7 +13,6 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
13
13
|
var axios__default = /*#__PURE__*/_interopDefault(axios);
|
|
14
14
|
var crypto__default = /*#__PURE__*/_interopDefault(crypto);
|
|
15
15
|
var express__default = /*#__PURE__*/_interopDefault(express);
|
|
16
|
-
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
17
16
|
var log4js__default = /*#__PURE__*/_interopDefault(log4js);
|
|
18
17
|
|
|
19
18
|
// src/platform/bilibili/API.ts
|
|
@@ -474,7 +473,7 @@ var registerBilibiliRoutes = (cookie) => {
|
|
|
474
473
|
}, req.headers.cookie || cookie);
|
|
475
474
|
res.json(data2);
|
|
476
475
|
});
|
|
477
|
-
router.get("/
|
|
476
|
+
router.get("/fetch_emoji_list", async (req, res) => {
|
|
478
477
|
const data2 = await fetchBilibili({
|
|
479
478
|
methodType: "Emoji\u6570\u636E"
|
|
480
479
|
}, req.headers.cookie || cookie);
|
|
@@ -547,7 +546,7 @@ var registerBilibiliRoutes = (cookie) => {
|
|
|
547
546
|
router.get("/av_to_bv", async (req, res) => {
|
|
548
547
|
const data2 = await fetchBilibili({
|
|
549
548
|
methodType: "AV\u8F6CBV",
|
|
550
|
-
avid:
|
|
549
|
+
avid: req.query.avid
|
|
551
550
|
}, req.headers.cookie || cookie);
|
|
552
551
|
res.json(data2);
|
|
553
552
|
});
|
|
@@ -835,44 +834,66 @@ var fetchBilibili = async (data2, cookie) => {
|
|
|
835
834
|
}
|
|
836
835
|
};
|
|
837
836
|
var GlobalGetData = async (options) => {
|
|
837
|
+
let warningMessage = "";
|
|
838
838
|
try {
|
|
839
839
|
const result = await new Networks(options).getData();
|
|
840
|
-
if (result
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
\
|
|
840
|
+
if (!result || result === "") {
|
|
841
|
+
const Err = {
|
|
842
|
+
errorDescription: "\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u63A5\u53E3\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u4F60\u7684B\u7AD9ck\u53EF\u80FD\u5DF2\u7ECF\u5931\u6548\uFF01",
|
|
843
|
+
requestType: options.methodType ?? "\u672A\u77E5\u8BF7\u6C42\u7C7B\u578B",
|
|
844
|
+
requestUrl: options.url
|
|
845
|
+
};
|
|
846
|
+
warningMessage = `
|
|
847
|
+
\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u539F\u56E0\uFF1A${logger.yellow("\u63A5\u53E3\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u4F60\u7684B\u7AD9ck\u53EF\u80FD\u5DF2\u7ECF\u5931\u6548\uFF01")}
|
|
848
|
+
\u8BF7\u6C42\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
849
|
+
\u8BF7\u6C42URL\uFF1A${options.url}
|
|
850
|
+
`;
|
|
848
851
|
logger.warn(warningMessage);
|
|
849
852
|
throw {
|
|
850
|
-
|
|
851
|
-
|
|
853
|
+
code: "-352" /* RISK_CONTROL_FAILED */,
|
|
854
|
+
data: result,
|
|
855
|
+
amagiError: Err
|
|
852
856
|
};
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
const
|
|
856
|
-
|
|
857
|
-
\
|
|
858
|
-
\
|
|
859
|
-
|
|
857
|
+
}
|
|
858
|
+
if (result.code !== 0) {
|
|
859
|
+
const errorMessage = bilibiliErrorCodeMap[result.code] || result.message || "\u672A\u77E5\u9519\u8BEF";
|
|
860
|
+
const Err = {
|
|
861
|
+
errorDescription: `\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u539F\u56E0\uFF1A${errorMessage}\uFF01`,
|
|
862
|
+
requestType: options.methodType ?? "\u672A\u77E5\u8BF7\u6C42\u7C7B\u578B",
|
|
863
|
+
requestUrl: options.url
|
|
864
|
+
};
|
|
865
|
+
warningMessage = `
|
|
866
|
+
\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u539F\u56E0\uFF1A${logger.yellow(errorMessage)}
|
|
867
|
+
\u9519\u8BEF\u4EE3\u7801\uFF1A${result.code}
|
|
868
|
+
\u8BF7\u6C42\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
869
|
+
\u8BF7\u6C42URL\uFF1A${options.url}
|
|
870
|
+
`;
|
|
860
871
|
logger.warn(warningMessage);
|
|
861
872
|
throw {
|
|
862
|
-
|
|
863
|
-
|
|
873
|
+
code: result.code,
|
|
874
|
+
data: result,
|
|
875
|
+
amagiError: Err
|
|
864
876
|
};
|
|
865
877
|
}
|
|
878
|
+
return result;
|
|
866
879
|
} catch (error) {
|
|
867
880
|
if (error && typeof error === "object") {
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
warning: error.warning || "\u672A\u77E5\u9519\u8BEF"
|
|
871
|
-
};
|
|
881
|
+
const err = error;
|
|
882
|
+
return { ...err, amagiMessage: warningMessage };
|
|
872
883
|
}
|
|
884
|
+
return {
|
|
885
|
+
code: "UNKNOWN_ERROR" /* UNKNOWN */,
|
|
886
|
+
data: error.data,
|
|
887
|
+
amagiError: {
|
|
888
|
+
errorDescription: "\u672A\u77E5\u9519\u8BEF",
|
|
889
|
+
requestType: options.methodType,
|
|
890
|
+
requestUrl: options.url
|
|
891
|
+
},
|
|
892
|
+
amagiMessage: warningMessage
|
|
893
|
+
};
|
|
873
894
|
}
|
|
874
895
|
};
|
|
875
|
-
var
|
|
896
|
+
var bilibiliErrorCodeMap = {
|
|
876
897
|
"-1": "\u5E94\u7528\u7A0B\u5E8F\u4E0D\u5B58\u5728\u6216\u5DF2\u88AB\u5C01\u7981",
|
|
877
898
|
"-2": "Access Key \u9519\u8BEF",
|
|
878
899
|
"-3": "API \u6821\u9A8C\u5BC6\u5319\u9519\u8BEF",
|
|
@@ -1668,6 +1689,7 @@ var defheaders2 = {
|
|
|
1668
1689
|
connection: "keep-alive"
|
|
1669
1690
|
};
|
|
1670
1691
|
var DouyinData = async (data2, cookie) => {
|
|
1692
|
+
var _a, _b;
|
|
1671
1693
|
const headers2 = {
|
|
1672
1694
|
...defheaders2,
|
|
1673
1695
|
cookie: cookie ? cookie.replace(/\s+/g, "") : ""
|
|
@@ -1814,15 +1836,29 @@ var DouyinData = async (data2, cookie) => {
|
|
|
1814
1836
|
case "\u76F4\u64AD\u95F4\u4FE1\u606F\u6570\u636E": {
|
|
1815
1837
|
DouyinValidateData(data2, ["sec_uid"]);
|
|
1816
1838
|
let url = douyinApiUrls.\u7528\u6237\u4E3B\u9875\u4FE1\u606F({ sec_uid: data2.sec_uid });
|
|
1839
|
+
const fetchUrl = `${url}&a_bogus=${douyinSign.AB(url)}`;
|
|
1817
1840
|
const UserInfoData = await GlobalGetData2({
|
|
1818
|
-
url:
|
|
1841
|
+
url: fetchUrl,
|
|
1819
1842
|
headers: {
|
|
1820
1843
|
...headers2,
|
|
1821
1844
|
Referer: `https://www.douyin.com/user/${data2.sec_uid}`
|
|
1822
1845
|
},
|
|
1823
1846
|
...data2
|
|
1824
1847
|
});
|
|
1825
|
-
if (UserInfoData.user.live_status
|
|
1848
|
+
if (!((_a = UserInfoData == null ? void 0 : UserInfoData.user) == null ? void 0 : _a.live_status) || UserInfoData.user.live_status !== 1) {
|
|
1849
|
+
logger.error((((_b = UserInfoData == null ? void 0 : UserInfoData.user) == null ? void 0 : _b.nickname) || "\u7528\u6237") + "\u5F53\u524D\u672A\u5728\u76F4\u64AD");
|
|
1850
|
+
const Err = {
|
|
1851
|
+
errorDescription: "\u68C0\u67E5\u5931\u8D25\uFF01\u8BE5\u7528\u6237\u5F53\u524D\u672A\u5728\u76F4\u64AD\uFF01 TypeError: Cannot read properties of undefined (reading 'live_status')",
|
|
1852
|
+
requestType: data2.methodType ?? "\u672A\u77E5\u8BF7\u6C42\u7C7B\u578B",
|
|
1853
|
+
requestUrl: fetchUrl
|
|
1854
|
+
};
|
|
1855
|
+
return {
|
|
1856
|
+
code: "USER_NOT_LIVE" /* NOT_LIVE */,
|
|
1857
|
+
data: UserInfoData,
|
|
1858
|
+
amagiError: Err,
|
|
1859
|
+
amagiMessage: Err.errorDescription
|
|
1860
|
+
};
|
|
1861
|
+
}
|
|
1826
1862
|
if (!UserInfoData.user.room_data) {
|
|
1827
1863
|
logger.error("\u672A\u83B7\u53D6\u5230\u76F4\u64AD\u95F4\u4FE1\u606F\uFF01");
|
|
1828
1864
|
return {
|
|
@@ -1889,45 +1925,62 @@ var fetchPaginatedData = async (apiUrlGenerator, params, maxPageSize, headers2)
|
|
|
1889
1925
|
return finalResponse;
|
|
1890
1926
|
};
|
|
1891
1927
|
async function GlobalGetData2(options) {
|
|
1928
|
+
let warningMessage = "";
|
|
1892
1929
|
try {
|
|
1893
1930
|
const result = await new Networks(options).getData();
|
|
1894
|
-
if (result === ""
|
|
1895
|
-
const
|
|
1896
|
-
|
|
1897
|
-
|
|
1931
|
+
if (!result || result === "") {
|
|
1932
|
+
const Err = {
|
|
1933
|
+
errorDescription: "\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u63A5\u53E3\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u4F60\u7684\u6296\u97F3ck\u53EF\u80FD\u5DF2\u7ECF\u5931\u6548\uFF01",
|
|
1934
|
+
requestType: options.methodType ?? "\u672A\u77E5\u8BF7\u6C42\u7C7B\u578B",
|
|
1935
|
+
requestUrl: options.url
|
|
1936
|
+
};
|
|
1937
|
+
warningMessage = `
|
|
1938
|
+
\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u539F\u56E0\uFF1A${logger.yellow("\u63A5\u53E3\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u4F60\u7684\u6296\u97F3ck\u53EF\u80FD\u5DF2\u7ECF\u5931\u6548\uFF01")}
|
|
1898
1939
|
\u8BF7\u6C42\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
1899
|
-
\u8BF7\u6C42URL\uFF1A
|
|
1940
|
+
\u8BF7\u6C42URL\uFF1A${options.url}
|
|
1900
1941
|
`;
|
|
1901
1942
|
logger.warn(warningMessage);
|
|
1902
1943
|
throw {
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1944
|
+
code: "INVALID_COOKIE" /* COOKIE */,
|
|
1945
|
+
data: result,
|
|
1946
|
+
amagiError: Err
|
|
1906
1947
|
};
|
|
1907
1948
|
}
|
|
1908
1949
|
if (result.filter_detail && result.filter_detail.filter_reason) {
|
|
1909
1950
|
const filterReason = result.filter_detail.filter_reason;
|
|
1910
|
-
const
|
|
1911
|
-
|
|
1951
|
+
const Err = {
|
|
1952
|
+
errorDescription: `\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u539F\u56E0\uFF1A${filterReason}\uFF01`,
|
|
1953
|
+
requestType: options.methodType ?? "\u672A\u77E5\u8BF7\u6C42\u7C7B\u578B",
|
|
1954
|
+
requestUrl: options.url
|
|
1955
|
+
};
|
|
1956
|
+
warningMessage = `
|
|
1957
|
+
\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u539F\u56E0\uFF1A${logger.yellow(filterReason)}
|
|
1912
1958
|
\u8BF7\u6C42\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
1913
|
-
\u8BF7\u6C42URL\uFF1A
|
|
1959
|
+
\u8BF7\u6C42URL\uFF1A${options.url}
|
|
1914
1960
|
`;
|
|
1915
1961
|
logger.warn(warningMessage);
|
|
1916
1962
|
throw {
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1963
|
+
code: "CONTENT_FILTERED" /* FILTER */,
|
|
1964
|
+
data: result,
|
|
1965
|
+
amagiError: Err
|
|
1920
1966
|
};
|
|
1921
1967
|
}
|
|
1922
1968
|
return result;
|
|
1923
1969
|
} catch (error) {
|
|
1924
1970
|
if (error && typeof error === "object") {
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
code: error.status_code || 500,
|
|
1928
|
-
warning: error.warning || "\u672A\u77E5\u9519\u8BEF"
|
|
1929
|
-
};
|
|
1971
|
+
const err = error;
|
|
1972
|
+
return { ...err, amagiMessage: warningMessage };
|
|
1930
1973
|
}
|
|
1974
|
+
return {
|
|
1975
|
+
code: "UNKNOWN_ERROR" /* UNKNOWN */,
|
|
1976
|
+
data: null,
|
|
1977
|
+
amagiError: {
|
|
1978
|
+
errorDescription: "\u672A\u77E5\u9519\u8BEF",
|
|
1979
|
+
requestType: options.methodType,
|
|
1980
|
+
requestUrl: options.url
|
|
1981
|
+
},
|
|
1982
|
+
amagiMessage: warningMessage
|
|
1983
|
+
};
|
|
1931
1984
|
}
|
|
1932
1985
|
}
|
|
1933
1986
|
|
|
@@ -2103,31 +2156,45 @@ var KuaishouData = async (data2, cookie) => {
|
|
|
2103
2156
|
}
|
|
2104
2157
|
};
|
|
2105
2158
|
async function GlobalGetData3(options) {
|
|
2159
|
+
let warningMessage = "";
|
|
2106
2160
|
try {
|
|
2107
2161
|
const result = await new Networks(options).getData();
|
|
2108
2162
|
if (result === "" || !result || result.result === 2) {
|
|
2109
|
-
const
|
|
2110
|
-
\
|
|
2111
|
-
\u8BF7\u6C42\u7C7B\u578B
|
|
2112
|
-
|
|
2113
|
-
|
|
2163
|
+
const Err = {
|
|
2164
|
+
errorDescription: `\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u63A5\u53E3\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A\uFF01`,
|
|
2165
|
+
requestType: options.methodType ?? "\u672A\u77E5\u8BF7\u6C42\u7C7B\u578B",
|
|
2166
|
+
requestUrl: options.url,
|
|
2167
|
+
requestBody: JSON.stringify(options.body)
|
|
2168
|
+
};
|
|
2169
|
+
warningMessage = `
|
|
2170
|
+
\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u539F\u56E0\uFF1A${logger.yellow("\u63A5\u53E3\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u4F60\u7684\u5FEB\u624Bck\u53EF\u80FD\u5DF2\u7ECF\u5931\u6548\uFF01")}
|
|
2171
|
+
\u8BF7\u6C42\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
2172
|
+
\u8BF7\u6C42URL\uFF1A${options.url}
|
|
2173
|
+
\u8BF7\u6C42\u53C2\u6570\uFF1A${JSON.stringify(options.body, null, 2)}
|
|
2174
|
+
`;
|
|
2114
2175
|
logger.warn(warningMessage);
|
|
2115
2176
|
throw {
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2177
|
+
code: "INVALID_COOKIE" /* COOKIE */,
|
|
2178
|
+
data: result,
|
|
2179
|
+
amagiError: Err
|
|
2119
2180
|
};
|
|
2120
2181
|
}
|
|
2121
2182
|
return result;
|
|
2122
2183
|
} catch (error) {
|
|
2123
2184
|
if (error && typeof error === "object") {
|
|
2124
|
-
|
|
2125
|
-
|
|
2126
|
-
code: error.result || 500,
|
|
2127
|
-
message: error.error_msg,
|
|
2128
|
-
warning: error.warning || "\u672A\u77E5\u9519\u8BEF"
|
|
2129
|
-
};
|
|
2185
|
+
const err = error;
|
|
2186
|
+
return { ...err, amagiMessage: warningMessage };
|
|
2130
2187
|
}
|
|
2188
|
+
return {
|
|
2189
|
+
code: "UNKNOWN_ERROR" /* UNKNOWN */,
|
|
2190
|
+
data: null,
|
|
2191
|
+
amagiError: {
|
|
2192
|
+
errorDescription: "\u672A\u77E5\u9519\u8BEF",
|
|
2193
|
+
requestType: options.methodType,
|
|
2194
|
+
requestUrl: options.url
|
|
2195
|
+
},
|
|
2196
|
+
amagiMessage: warningMessage
|
|
2197
|
+
};
|
|
2131
2198
|
}
|
|
2132
2199
|
}
|
|
2133
2200
|
|
|
@@ -2229,15 +2296,15 @@ var CustomLogger = class {
|
|
|
2229
2296
|
gray;
|
|
2230
2297
|
constructor(name) {
|
|
2231
2298
|
this.logger = log4js__default.default.getLogger(name);
|
|
2232
|
-
this.chalk =
|
|
2233
|
-
this.red =
|
|
2234
|
-
this.green =
|
|
2235
|
-
this.yellow =
|
|
2236
|
-
this.blue =
|
|
2237
|
-
this.magenta =
|
|
2238
|
-
this.cyan =
|
|
2239
|
-
this.white =
|
|
2240
|
-
this.gray =
|
|
2299
|
+
this.chalk = new chalk.Chalk();
|
|
2300
|
+
this.red = this.chalk.red;
|
|
2301
|
+
this.green = this.chalk.green;
|
|
2302
|
+
this.yellow = this.chalk.yellow;
|
|
2303
|
+
this.blue = this.chalk.blue;
|
|
2304
|
+
this.magenta = this.chalk.magenta;
|
|
2305
|
+
this.cyan = this.chalk.cyan;
|
|
2306
|
+
this.white = this.chalk.white;
|
|
2307
|
+
this.gray = this.chalk.gray;
|
|
2241
2308
|
}
|
|
2242
2309
|
// 代理 log4js.Logger 的方法
|
|
2243
2310
|
info(message, ...args) {
|
|
@@ -2517,9 +2584,9 @@ function createAmagiClient(options = {}) {
|
|
|
2517
2584
|
createAmagiClient.douyin = douyinUtils;
|
|
2518
2585
|
createAmagiClient.bilibili = bilibiliUtils;
|
|
2519
2586
|
createAmagiClient.kuaishou = kuaishouUtils;
|
|
2520
|
-
createAmagiClient.getDouyinData =
|
|
2521
|
-
createAmagiClient.getBilibiliData =
|
|
2522
|
-
createAmagiClient.getKuaishouData =
|
|
2587
|
+
createAmagiClient.getDouyinData = douyinUtils.getDouyinData;
|
|
2588
|
+
createAmagiClient.getBilibiliData = bilibiliUtils.getBilibiliData;
|
|
2589
|
+
createAmagiClient.getKuaishouData = kuaishouUtils.getKuaishouData;
|
|
2523
2590
|
var CreateApp = createAmagiClient;
|
|
2524
2591
|
var Client = CreateApp;
|
|
2525
2592
|
var amagi = Client;
|
|
@@ -2536,6 +2603,7 @@ exports.av2bv = av2bv;
|
|
|
2536
2603
|
exports.bilibili = bilibili;
|
|
2537
2604
|
exports.bilibiliAPI = bilibiliAPI;
|
|
2538
2605
|
exports.bilibiliApiUrls = bilibiliApiUrls;
|
|
2606
|
+
exports.bilibiliErrorCodeMap = bilibiliErrorCodeMap;
|
|
2539
2607
|
exports.bilibiliUtils = bilibiliUtils;
|
|
2540
2608
|
exports.bv2av = bv2av;
|
|
2541
2609
|
exports.default = Client;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import axios, { AxiosError } from 'axios';
|
|
2
2
|
import crypto from 'crypto';
|
|
3
3
|
import express from 'express';
|
|
4
|
-
import
|
|
4
|
+
import { Chalk } from 'chalk';
|
|
5
5
|
import log4js from 'log4js';
|
|
6
6
|
|
|
7
7
|
// src/platform/bilibili/API.ts
|
|
@@ -462,7 +462,7 @@ var registerBilibiliRoutes = (cookie) => {
|
|
|
462
462
|
}, req.headers.cookie || cookie);
|
|
463
463
|
res.json(data2);
|
|
464
464
|
});
|
|
465
|
-
router.get("/
|
|
465
|
+
router.get("/fetch_emoji_list", async (req, res) => {
|
|
466
466
|
const data2 = await fetchBilibili({
|
|
467
467
|
methodType: "Emoji\u6570\u636E"
|
|
468
468
|
}, req.headers.cookie || cookie);
|
|
@@ -535,7 +535,7 @@ var registerBilibiliRoutes = (cookie) => {
|
|
|
535
535
|
router.get("/av_to_bv", async (req, res) => {
|
|
536
536
|
const data2 = await fetchBilibili({
|
|
537
537
|
methodType: "AV\u8F6CBV",
|
|
538
|
-
avid:
|
|
538
|
+
avid: req.query.avid
|
|
539
539
|
}, req.headers.cookie || cookie);
|
|
540
540
|
res.json(data2);
|
|
541
541
|
});
|
|
@@ -823,44 +823,66 @@ var fetchBilibili = async (data2, cookie) => {
|
|
|
823
823
|
}
|
|
824
824
|
};
|
|
825
825
|
var GlobalGetData = async (options) => {
|
|
826
|
+
let warningMessage = "";
|
|
826
827
|
try {
|
|
827
828
|
const result = await new Networks(options).getData();
|
|
828
|
-
if (result
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
\
|
|
829
|
+
if (!result || result === "") {
|
|
830
|
+
const Err = {
|
|
831
|
+
errorDescription: "\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u63A5\u53E3\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u4F60\u7684B\u7AD9ck\u53EF\u80FD\u5DF2\u7ECF\u5931\u6548\uFF01",
|
|
832
|
+
requestType: options.methodType ?? "\u672A\u77E5\u8BF7\u6C42\u7C7B\u578B",
|
|
833
|
+
requestUrl: options.url
|
|
834
|
+
};
|
|
835
|
+
warningMessage = `
|
|
836
|
+
\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u539F\u56E0\uFF1A${logger.yellow("\u63A5\u53E3\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u4F60\u7684B\u7AD9ck\u53EF\u80FD\u5DF2\u7ECF\u5931\u6548\uFF01")}
|
|
837
|
+
\u8BF7\u6C42\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
838
|
+
\u8BF7\u6C42URL\uFF1A${options.url}
|
|
839
|
+
`;
|
|
836
840
|
logger.warn(warningMessage);
|
|
837
841
|
throw {
|
|
838
|
-
|
|
839
|
-
|
|
842
|
+
code: "-352" /* RISK_CONTROL_FAILED */,
|
|
843
|
+
data: result,
|
|
844
|
+
amagiError: Err
|
|
840
845
|
};
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
const
|
|
844
|
-
|
|
845
|
-
\
|
|
846
|
-
\
|
|
847
|
-
|
|
846
|
+
}
|
|
847
|
+
if (result.code !== 0) {
|
|
848
|
+
const errorMessage = bilibiliErrorCodeMap[result.code] || result.message || "\u672A\u77E5\u9519\u8BEF";
|
|
849
|
+
const Err = {
|
|
850
|
+
errorDescription: `\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u539F\u56E0\uFF1A${errorMessage}\uFF01`,
|
|
851
|
+
requestType: options.methodType ?? "\u672A\u77E5\u8BF7\u6C42\u7C7B\u578B",
|
|
852
|
+
requestUrl: options.url
|
|
853
|
+
};
|
|
854
|
+
warningMessage = `
|
|
855
|
+
\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u539F\u56E0\uFF1A${logger.yellow(errorMessage)}
|
|
856
|
+
\u9519\u8BEF\u4EE3\u7801\uFF1A${result.code}
|
|
857
|
+
\u8BF7\u6C42\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
858
|
+
\u8BF7\u6C42URL\uFF1A${options.url}
|
|
859
|
+
`;
|
|
848
860
|
logger.warn(warningMessage);
|
|
849
861
|
throw {
|
|
850
|
-
|
|
851
|
-
|
|
862
|
+
code: result.code,
|
|
863
|
+
data: result,
|
|
864
|
+
amagiError: Err
|
|
852
865
|
};
|
|
853
866
|
}
|
|
867
|
+
return result;
|
|
854
868
|
} catch (error) {
|
|
855
869
|
if (error && typeof error === "object") {
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
warning: error.warning || "\u672A\u77E5\u9519\u8BEF"
|
|
859
|
-
};
|
|
870
|
+
const err = error;
|
|
871
|
+
return { ...err, amagiMessage: warningMessage };
|
|
860
872
|
}
|
|
873
|
+
return {
|
|
874
|
+
code: "UNKNOWN_ERROR" /* UNKNOWN */,
|
|
875
|
+
data: error.data,
|
|
876
|
+
amagiError: {
|
|
877
|
+
errorDescription: "\u672A\u77E5\u9519\u8BEF",
|
|
878
|
+
requestType: options.methodType,
|
|
879
|
+
requestUrl: options.url
|
|
880
|
+
},
|
|
881
|
+
amagiMessage: warningMessage
|
|
882
|
+
};
|
|
861
883
|
}
|
|
862
884
|
};
|
|
863
|
-
var
|
|
885
|
+
var bilibiliErrorCodeMap = {
|
|
864
886
|
"-1": "\u5E94\u7528\u7A0B\u5E8F\u4E0D\u5B58\u5728\u6216\u5DF2\u88AB\u5C01\u7981",
|
|
865
887
|
"-2": "Access Key \u9519\u8BEF",
|
|
866
888
|
"-3": "API \u6821\u9A8C\u5BC6\u5319\u9519\u8BEF",
|
|
@@ -1656,6 +1678,7 @@ var defheaders2 = {
|
|
|
1656
1678
|
connection: "keep-alive"
|
|
1657
1679
|
};
|
|
1658
1680
|
var DouyinData = async (data2, cookie) => {
|
|
1681
|
+
var _a, _b;
|
|
1659
1682
|
const headers2 = {
|
|
1660
1683
|
...defheaders2,
|
|
1661
1684
|
cookie: cookie ? cookie.replace(/\s+/g, "") : ""
|
|
@@ -1802,15 +1825,29 @@ var DouyinData = async (data2, cookie) => {
|
|
|
1802
1825
|
case "\u76F4\u64AD\u95F4\u4FE1\u606F\u6570\u636E": {
|
|
1803
1826
|
DouyinValidateData(data2, ["sec_uid"]);
|
|
1804
1827
|
let url = douyinApiUrls.\u7528\u6237\u4E3B\u9875\u4FE1\u606F({ sec_uid: data2.sec_uid });
|
|
1828
|
+
const fetchUrl = `${url}&a_bogus=${douyinSign.AB(url)}`;
|
|
1805
1829
|
const UserInfoData = await GlobalGetData2({
|
|
1806
|
-
url:
|
|
1830
|
+
url: fetchUrl,
|
|
1807
1831
|
headers: {
|
|
1808
1832
|
...headers2,
|
|
1809
1833
|
Referer: `https://www.douyin.com/user/${data2.sec_uid}`
|
|
1810
1834
|
},
|
|
1811
1835
|
...data2
|
|
1812
1836
|
});
|
|
1813
|
-
if (UserInfoData.user.live_status
|
|
1837
|
+
if (!((_a = UserInfoData == null ? void 0 : UserInfoData.user) == null ? void 0 : _a.live_status) || UserInfoData.user.live_status !== 1) {
|
|
1838
|
+
logger.error((((_b = UserInfoData == null ? void 0 : UserInfoData.user) == null ? void 0 : _b.nickname) || "\u7528\u6237") + "\u5F53\u524D\u672A\u5728\u76F4\u64AD");
|
|
1839
|
+
const Err = {
|
|
1840
|
+
errorDescription: "\u68C0\u67E5\u5931\u8D25\uFF01\u8BE5\u7528\u6237\u5F53\u524D\u672A\u5728\u76F4\u64AD\uFF01 TypeError: Cannot read properties of undefined (reading 'live_status')",
|
|
1841
|
+
requestType: data2.methodType ?? "\u672A\u77E5\u8BF7\u6C42\u7C7B\u578B",
|
|
1842
|
+
requestUrl: fetchUrl
|
|
1843
|
+
};
|
|
1844
|
+
return {
|
|
1845
|
+
code: "USER_NOT_LIVE" /* NOT_LIVE */,
|
|
1846
|
+
data: UserInfoData,
|
|
1847
|
+
amagiError: Err,
|
|
1848
|
+
amagiMessage: Err.errorDescription
|
|
1849
|
+
};
|
|
1850
|
+
}
|
|
1814
1851
|
if (!UserInfoData.user.room_data) {
|
|
1815
1852
|
logger.error("\u672A\u83B7\u53D6\u5230\u76F4\u64AD\u95F4\u4FE1\u606F\uFF01");
|
|
1816
1853
|
return {
|
|
@@ -1877,45 +1914,62 @@ var fetchPaginatedData = async (apiUrlGenerator, params, maxPageSize, headers2)
|
|
|
1877
1914
|
return finalResponse;
|
|
1878
1915
|
};
|
|
1879
1916
|
async function GlobalGetData2(options) {
|
|
1917
|
+
let warningMessage = "";
|
|
1880
1918
|
try {
|
|
1881
1919
|
const result = await new Networks(options).getData();
|
|
1882
|
-
if (result === ""
|
|
1883
|
-
const
|
|
1884
|
-
|
|
1885
|
-
|
|
1920
|
+
if (!result || result === "") {
|
|
1921
|
+
const Err = {
|
|
1922
|
+
errorDescription: "\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u63A5\u53E3\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u4F60\u7684\u6296\u97F3ck\u53EF\u80FD\u5DF2\u7ECF\u5931\u6548\uFF01",
|
|
1923
|
+
requestType: options.methodType ?? "\u672A\u77E5\u8BF7\u6C42\u7C7B\u578B",
|
|
1924
|
+
requestUrl: options.url
|
|
1925
|
+
};
|
|
1926
|
+
warningMessage = `
|
|
1927
|
+
\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u539F\u56E0\uFF1A${logger.yellow("\u63A5\u53E3\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u4F60\u7684\u6296\u97F3ck\u53EF\u80FD\u5DF2\u7ECF\u5931\u6548\uFF01")}
|
|
1886
1928
|
\u8BF7\u6C42\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
1887
|
-
\u8BF7\u6C42URL\uFF1A
|
|
1929
|
+
\u8BF7\u6C42URL\uFF1A${options.url}
|
|
1888
1930
|
`;
|
|
1889
1931
|
logger.warn(warningMessage);
|
|
1890
1932
|
throw {
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1933
|
+
code: "INVALID_COOKIE" /* COOKIE */,
|
|
1934
|
+
data: result,
|
|
1935
|
+
amagiError: Err
|
|
1894
1936
|
};
|
|
1895
1937
|
}
|
|
1896
1938
|
if (result.filter_detail && result.filter_detail.filter_reason) {
|
|
1897
1939
|
const filterReason = result.filter_detail.filter_reason;
|
|
1898
|
-
const
|
|
1899
|
-
|
|
1940
|
+
const Err = {
|
|
1941
|
+
errorDescription: `\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u539F\u56E0\uFF1A${filterReason}\uFF01`,
|
|
1942
|
+
requestType: options.methodType ?? "\u672A\u77E5\u8BF7\u6C42\u7C7B\u578B",
|
|
1943
|
+
requestUrl: options.url
|
|
1944
|
+
};
|
|
1945
|
+
warningMessage = `
|
|
1946
|
+
\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u539F\u56E0\uFF1A${logger.yellow(filterReason)}
|
|
1900
1947
|
\u8BF7\u6C42\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
1901
|
-
\u8BF7\u6C42URL\uFF1A
|
|
1948
|
+
\u8BF7\u6C42URL\uFF1A${options.url}
|
|
1902
1949
|
`;
|
|
1903
1950
|
logger.warn(warningMessage);
|
|
1904
1951
|
throw {
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1952
|
+
code: "CONTENT_FILTERED" /* FILTER */,
|
|
1953
|
+
data: result,
|
|
1954
|
+
amagiError: Err
|
|
1908
1955
|
};
|
|
1909
1956
|
}
|
|
1910
1957
|
return result;
|
|
1911
1958
|
} catch (error) {
|
|
1912
1959
|
if (error && typeof error === "object") {
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
code: error.status_code || 500,
|
|
1916
|
-
warning: error.warning || "\u672A\u77E5\u9519\u8BEF"
|
|
1917
|
-
};
|
|
1960
|
+
const err = error;
|
|
1961
|
+
return { ...err, amagiMessage: warningMessage };
|
|
1918
1962
|
}
|
|
1963
|
+
return {
|
|
1964
|
+
code: "UNKNOWN_ERROR" /* UNKNOWN */,
|
|
1965
|
+
data: null,
|
|
1966
|
+
amagiError: {
|
|
1967
|
+
errorDescription: "\u672A\u77E5\u9519\u8BEF",
|
|
1968
|
+
requestType: options.methodType,
|
|
1969
|
+
requestUrl: options.url
|
|
1970
|
+
},
|
|
1971
|
+
amagiMessage: warningMessage
|
|
1972
|
+
};
|
|
1919
1973
|
}
|
|
1920
1974
|
}
|
|
1921
1975
|
|
|
@@ -2091,31 +2145,45 @@ var KuaishouData = async (data2, cookie) => {
|
|
|
2091
2145
|
}
|
|
2092
2146
|
};
|
|
2093
2147
|
async function GlobalGetData3(options) {
|
|
2148
|
+
let warningMessage = "";
|
|
2094
2149
|
try {
|
|
2095
2150
|
const result = await new Networks(options).getData();
|
|
2096
2151
|
if (result === "" || !result || result.result === 2) {
|
|
2097
|
-
const
|
|
2098
|
-
\
|
|
2099
|
-
\u8BF7\u6C42\u7C7B\u578B
|
|
2100
|
-
|
|
2101
|
-
|
|
2152
|
+
const Err = {
|
|
2153
|
+
errorDescription: `\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u63A5\u53E3\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A\uFF01`,
|
|
2154
|
+
requestType: options.methodType ?? "\u672A\u77E5\u8BF7\u6C42\u7C7B\u578B",
|
|
2155
|
+
requestUrl: options.url,
|
|
2156
|
+
requestBody: JSON.stringify(options.body)
|
|
2157
|
+
};
|
|
2158
|
+
warningMessage = `
|
|
2159
|
+
\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u539F\u56E0\uFF1A${logger.yellow("\u63A5\u53E3\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A\uFF0C\u4F60\u7684\u5FEB\u624Bck\u53EF\u80FD\u5DF2\u7ECF\u5931\u6548\uFF01")}
|
|
2160
|
+
\u8BF7\u6C42\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
2161
|
+
\u8BF7\u6C42URL\uFF1A${options.url}
|
|
2162
|
+
\u8BF7\u6C42\u53C2\u6570\uFF1A${JSON.stringify(options.body, null, 2)}
|
|
2163
|
+
`;
|
|
2102
2164
|
logger.warn(warningMessage);
|
|
2103
2165
|
throw {
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2166
|
+
code: "INVALID_COOKIE" /* COOKIE */,
|
|
2167
|
+
data: result,
|
|
2168
|
+
amagiError: Err
|
|
2107
2169
|
};
|
|
2108
2170
|
}
|
|
2109
2171
|
return result;
|
|
2110
2172
|
} catch (error) {
|
|
2111
2173
|
if (error && typeof error === "object") {
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
code: error.result || 500,
|
|
2115
|
-
message: error.error_msg,
|
|
2116
|
-
warning: error.warning || "\u672A\u77E5\u9519\u8BEF"
|
|
2117
|
-
};
|
|
2174
|
+
const err = error;
|
|
2175
|
+
return { ...err, amagiMessage: warningMessage };
|
|
2118
2176
|
}
|
|
2177
|
+
return {
|
|
2178
|
+
code: "UNKNOWN_ERROR" /* UNKNOWN */,
|
|
2179
|
+
data: null,
|
|
2180
|
+
amagiError: {
|
|
2181
|
+
errorDescription: "\u672A\u77E5\u9519\u8BEF",
|
|
2182
|
+
requestType: options.methodType,
|
|
2183
|
+
requestUrl: options.url
|
|
2184
|
+
},
|
|
2185
|
+
amagiMessage: warningMessage
|
|
2186
|
+
};
|
|
2119
2187
|
}
|
|
2120
2188
|
}
|
|
2121
2189
|
|
|
@@ -2217,15 +2285,15 @@ var CustomLogger = class {
|
|
|
2217
2285
|
gray;
|
|
2218
2286
|
constructor(name) {
|
|
2219
2287
|
this.logger = log4js.getLogger(name);
|
|
2220
|
-
this.chalk =
|
|
2221
|
-
this.red = chalk.red
|
|
2222
|
-
this.green = chalk.green
|
|
2223
|
-
this.yellow = chalk.yellow
|
|
2224
|
-
this.blue = chalk.blue
|
|
2225
|
-
this.magenta = chalk.magenta
|
|
2226
|
-
this.cyan = chalk.cyan
|
|
2227
|
-
this.white = chalk.white
|
|
2228
|
-
this.gray = chalk.gray
|
|
2288
|
+
this.chalk = new Chalk();
|
|
2289
|
+
this.red = this.chalk.red;
|
|
2290
|
+
this.green = this.chalk.green;
|
|
2291
|
+
this.yellow = this.chalk.yellow;
|
|
2292
|
+
this.blue = this.chalk.blue;
|
|
2293
|
+
this.magenta = this.chalk.magenta;
|
|
2294
|
+
this.cyan = this.chalk.cyan;
|
|
2295
|
+
this.white = this.chalk.white;
|
|
2296
|
+
this.gray = this.chalk.gray;
|
|
2229
2297
|
}
|
|
2230
2298
|
// 代理 log4js.Logger 的方法
|
|
2231
2299
|
info(message, ...args) {
|
|
@@ -2505,11 +2573,11 @@ function createAmagiClient(options = {}) {
|
|
|
2505
2573
|
createAmagiClient.douyin = douyinUtils;
|
|
2506
2574
|
createAmagiClient.bilibili = bilibiliUtils;
|
|
2507
2575
|
createAmagiClient.kuaishou = kuaishouUtils;
|
|
2508
|
-
createAmagiClient.getDouyinData =
|
|
2509
|
-
createAmagiClient.getBilibiliData =
|
|
2510
|
-
createAmagiClient.getKuaishouData =
|
|
2576
|
+
createAmagiClient.getDouyinData = douyinUtils.getDouyinData;
|
|
2577
|
+
createAmagiClient.getBilibiliData = bilibiliUtils.getBilibiliData;
|
|
2578
|
+
createAmagiClient.getKuaishouData = kuaishouUtils.getKuaishouData;
|
|
2511
2579
|
var CreateApp = createAmagiClient;
|
|
2512
2580
|
var Client = CreateApp;
|
|
2513
2581
|
var amagi = Client;
|
|
2514
2582
|
|
|
2515
|
-
export { BilibiliValidateData, CreateApp, DouyinValidateData, KuaishouAPI, KusiahouValidateData, Networks, amagi, amagiClient, av2bv, bilibili, bilibiliAPI, bilibiliApiUrls, bilibiliUtils, bv2av, Client as default, douyin, douyinAPI, douyinApiUrls, douyinSign, douyinUtils, fetchBilibiliData, fetchDouyinData, fetchKuaishouData, getBilibiliData, getDouyinData, getKuaishouData, kuaishou, kuaishouAPI, kuaishouApiUrls, kuaishouUtils, logMiddleware, logger, qtparam, registerBilibiliRoutes, registerDouyinRoutes, registerKuaishouRoutes, wbi_sign };
|
|
2583
|
+
export { BilibiliValidateData, CreateApp, DouyinValidateData, KuaishouAPI, KusiahouValidateData, Networks, amagi, amagiClient, av2bv, bilibili, bilibiliAPI, bilibiliApiUrls, bilibiliErrorCodeMap, bilibiliUtils, bv2av, Client as default, douyin, douyinAPI, douyinApiUrls, douyinSign, douyinUtils, fetchBilibiliData, fetchDouyinData, fetchKuaishouData, getBilibiliData, getDouyinData, getKuaishouData, kuaishou, kuaishouAPI, kuaishouApiUrls, kuaishouUtils, logMiddleware, logger, qtparam, registerBilibiliRoutes, registerDouyinRoutes, registerKuaishouRoutes, wbi_sign };
|
package/dist/default/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ChalkInstance } from 'chalk';
|
|
2
2
|
import express, { RequestHandler, Request, Router } from 'express';
|
|
3
3
|
import { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
4
4
|
|
|
@@ -387,6 +387,147 @@ type NetworksConfigType = {
|
|
|
387
387
|
*/
|
|
388
388
|
methodType?: string;
|
|
389
389
|
};
|
|
390
|
+
/** API标准化HTTP请求错误类型 */
|
|
391
|
+
type ErrorDetail = {
|
|
392
|
+
/**
|
|
393
|
+
* 错误描述信息
|
|
394
|
+
*/
|
|
395
|
+
errorDescription: string;
|
|
396
|
+
/**
|
|
397
|
+
* 请求类型
|
|
398
|
+
*/
|
|
399
|
+
requestType: string;
|
|
400
|
+
/**
|
|
401
|
+
* 请求URL地址
|
|
402
|
+
*/
|
|
403
|
+
requestUrl: string;
|
|
404
|
+
};
|
|
405
|
+
/** 未知错误 */
|
|
406
|
+
declare enum amagiAPIErrorCode {
|
|
407
|
+
/** 未知错误 */
|
|
408
|
+
UNKNOWN = "UNKNOWN_ERROR"
|
|
409
|
+
}
|
|
410
|
+
/** 抖音平台API错误码 */
|
|
411
|
+
declare enum douoyinAPIErrorCode {
|
|
412
|
+
/** Cookie无效或已过期 */
|
|
413
|
+
COOKIE = "INVALID_COOKIE",
|
|
414
|
+
/** 内容被隐藏或下架 */
|
|
415
|
+
FILTER = "CONTENT_FILTERED",
|
|
416
|
+
/** 当前用户未开播 */
|
|
417
|
+
NOT_LIVE = "USER_NOT_LIVE",
|
|
418
|
+
/** 未知错误 */
|
|
419
|
+
UNKNOWN = "UNKNOWN_ERROR"
|
|
420
|
+
}
|
|
421
|
+
/** B站平台API错误码 */
|
|
422
|
+
declare enum bilibiliAPIErrorCode {
|
|
423
|
+
/** 应用程序不存在或已被封禁 */
|
|
424
|
+
APP_NOT_FOUND = "-1",
|
|
425
|
+
/** Access Key 错误 */
|
|
426
|
+
ACCESS_KEY_ERROR = "-2",
|
|
427
|
+
/** API 校验密匙错误 */
|
|
428
|
+
API_KEY_ERROR = "-3",
|
|
429
|
+
/** 调用方对该Method没有权限 */
|
|
430
|
+
METHOD_NOT_PERMITTED = "-4",
|
|
431
|
+
/** 账号未登录 */
|
|
432
|
+
NOT_LOGGED_IN = "-101",
|
|
433
|
+
/** 账号被封停 */
|
|
434
|
+
ACCOUNT_BANNED = "-102",
|
|
435
|
+
/** 积分不足 */
|
|
436
|
+
POINTS_INSUFFICIENT = "-103",
|
|
437
|
+
/** 硬币不足 */
|
|
438
|
+
COINS_INSUFFICIENT = "-104",
|
|
439
|
+
/** 验证码错误 */
|
|
440
|
+
CAPTCHA_ERROR = "-105",
|
|
441
|
+
/** 账号非正式会员或在适应期 */
|
|
442
|
+
MEMBERSHIP_LIMITED = "-106",
|
|
443
|
+
/** 应用不存在或者被封禁 */
|
|
444
|
+
APP_BANNED = "-107",
|
|
445
|
+
/** 未绑定手机 */
|
|
446
|
+
PHONE_NOT_BOUND = "-108",
|
|
447
|
+
/** 未绑定手机 */
|
|
448
|
+
PHONE_NOT_BOUND_2 = "-110",
|
|
449
|
+
/** csrf 校验失败 */
|
|
450
|
+
CSRF_ERROR = "-111",
|
|
451
|
+
/** 系统升级中 */
|
|
452
|
+
SYSTEM_UPDATING = "-112",
|
|
453
|
+
/** 账号尚未实名认证 */
|
|
454
|
+
NOT_REAL_NAME_VERIFIED = "-113",
|
|
455
|
+
/** 请先绑定手机 */
|
|
456
|
+
NEED_BIND_PHONE = "-114",
|
|
457
|
+
/** 请先完成实名认证 */
|
|
458
|
+
NEED_REAL_NAME_VERIFICATION = "-115",
|
|
459
|
+
/** 木有改动 */
|
|
460
|
+
NO_CHANGE = "-304",
|
|
461
|
+
/** 撞车跳转 */
|
|
462
|
+
CONFLICT_REDIRECT = "-307",
|
|
463
|
+
/** 风控校验失败 (UA 或 wbi 参数不合法) */
|
|
464
|
+
RISK_CONTROL_FAILED = "-352",
|
|
465
|
+
/** 请求错误 */
|
|
466
|
+
BAD_REQUEST = "-400",
|
|
467
|
+
/** 未认证 (或非法请求) */
|
|
468
|
+
UNAUTHORIZED = "-401",
|
|
469
|
+
/** 访问权限不足 */
|
|
470
|
+
FORBIDDEN = "-403",
|
|
471
|
+
/** 啥都木有 */
|
|
472
|
+
NOT_FOUND = "-404",
|
|
473
|
+
/** 不支持该方法 */
|
|
474
|
+
METHOD_NOT_ALLOWED = "-405",
|
|
475
|
+
/** 冲突 */
|
|
476
|
+
CONFLICT = "-409",
|
|
477
|
+
/** 请求被拦截 (客户端 ip 被服务端风控) */
|
|
478
|
+
IP_BLOCKED = "-412",
|
|
479
|
+
/** 服务器错误 */
|
|
480
|
+
SERVER_ERROR = "-500",
|
|
481
|
+
/** 过载保护,服务暂不可用 */
|
|
482
|
+
SERVICE_UNAVAILABLE = "-503",
|
|
483
|
+
/** 服务调用超时 */
|
|
484
|
+
GATEWAY_TIMEOUT = "-504",
|
|
485
|
+
/** 超出限制 */
|
|
486
|
+
RATE_LIMITED = "-509",
|
|
487
|
+
/** 上传文件不存在 */
|
|
488
|
+
FILE_NOT_FOUND = "-616",
|
|
489
|
+
/** 上传文件太大 */
|
|
490
|
+
FILE_TOO_LARGE = "-617",
|
|
491
|
+
/** 登录失败次数太多 */
|
|
492
|
+
LOGIN_ATTEMPTS_EXCEEDED = "-625",
|
|
493
|
+
/** 用户不存在 */
|
|
494
|
+
USER_NOT_FOUND = "-626",
|
|
495
|
+
/** 密码太弱 */
|
|
496
|
+
WEAK_PASSWORD = "-628",
|
|
497
|
+
/** 用户名或密码错误 */
|
|
498
|
+
INVALID_CREDENTIALS = "-629",
|
|
499
|
+
/** 操作对象数量限制 */
|
|
500
|
+
OBJECT_LIMIT_EXCEEDED = "-632",
|
|
501
|
+
/** 被锁定 */
|
|
502
|
+
ACCOUNT_LOCKED = "-643",
|
|
503
|
+
/** 用户等级太低 */
|
|
504
|
+
USER_LEVEL_TOO_LOW = "-650",
|
|
505
|
+
/** 重复的用户 */
|
|
506
|
+
DUPLICATE_USER = "-652",
|
|
507
|
+
/** Token 过期 */
|
|
508
|
+
TOKEN_EXPIRED = "-658",
|
|
509
|
+
/** 密码时间戳过期 */
|
|
510
|
+
PASSWORD_TIMESTAMP_EXPIRED = "-662",
|
|
511
|
+
/** 地理区域限制 */
|
|
512
|
+
GEO_RESTRICTED = "-688",
|
|
513
|
+
/** 版权限制 */
|
|
514
|
+
COPYRIGHT_RESTRICTED = "-689",
|
|
515
|
+
/** 扣节操失败 */
|
|
516
|
+
REPUTATION_DEDUCTION_FAILED = "-701",
|
|
517
|
+
/** 请求过于频繁,请稍后再试 */
|
|
518
|
+
TOO_MANY_REQUESTS = "-799",
|
|
519
|
+
/** 服务器开小差了 */
|
|
520
|
+
SERVER_TEMPORARILY_UNAVAILABLE = "-8888",
|
|
521
|
+
/** 未知错误 */
|
|
522
|
+
UNKNOWN = "UNKNOWN"
|
|
523
|
+
}
|
|
524
|
+
/** 快手平台API错误码 */
|
|
525
|
+
declare enum kuaishouAPIErrorCode {
|
|
526
|
+
/** Cookie无效或已过期 */
|
|
527
|
+
COOKIE = "INVALID_COOKIE",
|
|
528
|
+
/** 未知错误 */
|
|
529
|
+
UNKNOWN = "UNKNOWN_ERROR"
|
|
530
|
+
}
|
|
390
531
|
|
|
391
532
|
type DyEmojiList = {
|
|
392
533
|
emoji_list: EmojiListElement[];
|
|
@@ -13243,6 +13384,21 @@ type TypeControl = {
|
|
|
13243
13384
|
typeMode?: 'strict' | 'loose';
|
|
13244
13385
|
};
|
|
13245
13386
|
|
|
13387
|
+
/**
|
|
13388
|
+
* API请求错误类型
|
|
13389
|
+
* 该类型是方法 `getXXXData` 封装后请求遇到错误时的返回类型
|
|
13390
|
+
*/
|
|
13391
|
+
type APIErrorType<T extends 'douyin' | 'bilibili' | 'kuaishou' | 'default' = 'default'> = {
|
|
13392
|
+
/** 错误码 */
|
|
13393
|
+
code: T extends 'douyin' ? douoyinAPIErrorCode : T extends 'bilibili' ? bilibiliAPIErrorCode : T extends 'kuaishou' ? kuaishouAPIErrorCode : amagiAPIErrorCode;
|
|
13394
|
+
/** 错误时的响应数据 */
|
|
13395
|
+
data: any;
|
|
13396
|
+
/** amagi 错误详情 */
|
|
13397
|
+
amagiError: ErrorDetail;
|
|
13398
|
+
/** 错误信息 */
|
|
13399
|
+
amagiMessage: string;
|
|
13400
|
+
};
|
|
13401
|
+
|
|
13246
13402
|
/**
|
|
13247
13403
|
* 快捷获取抖音数据
|
|
13248
13404
|
* @param type - 请求数据类型
|
|
@@ -13309,7 +13465,7 @@ declare const fetchKuaishouData: typeof getKuaishouData;
|
|
|
13309
13465
|
|
|
13310
13466
|
declare class CustomLogger {
|
|
13311
13467
|
private logger;
|
|
13312
|
-
chalk:
|
|
13468
|
+
chalk: ChalkInstance;
|
|
13313
13469
|
red: (text: string) => string;
|
|
13314
13470
|
green: (text: string) => string;
|
|
13315
13471
|
yellow: (text: string) => string;
|
|
@@ -13589,6 +13745,13 @@ declare function bv2av(bvid: string): number;
|
|
|
13589
13745
|
*/
|
|
13590
13746
|
declare function wbi_sign(BASEURL: string | URL, cookie: string): Promise<string>;
|
|
13591
13747
|
|
|
13748
|
+
/**
|
|
13749
|
+
* 哔哩哔哩API官方HTTP请求错误码
|
|
13750
|
+
*/
|
|
13751
|
+
declare const bilibiliErrorCodeMap: {
|
|
13752
|
+
[key: string]: string;
|
|
13753
|
+
};
|
|
13754
|
+
|
|
13592
13755
|
declare function qtparam(BASEURL: string, cookie: string): Promise<{
|
|
13593
13756
|
QUERY: string;
|
|
13594
13757
|
STATUS: string;
|
|
@@ -14068,7 +14231,7 @@ type AmagiConstructor = {
|
|
|
14068
14231
|
* @param options - 请求参数,是一个对象
|
|
14069
14232
|
* @returns 返回接口的原始数据
|
|
14070
14233
|
*/
|
|
14071
|
-
getDouyinData:
|
|
14234
|
+
getDouyinData: typeof douyinUtils.getDouyinData;
|
|
14072
14235
|
/**
|
|
14073
14236
|
* 快捷获取B站数据
|
|
14074
14237
|
* @param type - 请求数据类型
|
|
@@ -14076,7 +14239,7 @@ type AmagiConstructor = {
|
|
|
14076
14239
|
* @param options - 请求参数,是一个对象
|
|
14077
14240
|
* @returns 返回接口的原始数据
|
|
14078
14241
|
*/
|
|
14079
|
-
getBilibiliData:
|
|
14242
|
+
getBilibiliData: typeof bilibiliUtils.getBilibiliData;
|
|
14080
14243
|
/**
|
|
14081
14244
|
* 快捷获取快手数据
|
|
14082
14245
|
* @param type - 请求数据类型
|
|
@@ -14084,7 +14247,7 @@ type AmagiConstructor = {
|
|
|
14084
14247
|
* @param options - 请求参数,是一个对象
|
|
14085
14248
|
* @returns 返回接口的原始数据
|
|
14086
14249
|
*/
|
|
14087
|
-
getKuaishouData:
|
|
14250
|
+
getKuaishouData: typeof kuaishouUtils.getKuaishouData;
|
|
14088
14251
|
};
|
|
14089
14252
|
/** After instantiation, it can interact with the specified platform API to quickly obtain data. */
|
|
14090
14253
|
declare const CreateApp: AmagiConstructor;
|
|
@@ -14092,4 +14255,4 @@ declare const CreateApp: AmagiConstructor;
|
|
|
14092
14255
|
declare const Client: AmagiConstructor;
|
|
14093
14256
|
declare const amagi: AmagiConstructor;
|
|
14094
14257
|
|
|
14095
|
-
export { type BiliAv2Bv, type BiliBangumiVideoInfo, type BiliBangumiVideoPlayurlIsLogin, type BiliBangumiVideoPlayurlNoLogin, type BiliBiliVideoPlayurlNoLogin, type BiliBv2AV, type BiliCheckQrcode, type BiliDynamicCard, type BiliDynamicInfo, type BiliEmojiList, type BiliLiveRoomDef, type BiliLiveRoomDetail, type BiliNewLoginQrcode, type BiliOneWork, type BiliUserDynamic, type BiliUserFullView, type BiliUserProfile, type BiliVideoPlayurlIsLogin, type BiliWorkComments, type BilibiliDataOptions, type BilibiliDataOptionsMap, type BilibiliMethodOptionsMap, type BilibiliRequest, BilibiliValidateData, CreateApp, type DouyinDataOptions, type DouyinDataOptionsMap, type DouyinMethodOptionsMap, type DouyinRequest, DouyinValidateData, type DyEmojiList, type DyEmojiProList, type DyImageAlbumWork, type DyMusicWork, type DySearchInfo, type DySlidesWork, type DySuggestWords, type DyUserInfo, type DyUserLiveVideos, type DyUserPostVideos, type DyVideoWork, type DyWorkComments, type KsEmojiList, type KsOneWork, type KsWorkComments, KuaishouAPI, type KuaishouDataOptions, type KuaishouDataOptionsMap, type KuaishouMethodOptionsMap, type KusiahouRequest, KusiahouValidateData, Networks, type NetworksConfigType, type OmitMethodType, type TypeControl, amagi, amagiClient, av2bv, bilibili, bilibiliAPI, bilibiliApiUrls, bilibiliUtils, bv2av, type cookiesOptions, Client as default, douyin, douyinAPI, douyinApiUrls, douyinSign, douyinUtils, fetchBilibiliData, fetchDouyinData, fetchKuaishouData, getBilibiliData, getDouyinData, getKuaishouData, kuaishou, kuaishouAPI, kuaishouApiUrls, kuaishouUtils, logMiddleware, logger, qtparam, registerBilibiliRoutes, registerDouyinRoutes, registerKuaishouRoutes, wbi_sign };
|
|
14258
|
+
export { type APIErrorType, type BiliAv2Bv, type BiliBangumiVideoInfo, type BiliBangumiVideoPlayurlIsLogin, type BiliBangumiVideoPlayurlNoLogin, type BiliBiliVideoPlayurlNoLogin, type BiliBv2AV, type BiliCheckQrcode, type BiliDynamicCard, type BiliDynamicInfo, type BiliEmojiList, type BiliLiveRoomDef, type BiliLiveRoomDetail, type BiliNewLoginQrcode, type BiliOneWork, type BiliUserDynamic, type BiliUserFullView, type BiliUserProfile, type BiliVideoPlayurlIsLogin, type BiliWorkComments, type BilibiliDataOptions, type BilibiliDataOptionsMap, type BilibiliMethodOptionsMap, type BilibiliRequest, BilibiliValidateData, CreateApp, type DouyinDataOptions, type DouyinDataOptionsMap, type DouyinMethodOptionsMap, type DouyinRequest, DouyinValidateData, type DyEmojiList, type DyEmojiProList, type DyImageAlbumWork, type DyMusicWork, type DySearchInfo, type DySlidesWork, type DySuggestWords, type DyUserInfo, type DyUserLiveVideos, type DyUserPostVideos, type DyVideoWork, type DyWorkComments, type KsEmojiList, type KsOneWork, type KsWorkComments, KuaishouAPI, type KuaishouDataOptions, type KuaishouDataOptionsMap, type KuaishouMethodOptionsMap, type KusiahouRequest, KusiahouValidateData, Networks, type NetworksConfigType, type OmitMethodType, type TypeControl, amagi, amagiClient, av2bv, bilibili, bilibiliAPI, bilibiliApiUrls, bilibiliErrorCodeMap, bilibiliUtils, bv2av, type cookiesOptions, Client as default, douyin, douyinAPI, douyinApiUrls, douyinSign, douyinUtils, fetchBilibiliData, fetchDouyinData, fetchKuaishouData, getBilibiliData, getDouyinData, getKuaishouData, kuaishou, kuaishouAPI, kuaishouApiUrls, kuaishouUtils, logMiddleware, logger, qtparam, registerBilibiliRoutes, registerDouyinRoutes, registerKuaishouRoutes, wbi_sign };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikenxuan/amagi",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.18",
|
|
4
4
|
"description": "抖音、B站的 web 端相关数据接口基于 Node.js 的实现",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"douyin",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"sort": "npx sort-package-json"
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
|
-
"axios": "npm:@karinjs/axios@^1.
|
|
64
|
-
"chalk": "4.1
|
|
63
|
+
"axios": "npm:@karinjs/axios@^1.2.0",
|
|
64
|
+
"chalk": "5.4.1",
|
|
65
65
|
"express": "npm:@karinjs/express@^1.0.3",
|
|
66
66
|
"log4js": "npm:@karinjs/log4js@1.1.4",
|
|
67
67
|
"pino-pretty": "^13.0.0"
|