@ikenxuan/amagi 4.4.6 → 4.4.7-pr103.41febb6
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 +15 -11
- package/dist/default/esm/index.mjs +14 -10
- package/dist/default/index.d.ts +8 -5
- package/package.json +1 -19
|
@@ -4,17 +4,17 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var axios = require('axios');
|
|
6
6
|
var crypto = require('crypto');
|
|
7
|
-
var express = require('express');
|
|
8
7
|
var chalk = require('chalk');
|
|
9
8
|
var log4js = require('log4js');
|
|
9
|
+
var express = require('express');
|
|
10
10
|
|
|
11
11
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
12
|
|
|
13
13
|
var axios__default = /*#__PURE__*/_interopDefault(axios);
|
|
14
14
|
var crypto__default = /*#__PURE__*/_interopDefault(crypto);
|
|
15
|
-
var express__default = /*#__PURE__*/_interopDefault(express);
|
|
16
15
|
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
17
16
|
var log4js__default = /*#__PURE__*/_interopDefault(log4js);
|
|
17
|
+
var express__default = /*#__PURE__*/_interopDefault(express);
|
|
18
18
|
|
|
19
19
|
// src/platform/bilibili/API.ts
|
|
20
20
|
var BiLiBiLiAPI = class {
|
|
@@ -535,8 +535,9 @@ async function wbi_sign(BASEURL, cookie) {
|
|
|
535
535
|
const query = encWbi(params, web_keys.img_key, web_keys.sub_key);
|
|
536
536
|
return query;
|
|
537
537
|
}
|
|
538
|
-
|
|
539
|
-
|
|
538
|
+
|
|
539
|
+
// src/platform/bilibili/routes.ts
|
|
540
|
+
var registerBilibiliRoutes = (router, cookie) => {
|
|
540
541
|
router.get("/new_login_qrcode", async (req, res) => {
|
|
541
542
|
const data2 = await BilibiliData({
|
|
542
543
|
methodType: "\u7533\u8BF7\u4E8C\u7EF4\u7801"
|
|
@@ -1383,8 +1384,9 @@ async function GlobalGetData2(options) {
|
|
|
1383
1384
|
}
|
|
1384
1385
|
return ResponseData;
|
|
1385
1386
|
}
|
|
1386
|
-
|
|
1387
|
-
|
|
1387
|
+
|
|
1388
|
+
// src/platform/douyin/routes.ts
|
|
1389
|
+
var registerDouyinRoutes = (router, cookie) => {
|
|
1388
1390
|
router.get("/fetch_one_work", async (req, res) => {
|
|
1389
1391
|
const data2 = await DouyinData({
|
|
1390
1392
|
methodType: "\u805A\u5408\u89E3\u6790",
|
|
@@ -1588,8 +1590,9 @@ async function GlobalGetData3(options) {
|
|
|
1588
1590
|
}
|
|
1589
1591
|
return ResponseData;
|
|
1590
1592
|
}
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
+
|
|
1594
|
+
// src/platform/kuaishou/routes.ts
|
|
1595
|
+
var registerKuaishouRoutes = (router, cookie) => {
|
|
1593
1596
|
router.get("/fetch_one_work", async (req, res) => {
|
|
1594
1597
|
const data2 = await KuaishouData({
|
|
1595
1598
|
methodType: "\u5355\u4E2A\u89C6\u9891\u4F5C\u54C1\u6570\u636E",
|
|
@@ -1929,15 +1932,16 @@ var amagi = class {
|
|
|
1929
1932
|
*/
|
|
1930
1933
|
startClient(port = 4567) {
|
|
1931
1934
|
const app = express__default.default();
|
|
1935
|
+
const router = express.Router();
|
|
1932
1936
|
app.get("/", (_req, res) => {
|
|
1933
1937
|
res.redirect(301, "https://amagi.apifox.cn");
|
|
1934
1938
|
});
|
|
1935
1939
|
app.get("/docs", (_req, res) => {
|
|
1936
1940
|
res.redirect(301, "https://amagi.apifox.cn");
|
|
1937
1941
|
});
|
|
1938
|
-
app.use("/api/kuaishou", registerKuaishouRoutes(this.kuaishou));
|
|
1939
|
-
app.use("/api/douyin", registerDouyinRoutes(this.douyin));
|
|
1940
|
-
app.use("/api/bilibili", registerBilibiliRoutes(this.bilibili));
|
|
1942
|
+
app.use("/api/kuaishou", registerKuaishouRoutes(router, this.kuaishou));
|
|
1943
|
+
app.use("/api/douyin", registerDouyinRoutes(router, this.douyin));
|
|
1944
|
+
app.use("/api/bilibili", registerBilibiliRoutes(router, this.bilibili));
|
|
1941
1945
|
app.use(logMiddleware);
|
|
1942
1946
|
app.listen(port, "::", () => {
|
|
1943
1947
|
logger.mark(`Amagi server listening on ${logger.green(`http://localhost:${port}`)} ${logger.yellow("API docs: https://amagi.apifox.cn ")}`);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import axios, { AxiosError } from 'axios';
|
|
2
2
|
import crypto from 'crypto';
|
|
3
|
-
import express from 'express';
|
|
4
3
|
import chalk from 'chalk';
|
|
5
4
|
import log4js from 'log4js';
|
|
5
|
+
import express, { Router } from 'express';
|
|
6
6
|
|
|
7
7
|
// src/platform/bilibili/API.ts
|
|
8
8
|
var BiLiBiLiAPI = class {
|
|
@@ -523,8 +523,9 @@ async function wbi_sign(BASEURL, cookie) {
|
|
|
523
523
|
const query = encWbi(params, web_keys.img_key, web_keys.sub_key);
|
|
524
524
|
return query;
|
|
525
525
|
}
|
|
526
|
-
|
|
527
|
-
|
|
526
|
+
|
|
527
|
+
// src/platform/bilibili/routes.ts
|
|
528
|
+
var registerBilibiliRoutes = (router, cookie) => {
|
|
528
529
|
router.get("/new_login_qrcode", async (req, res) => {
|
|
529
530
|
const data2 = await BilibiliData({
|
|
530
531
|
methodType: "\u7533\u8BF7\u4E8C\u7EF4\u7801"
|
|
@@ -1371,8 +1372,9 @@ async function GlobalGetData2(options) {
|
|
|
1371
1372
|
}
|
|
1372
1373
|
return ResponseData;
|
|
1373
1374
|
}
|
|
1374
|
-
|
|
1375
|
-
|
|
1375
|
+
|
|
1376
|
+
// src/platform/douyin/routes.ts
|
|
1377
|
+
var registerDouyinRoutes = (router, cookie) => {
|
|
1376
1378
|
router.get("/fetch_one_work", async (req, res) => {
|
|
1377
1379
|
const data2 = await DouyinData({
|
|
1378
1380
|
methodType: "\u805A\u5408\u89E3\u6790",
|
|
@@ -1576,8 +1578,9 @@ async function GlobalGetData3(options) {
|
|
|
1576
1578
|
}
|
|
1577
1579
|
return ResponseData;
|
|
1578
1580
|
}
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
+
|
|
1582
|
+
// src/platform/kuaishou/routes.ts
|
|
1583
|
+
var registerKuaishouRoutes = (router, cookie) => {
|
|
1581
1584
|
router.get("/fetch_one_work", async (req, res) => {
|
|
1582
1585
|
const data2 = await KuaishouData({
|
|
1583
1586
|
methodType: "\u5355\u4E2A\u89C6\u9891\u4F5C\u54C1\u6570\u636E",
|
|
@@ -1917,15 +1920,16 @@ var amagi = class {
|
|
|
1917
1920
|
*/
|
|
1918
1921
|
startClient(port = 4567) {
|
|
1919
1922
|
const app = express();
|
|
1923
|
+
const router = Router();
|
|
1920
1924
|
app.get("/", (_req, res) => {
|
|
1921
1925
|
res.redirect(301, "https://amagi.apifox.cn");
|
|
1922
1926
|
});
|
|
1923
1927
|
app.get("/docs", (_req, res) => {
|
|
1924
1928
|
res.redirect(301, "https://amagi.apifox.cn");
|
|
1925
1929
|
});
|
|
1926
|
-
app.use("/api/kuaishou", registerKuaishouRoutes(this.kuaishou));
|
|
1927
|
-
app.use("/api/douyin", registerDouyinRoutes(this.douyin));
|
|
1928
|
-
app.use("/api/bilibili", registerBilibiliRoutes(this.bilibili));
|
|
1930
|
+
app.use("/api/kuaishou", registerKuaishouRoutes(router, this.kuaishou));
|
|
1931
|
+
app.use("/api/douyin", registerDouyinRoutes(router, this.douyin));
|
|
1932
|
+
app.use("/api/bilibili", registerBilibiliRoutes(router, this.bilibili));
|
|
1929
1933
|
app.use(logMiddleware);
|
|
1930
1934
|
app.listen(port, "::", () => {
|
|
1931
1935
|
logger.mark(`Amagi server listening on ${logger.green(`http://localhost:${port}`)} ${logger.yellow("API docs: https://amagi.apifox.cn ")}`);
|
package/dist/default/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import express, {
|
|
2
|
+
import express, { RequestHandler, Request, Router } from 'express';
|
|
3
3
|
import { AxiosRequestConfig, AxiosResponse } from 'axios';
|
|
4
4
|
|
|
5
5
|
interface BilibiliMethodOptionsMap {
|
|
@@ -13664,7 +13664,7 @@ declare class CustomLogger {
|
|
|
13664
13664
|
}
|
|
13665
13665
|
declare const logger: CustomLogger;
|
|
13666
13666
|
|
|
13667
|
-
declare const logMiddleware:
|
|
13667
|
+
declare const logMiddleware: RequestHandler;
|
|
13668
13668
|
|
|
13669
13669
|
interface HeadersObject {
|
|
13670
13670
|
[key: string]: string;
|
|
@@ -13769,9 +13769,10 @@ interface BilibiliRequest<T extends keyof BilibiliDataOptionsMap> extends Reques
|
|
|
13769
13769
|
}
|
|
13770
13770
|
/**
|
|
13771
13771
|
* 注册B站相关的API接口路由
|
|
13772
|
+
* @param router - 路由实例
|
|
13772
13773
|
* @param cookie - 有效的cookie
|
|
13773
13774
|
*/
|
|
13774
|
-
declare const registerBilibiliRoutes: (cookie: string) => Router;
|
|
13775
|
+
declare const registerBilibiliRoutes: (router: Router, cookie: string) => Router;
|
|
13775
13776
|
|
|
13776
13777
|
declare function av2bv(aid: number): `BV1${string}`;
|
|
13777
13778
|
declare function bv2av(bvid: string): number;
|
|
@@ -13815,9 +13816,10 @@ interface DouyinRequest<T extends keyof DouyinDataOptionsMap> extends Request {
|
|
|
13815
13816
|
}
|
|
13816
13817
|
/**
|
|
13817
13818
|
* 注册抖音相关的API接口路由
|
|
13819
|
+
* @param router - 路由实例
|
|
13818
13820
|
* @param cookie - 有效的cookie
|
|
13819
13821
|
*/
|
|
13820
|
-
declare const registerDouyinRoutes: (cookie: string) => Router;
|
|
13822
|
+
declare const registerDouyinRoutes: (router: Router, cookie: string) => Router;
|
|
13821
13823
|
|
|
13822
13824
|
type KuaishouMethodOptionsWithoutMethodType = {
|
|
13823
13825
|
[K in keyof KuaishouMethodOptionsMap]: OmitMethodType<KuaishouMethodOptionsMap[K]>;
|
|
@@ -13873,9 +13875,10 @@ interface KusiahouRequest<T extends keyof KuaishouDataOptionsMap> extends Reques
|
|
|
13873
13875
|
}
|
|
13874
13876
|
/**
|
|
13875
13877
|
* 注册快手相关的API接口路由
|
|
13878
|
+
* @param router - 路由实例
|
|
13876
13879
|
* @param cookie - 有效的cookie
|
|
13877
13880
|
*/
|
|
13878
|
-
declare const registerKuaishouRoutes: (cookie: string) => Router;
|
|
13881
|
+
declare const registerKuaishouRoutes: (router: Router, cookie: string) => Router;
|
|
13879
13882
|
|
|
13880
13883
|
type ckParams = {
|
|
13881
13884
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikenxuan/amagi",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.7-pr103.41febb6",
|
|
4
4
|
"description": "抖音、B站的 web 端相关数据接口基于 Node.js 的实现",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"douyin",
|
|
@@ -62,24 +62,6 @@
|
|
|
62
62
|
"log4js": "6.9.0",
|
|
63
63
|
"pino-pretty": "^13.0.0"
|
|
64
64
|
},
|
|
65
|
-
"devDependencies": {
|
|
66
|
-
"@eslint/js": "^9.17.0",
|
|
67
|
-
"@swc/core": "^1.10.12",
|
|
68
|
-
"@types/express": "^5.0.0",
|
|
69
|
-
"@types/lodash": "^4.17.13",
|
|
70
|
-
"@types/node": "^22.10.2",
|
|
71
|
-
"@typescript-eslint/eslint-plugin": "^8.18.1",
|
|
72
|
-
"@typescript-eslint/parser": "^8.18.1",
|
|
73
|
-
"eslint": "^9.17.0",
|
|
74
|
-
"eslint-plugin-simple-import-sort": "^12.1.1",
|
|
75
|
-
"globals": "^15.14.0",
|
|
76
|
-
"neostandard": "^0.12.0",
|
|
77
|
-
"sort-package-json": "^2.12.0",
|
|
78
|
-
"tsc-alias": "^1.8.10",
|
|
79
|
-
"tsup": "^8.3.6",
|
|
80
|
-
"tsx": "^4.19.2",
|
|
81
|
-
"typescript": "^5.7.2"
|
|
82
|
-
},
|
|
83
65
|
"publishConfig": {
|
|
84
66
|
"access": "public",
|
|
85
67
|
"registry": "https://registry.npmjs.org"
|