@ikenxuan/amagi 4.4.15 → 4.4.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/default/cjs/index.cjs +28 -16
- package/dist/default/esm/index.mjs +28 -16
- package/dist/default/index.d.ts +31 -76
- package/package.json +3 -1
|
@@ -1660,7 +1660,7 @@ var douyinUtils = {
|
|
|
1660
1660
|
var defheaders2 = {
|
|
1661
1661
|
accept: "*/*",
|
|
1662
1662
|
priority: "u=0, i",
|
|
1663
|
-
"content-type": "application/json",
|
|
1663
|
+
"content-type": "application/json; charset=utf-8",
|
|
1664
1664
|
"accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
|
|
1665
1665
|
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36",
|
|
1666
1666
|
referer: "https://www.douyin.com/",
|
|
@@ -1892,10 +1892,12 @@ async function GlobalGetData2(options) {
|
|
|
1892
1892
|
try {
|
|
1893
1893
|
const result = await new Networks(options).getData();
|
|
1894
1894
|
if (result === "" || !result) {
|
|
1895
|
-
const warningMessage =
|
|
1896
|
-
\
|
|
1897
|
-
\
|
|
1898
|
-
\u8BF7\
|
|
1895
|
+
const warningMessage = `
|
|
1896
|
+
\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u63A5\u53E3\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A
|
|
1897
|
+
\u4F60\u7684\u6296\u97F3ck\u53EF\u80FD\u5DF2\u7ECF\u5931\u6548\uFF01
|
|
1898
|
+
\u8BF7\u6C42\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
1899
|
+
\u8BF7\u6C42URL\uFF1A ${options.url}
|
|
1900
|
+
`;
|
|
1899
1901
|
logger.warn(warningMessage);
|
|
1900
1902
|
throw {
|
|
1901
1903
|
...result,
|
|
@@ -1903,6 +1905,20 @@ async function GlobalGetData2(options) {
|
|
|
1903
1905
|
warning: warningMessage
|
|
1904
1906
|
};
|
|
1905
1907
|
}
|
|
1908
|
+
if (result.filter_detail && result.filter_detail.filter_reason) {
|
|
1909
|
+
const filterReason = result.filter_detail.filter_reason;
|
|
1910
|
+
const warningMessage = `
|
|
1911
|
+
\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u539F\u56E0\uFF1A${filterReason}
|
|
1912
|
+
\u8BF7\u6C42\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
1913
|
+
\u8BF7\u6C42URL\uFF1A ${options.url}
|
|
1914
|
+
`;
|
|
1915
|
+
logger.warn(warningMessage);
|
|
1916
|
+
throw {
|
|
1917
|
+
...result,
|
|
1918
|
+
code: result.status_code || 0,
|
|
1919
|
+
warning: warningMessage
|
|
1920
|
+
};
|
|
1921
|
+
}
|
|
1906
1922
|
return result;
|
|
1907
1923
|
} catch (error) {
|
|
1908
1924
|
if (error && typeof error === "object") {
|
|
@@ -2498,17 +2514,13 @@ function createAmagiClient(options = {}) {
|
|
|
2498
2514
|
}
|
|
2499
2515
|
return new amagiClient(options);
|
|
2500
2516
|
}
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
/** 快手相关功能模块 (工具集) */
|
|
2509
|
-
kuaishou: kuaishouUtils
|
|
2510
|
-
}
|
|
2511
|
-
);
|
|
2517
|
+
createAmagiClient.douyin = douyinUtils;
|
|
2518
|
+
createAmagiClient.bilibili = bilibiliUtils;
|
|
2519
|
+
createAmagiClient.kuaishou = kuaishouUtils;
|
|
2520
|
+
createAmagiClient.getDouyinData = () => douyinUtils.getDouyinData;
|
|
2521
|
+
createAmagiClient.getBilibiliData = () => bilibiliUtils.getBilibiliData;
|
|
2522
|
+
createAmagiClient.getKuaishouData = () => kuaishouUtils.getKuaishouData;
|
|
2523
|
+
var CreateApp = createAmagiClient;
|
|
2512
2524
|
var Client = CreateApp;
|
|
2513
2525
|
var amagi = Client;
|
|
2514
2526
|
|
|
@@ -1648,7 +1648,7 @@ var douyinUtils = {
|
|
|
1648
1648
|
var defheaders2 = {
|
|
1649
1649
|
accept: "*/*",
|
|
1650
1650
|
priority: "u=0, i",
|
|
1651
|
-
"content-type": "application/json",
|
|
1651
|
+
"content-type": "application/json; charset=utf-8",
|
|
1652
1652
|
"accept-language": "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6",
|
|
1653
1653
|
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36",
|
|
1654
1654
|
referer: "https://www.douyin.com/",
|
|
@@ -1880,10 +1880,12 @@ async function GlobalGetData2(options) {
|
|
|
1880
1880
|
try {
|
|
1881
1881
|
const result = await new Networks(options).getData();
|
|
1882
1882
|
if (result === "" || !result) {
|
|
1883
|
-
const warningMessage =
|
|
1884
|
-
\
|
|
1885
|
-
\
|
|
1886
|
-
\u8BF7\
|
|
1883
|
+
const warningMessage = `
|
|
1884
|
+
\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u63A5\u53E3\u8FD4\u56DE\u5185\u5BB9\u4E3A\u7A7A
|
|
1885
|
+
\u4F60\u7684\u6296\u97F3ck\u53EF\u80FD\u5DF2\u7ECF\u5931\u6548\uFF01
|
|
1886
|
+
\u8BF7\u6C42\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
1887
|
+
\u8BF7\u6C42URL\uFF1A ${options.url}
|
|
1888
|
+
`;
|
|
1887
1889
|
logger.warn(warningMessage);
|
|
1888
1890
|
throw {
|
|
1889
1891
|
...result,
|
|
@@ -1891,6 +1893,20 @@ async function GlobalGetData2(options) {
|
|
|
1891
1893
|
warning: warningMessage
|
|
1892
1894
|
};
|
|
1893
1895
|
}
|
|
1896
|
+
if (result.filter_detail && result.filter_detail.filter_reason) {
|
|
1897
|
+
const filterReason = result.filter_detail.filter_reason;
|
|
1898
|
+
const warningMessage = `
|
|
1899
|
+
\u83B7\u53D6\u54CD\u5E94\u6570\u636E\u5931\u8D25\uFF01\u539F\u56E0\uFF1A${filterReason}
|
|
1900
|
+
\u8BF7\u6C42\u7C7B\u578B\uFF1A\u300C${options.methodType}\u300D
|
|
1901
|
+
\u8BF7\u6C42URL\uFF1A ${options.url}
|
|
1902
|
+
`;
|
|
1903
|
+
logger.warn(warningMessage);
|
|
1904
|
+
throw {
|
|
1905
|
+
...result,
|
|
1906
|
+
code: result.status_code || 0,
|
|
1907
|
+
warning: warningMessage
|
|
1908
|
+
};
|
|
1909
|
+
}
|
|
1894
1910
|
return result;
|
|
1895
1911
|
} catch (error) {
|
|
1896
1912
|
if (error && typeof error === "object") {
|
|
@@ -2486,17 +2502,13 @@ function createAmagiClient(options = {}) {
|
|
|
2486
2502
|
}
|
|
2487
2503
|
return new amagiClient(options);
|
|
2488
2504
|
}
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
/** 快手相关功能模块 (工具集) */
|
|
2497
|
-
kuaishou: kuaishouUtils
|
|
2498
|
-
}
|
|
2499
|
-
);
|
|
2505
|
+
createAmagiClient.douyin = douyinUtils;
|
|
2506
|
+
createAmagiClient.bilibili = bilibiliUtils;
|
|
2507
|
+
createAmagiClient.kuaishou = kuaishouUtils;
|
|
2508
|
+
createAmagiClient.getDouyinData = () => douyinUtils.getDouyinData;
|
|
2509
|
+
createAmagiClient.getBilibiliData = () => bilibiliUtils.getBilibiliData;
|
|
2510
|
+
createAmagiClient.getKuaishouData = () => kuaishouUtils.getKuaishouData;
|
|
2511
|
+
var CreateApp = createAmagiClient;
|
|
2500
2512
|
var Client = CreateApp;
|
|
2501
2513
|
var amagi = Client;
|
|
2502
2514
|
|
package/dist/default/index.d.ts
CHANGED
|
@@ -14055,86 +14055,41 @@ declare class amagiClient {
|
|
|
14055
14055
|
type AmagiConstructor = {
|
|
14056
14056
|
new (options: cookiesOptions): amagiClient;
|
|
14057
14057
|
(options: cookiesOptions): amagiClient;
|
|
14058
|
-
};
|
|
14059
|
-
/** After instantiation, it can interact with the specified platform API to quickly obtain data. */
|
|
14060
|
-
declare const CreateApp: AmagiConstructor & {
|
|
14061
14058
|
/** 抖音相关功能模块 (工具集) */
|
|
14062
|
-
douyin:
|
|
14063
|
-
sign: typeof douyinSign;
|
|
14064
|
-
douyinApiUrls: typeof douyinApiUrls;
|
|
14065
|
-
getDouyinData: typeof getDouyinData;
|
|
14066
|
-
api: typeof douyin;
|
|
14067
|
-
};
|
|
14059
|
+
douyin: typeof douyinUtils;
|
|
14068
14060
|
/** B站相关功能模块 (工具集) */
|
|
14069
|
-
bilibili:
|
|
14070
|
-
sign: {
|
|
14071
|
-
wbi_sign: typeof wbi_sign;
|
|
14072
|
-
av2bv: typeof av2bv;
|
|
14073
|
-
bv2av: typeof bv2av;
|
|
14074
|
-
};
|
|
14075
|
-
bilibiliApiUrls: typeof bilibiliApiUrls;
|
|
14076
|
-
getBilibiliData: typeof getBilibiliData;
|
|
14077
|
-
api: typeof bilibili;
|
|
14078
|
-
};
|
|
14061
|
+
bilibili: typeof bilibiliUtils;
|
|
14079
14062
|
/** 快手相关功能模块 (工具集) */
|
|
14080
|
-
kuaishou:
|
|
14081
|
-
|
|
14082
|
-
|
|
14083
|
-
|
|
14084
|
-
|
|
14063
|
+
kuaishou: typeof kuaishouUtils;
|
|
14064
|
+
/**
|
|
14065
|
+
* 快捷获取抖音数据
|
|
14066
|
+
* @param type - 请求数据类型
|
|
14067
|
+
* @param cookie - 有效的用户Cookie
|
|
14068
|
+
* @param options - 请求参数,是一个对象
|
|
14069
|
+
* @returns 返回接口的原始数据
|
|
14070
|
+
*/
|
|
14071
|
+
getDouyinData: () => typeof douyinUtils.getDouyinData;
|
|
14072
|
+
/**
|
|
14073
|
+
* 快捷获取B站数据
|
|
14074
|
+
* @param type - 请求数据类型
|
|
14075
|
+
* @param cookie - 有效的用户Cookie
|
|
14076
|
+
* @param options - 请求参数,是一个对象
|
|
14077
|
+
* @returns 返回接口的原始数据
|
|
14078
|
+
*/
|
|
14079
|
+
getBilibiliData: () => typeof bilibiliUtils.getBilibiliData;
|
|
14080
|
+
/**
|
|
14081
|
+
* 快捷获取快手数据
|
|
14082
|
+
* @param type - 请求数据类型
|
|
14083
|
+
* @param cookie - 有效的用户Cookie
|
|
14084
|
+
* @param options - 请求参数,是一个对象
|
|
14085
|
+
* @returns 返回接口的原始数据
|
|
14086
|
+
*/
|
|
14087
|
+
getKuaishouData: () => typeof kuaishouUtils.getKuaishouData;
|
|
14085
14088
|
};
|
|
14086
14089
|
/** After instantiation, it can interact with the specified platform API to quickly obtain data. */
|
|
14087
|
-
declare const
|
|
14088
|
-
|
|
14089
|
-
|
|
14090
|
-
|
|
14091
|
-
douyinApiUrls: typeof douyinApiUrls;
|
|
14092
|
-
getDouyinData: typeof getDouyinData;
|
|
14093
|
-
api: typeof douyin;
|
|
14094
|
-
};
|
|
14095
|
-
/** B站相关功能模块 (工具集) */
|
|
14096
|
-
bilibili: {
|
|
14097
|
-
sign: {
|
|
14098
|
-
wbi_sign: typeof wbi_sign;
|
|
14099
|
-
av2bv: typeof av2bv;
|
|
14100
|
-
bv2av: typeof bv2av;
|
|
14101
|
-
};
|
|
14102
|
-
bilibiliApiUrls: typeof bilibiliApiUrls;
|
|
14103
|
-
getBilibiliData: typeof getBilibiliData;
|
|
14104
|
-
api: typeof bilibili;
|
|
14105
|
-
};
|
|
14106
|
-
/** 快手相关功能模块 (工具集) */
|
|
14107
|
-
kuaishou: {
|
|
14108
|
-
kuaishouApiUrls: typeof kuaishouApiUrls;
|
|
14109
|
-
getKuaishouData: typeof getKuaishouData;
|
|
14110
|
-
api: typeof kuaishou;
|
|
14111
|
-
};
|
|
14112
|
-
};
|
|
14113
|
-
declare const amagi: AmagiConstructor & {
|
|
14114
|
-
/** 抖音相关功能模块 (工具集) */
|
|
14115
|
-
douyin: {
|
|
14116
|
-
sign: typeof douyinSign;
|
|
14117
|
-
douyinApiUrls: typeof douyinApiUrls;
|
|
14118
|
-
getDouyinData: typeof getDouyinData;
|
|
14119
|
-
api: typeof douyin;
|
|
14120
|
-
};
|
|
14121
|
-
/** B站相关功能模块 (工具集) */
|
|
14122
|
-
bilibili: {
|
|
14123
|
-
sign: {
|
|
14124
|
-
wbi_sign: typeof wbi_sign;
|
|
14125
|
-
av2bv: typeof av2bv;
|
|
14126
|
-
bv2av: typeof bv2av;
|
|
14127
|
-
};
|
|
14128
|
-
bilibiliApiUrls: typeof bilibiliApiUrls;
|
|
14129
|
-
getBilibiliData: typeof getBilibiliData;
|
|
14130
|
-
api: typeof bilibili;
|
|
14131
|
-
};
|
|
14132
|
-
/** 快手相关功能模块 (工具集) */
|
|
14133
|
-
kuaishou: {
|
|
14134
|
-
kuaishouApiUrls: typeof kuaishouApiUrls;
|
|
14135
|
-
getKuaishouData: typeof getKuaishouData;
|
|
14136
|
-
api: typeof kuaishou;
|
|
14137
|
-
};
|
|
14138
|
-
};
|
|
14090
|
+
declare const CreateApp: AmagiConstructor;
|
|
14091
|
+
/** After instantiation, it can interact with the specified platform API to quickly obtain data. */
|
|
14092
|
+
declare const Client: AmagiConstructor;
|
|
14093
|
+
declare const amagi: AmagiConstructor;
|
|
14139
14094
|
|
|
14140
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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikenxuan/amagi",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.16",
|
|
4
4
|
"description": "抖音、B站的 web 端相关数据接口基于 Node.js 的实现",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"douyin",
|
|
@@ -69,10 +69,12 @@
|
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@eslint/js": "^9.17.0",
|
|
71
71
|
"@swc/core": "^1.10.12",
|
|
72
|
+
"@types/crypto-js": "^4.2.2",
|
|
72
73
|
"@types/express": "^4.17.21",
|
|
73
74
|
"@types/node": "^22.10.2",
|
|
74
75
|
"@typescript-eslint/eslint-plugin": "^8.18.1",
|
|
75
76
|
"@typescript-eslint/parser": "^8.18.1",
|
|
77
|
+
"crypto-js": "^4.2.0",
|
|
76
78
|
"eslint": "^9.17.0",
|
|
77
79
|
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
78
80
|
"globals": "^15.14.0",
|