@ikenxuan/amagi 4.4.7-pr103.ca19953 → 4.4.7
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 +11 -15
- package/dist/default/esm/index.mjs +10 -14
- package/dist/default/index.d.ts +3 -6
- package/package.json +19 -1
|
@@ -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');
|
|
7
8
|
var chalk = require('chalk');
|
|
8
9
|
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);
|
|
15
16
|
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
16
17
|
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,9 +535,8 @@ 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
|
-
|
|
540
|
-
var registerBilibiliRoutes = (router, cookie) => {
|
|
538
|
+
var registerBilibiliRoutes = (cookie) => {
|
|
539
|
+
const router = express__default.default.Router();
|
|
541
540
|
router.get("/new_login_qrcode", async (req, res) => {
|
|
542
541
|
const data2 = await BilibiliData({
|
|
543
542
|
methodType: "\u7533\u8BF7\u4E8C\u7EF4\u7801"
|
|
@@ -1384,9 +1383,8 @@ async function GlobalGetData2(options) {
|
|
|
1384
1383
|
}
|
|
1385
1384
|
return ResponseData;
|
|
1386
1385
|
}
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
var registerDouyinRoutes = (router, cookie) => {
|
|
1386
|
+
var registerDouyinRoutes = (cookie) => {
|
|
1387
|
+
const router = express__default.default.Router();
|
|
1390
1388
|
router.get("/fetch_one_work", async (req, res) => {
|
|
1391
1389
|
const data2 = await DouyinData({
|
|
1392
1390
|
methodType: "\u805A\u5408\u89E3\u6790",
|
|
@@ -1590,9 +1588,8 @@ async function GlobalGetData3(options) {
|
|
|
1590
1588
|
}
|
|
1591
1589
|
return ResponseData;
|
|
1592
1590
|
}
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
var registerKuaishouRoutes = (router, cookie) => {
|
|
1591
|
+
var registerKuaishouRoutes = (cookie) => {
|
|
1592
|
+
const router = express__default.default.Router();
|
|
1596
1593
|
router.get("/fetch_one_work", async (req, res) => {
|
|
1597
1594
|
const data2 = await KuaishouData({
|
|
1598
1595
|
methodType: "\u5355\u4E2A\u89C6\u9891\u4F5C\u54C1\u6570\u636E",
|
|
@@ -1932,16 +1929,15 @@ var amagi = class {
|
|
|
1932
1929
|
*/
|
|
1933
1930
|
startClient(port = 4567) {
|
|
1934
1931
|
const app = express__default.default();
|
|
1935
|
-
const router = express.Router();
|
|
1936
1932
|
app.get("/", (_req, res) => {
|
|
1937
1933
|
res.redirect(301, "https://amagi.apifox.cn");
|
|
1938
1934
|
});
|
|
1939
1935
|
app.get("/docs", (_req, res) => {
|
|
1940
1936
|
res.redirect(301, "https://amagi.apifox.cn");
|
|
1941
1937
|
});
|
|
1942
|
-
app.use("/api/kuaishou", registerKuaishouRoutes(
|
|
1943
|
-
app.use("/api/douyin", registerDouyinRoutes(
|
|
1944
|
-
app.use("/api/bilibili", registerBilibiliRoutes(
|
|
1938
|
+
app.use("/api/kuaishou", registerKuaishouRoutes(this.kuaishou));
|
|
1939
|
+
app.use("/api/douyin", registerDouyinRoutes(this.douyin));
|
|
1940
|
+
app.use("/api/bilibili", registerBilibiliRoutes(this.bilibili));
|
|
1945
1941
|
app.use(logMiddleware);
|
|
1946
1942
|
app.listen(port, "::", () => {
|
|
1947
1943
|
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';
|
|
3
4
|
import chalk from 'chalk';
|
|
4
5
|
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,9 +523,8 @@ 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
|
-
|
|
528
|
-
var registerBilibiliRoutes = (router, cookie) => {
|
|
526
|
+
var registerBilibiliRoutes = (cookie) => {
|
|
527
|
+
const router = express.Router();
|
|
529
528
|
router.get("/new_login_qrcode", async (req, res) => {
|
|
530
529
|
const data2 = await BilibiliData({
|
|
531
530
|
methodType: "\u7533\u8BF7\u4E8C\u7EF4\u7801"
|
|
@@ -1372,9 +1371,8 @@ async function GlobalGetData2(options) {
|
|
|
1372
1371
|
}
|
|
1373
1372
|
return ResponseData;
|
|
1374
1373
|
}
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
var registerDouyinRoutes = (router, cookie) => {
|
|
1374
|
+
var registerDouyinRoutes = (cookie) => {
|
|
1375
|
+
const router = express.Router();
|
|
1378
1376
|
router.get("/fetch_one_work", async (req, res) => {
|
|
1379
1377
|
const data2 = await DouyinData({
|
|
1380
1378
|
methodType: "\u805A\u5408\u89E3\u6790",
|
|
@@ -1578,9 +1576,8 @@ async function GlobalGetData3(options) {
|
|
|
1578
1576
|
}
|
|
1579
1577
|
return ResponseData;
|
|
1580
1578
|
}
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
var registerKuaishouRoutes = (router, cookie) => {
|
|
1579
|
+
var registerKuaishouRoutes = (cookie) => {
|
|
1580
|
+
const router = express.Router();
|
|
1584
1581
|
router.get("/fetch_one_work", async (req, res) => {
|
|
1585
1582
|
const data2 = await KuaishouData({
|
|
1586
1583
|
methodType: "\u5355\u4E2A\u89C6\u9891\u4F5C\u54C1\u6570\u636E",
|
|
@@ -1920,16 +1917,15 @@ var amagi = class {
|
|
|
1920
1917
|
*/
|
|
1921
1918
|
startClient(port = 4567) {
|
|
1922
1919
|
const app = express();
|
|
1923
|
-
const router = Router();
|
|
1924
1920
|
app.get("/", (_req, res) => {
|
|
1925
1921
|
res.redirect(301, "https://amagi.apifox.cn");
|
|
1926
1922
|
});
|
|
1927
1923
|
app.get("/docs", (_req, res) => {
|
|
1928
1924
|
res.redirect(301, "https://amagi.apifox.cn");
|
|
1929
1925
|
});
|
|
1930
|
-
app.use("/api/kuaishou", registerKuaishouRoutes(
|
|
1931
|
-
app.use("/api/douyin", registerDouyinRoutes(
|
|
1932
|
-
app.use("/api/bilibili", registerBilibiliRoutes(
|
|
1926
|
+
app.use("/api/kuaishou", registerKuaishouRoutes(this.kuaishou));
|
|
1927
|
+
app.use("/api/douyin", registerDouyinRoutes(this.douyin));
|
|
1928
|
+
app.use("/api/bilibili", registerBilibiliRoutes(this.bilibili));
|
|
1933
1929
|
app.use(logMiddleware);
|
|
1934
1930
|
app.listen(port, "::", () => {
|
|
1935
1931
|
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
|
@@ -13769,10 +13769,9 @@ interface BilibiliRequest<T extends keyof BilibiliDataOptionsMap> extends Reques
|
|
|
13769
13769
|
}
|
|
13770
13770
|
/**
|
|
13771
13771
|
* 注册B站相关的API接口路由
|
|
13772
|
-
* @param router - 路由实例
|
|
13773
13772
|
* @param cookie - 有效的cookie
|
|
13774
13773
|
*/
|
|
13775
|
-
declare const registerBilibiliRoutes: (
|
|
13774
|
+
declare const registerBilibiliRoutes: (cookie: string) => Router;
|
|
13776
13775
|
|
|
13777
13776
|
declare function av2bv(aid: number): `BV1${string}`;
|
|
13778
13777
|
declare function bv2av(bvid: string): number;
|
|
@@ -13816,10 +13815,9 @@ interface DouyinRequest<T extends keyof DouyinDataOptionsMap> extends Request {
|
|
|
13816
13815
|
}
|
|
13817
13816
|
/**
|
|
13818
13817
|
* 注册抖音相关的API接口路由
|
|
13819
|
-
* @param router - 路由实例
|
|
13820
13818
|
* @param cookie - 有效的cookie
|
|
13821
13819
|
*/
|
|
13822
|
-
declare const registerDouyinRoutes: (
|
|
13820
|
+
declare const registerDouyinRoutes: (cookie: string) => Router;
|
|
13823
13821
|
|
|
13824
13822
|
type KuaishouMethodOptionsWithoutMethodType = {
|
|
13825
13823
|
[K in keyof KuaishouMethodOptionsMap]: OmitMethodType<KuaishouMethodOptionsMap[K]>;
|
|
@@ -13875,10 +13873,9 @@ interface KusiahouRequest<T extends keyof KuaishouDataOptionsMap> extends Reques
|
|
|
13875
13873
|
}
|
|
13876
13874
|
/**
|
|
13877
13875
|
* 注册快手相关的API接口路由
|
|
13878
|
-
* @param router - 路由实例
|
|
13879
13876
|
* @param cookie - 有效的cookie
|
|
13880
13877
|
*/
|
|
13881
|
-
declare const registerKuaishouRoutes: (
|
|
13878
|
+
declare const registerKuaishouRoutes: (cookie: string) => Router;
|
|
13882
13879
|
|
|
13883
13880
|
type ckParams = {
|
|
13884
13881
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ikenxuan/amagi",
|
|
3
|
-
"version": "4.4.7
|
|
3
|
+
"version": "4.4.7",
|
|
4
4
|
"description": "抖音、B站的 web 端相关数据接口基于 Node.js 的实现",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"douyin",
|
|
@@ -62,6 +62,24 @@
|
|
|
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": "^4.17.21",
|
|
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
|
+
},
|
|
65
83
|
"publishConfig": {
|
|
66
84
|
"access": "public",
|
|
67
85
|
"registry": "https://registry.npmjs.org"
|