@ikenxuan/amagi 4.4.17 → 4.4.19
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 +14 -7
- package/dist/default/cjs/index.cjs +74 -24
- package/dist/default/esm/index.mjs +69 -25
- package/dist/default/index.d.ts +10 -8
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,20 +1,19 @@
|
|
|
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/ 名称灵感来源于网络谐音梗,在网络上 [BV1St41137jm](https://www.bilibili.com/video/BV1St41137jm) 上广泛传播。🎤💃
|
|
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
|
|
|
@@ -26,8 +25,15 @@ pnpm add @ikenxuan/amagi@latest
|
|
|
26
25
|
|
|
27
26
|
### 基本用法 ✨
|
|
28
27
|
主要就两个方法,`getDouyinData` 和 `getBilibiliData`。
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
|
|
29
|
+
> 它接收三个参数,
|
|
30
|
+
> * 第一个参数是对应平台封装好的数据接口名称
|
|
31
|
+
> * 第二个参数是接口所需的参数
|
|
32
|
+
> * 第三个参数是用户的 cookies。
|
|
33
|
+
> * 得益于函数重载,参数二和参数三可以互换位置
|
|
34
|
+
|
|
35
|
+
你可以通过直接导入或者构造器创建实例。
|
|
36
|
+
若通过构造器创建实例,就不需要传入 cookies 参数了,参数二默认接口所需参数。
|
|
31
37
|
|
|
32
38
|
```javascript
|
|
33
39
|
import Client from '@ikenxuan/amagi'
|
|
@@ -155,6 +161,7 @@ const userInfo = await bilibiliUtils.getBilibiliData(
|
|
|
155
161
|
## 类型支持 🧰
|
|
156
162
|
|
|
157
163
|
该库提供完整的 TypeScript 类型支持,可以获得良好的代码提示和类型检查。✅
|
|
164
|
+
虽有类型但写得和迷宫一样
|
|
158
165
|
|
|
159
166
|
## 许可证 📜
|
|
160
167
|
|
|
@@ -7,14 +7,22 @@ var crypto = require('crypto');
|
|
|
7
7
|
var express = require('express');
|
|
8
8
|
var chalk = require('chalk');
|
|
9
9
|
var log4js = require('log4js');
|
|
10
|
+
var path = require('path');
|
|
11
|
+
var url = require('url');
|
|
12
|
+
var fs = require('fs');
|
|
10
13
|
|
|
11
14
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
15
|
|
|
13
16
|
var axios__default = /*#__PURE__*/_interopDefault(axios);
|
|
14
17
|
var crypto__default = /*#__PURE__*/_interopDefault(crypto);
|
|
15
18
|
var express__default = /*#__PURE__*/_interopDefault(express);
|
|
16
|
-
var chalk__default = /*#__PURE__*/_interopDefault(chalk);
|
|
17
19
|
var log4js__default = /*#__PURE__*/_interopDefault(log4js);
|
|
20
|
+
var path__default = /*#__PURE__*/_interopDefault(path);
|
|
21
|
+
var fs__default = /*#__PURE__*/_interopDefault(fs);
|
|
22
|
+
|
|
23
|
+
// node_modules/tsup/assets/cjs_shims.js
|
|
24
|
+
var getImportMetaUrl = () => typeof document === "undefined" ? new URL(`file:${__filename}`).href : document.currentScript && document.currentScript.src || new URL("main.js", document.baseURI).href;
|
|
25
|
+
var importMetaUrl = /* @__PURE__ */ getImportMetaUrl();
|
|
18
26
|
|
|
19
27
|
// src/platform/bilibili/API.ts
|
|
20
28
|
var BiLiBiLiAPI = class {
|
|
@@ -2242,6 +2250,20 @@ async function getKuaishouData(methodType, arg2, arg3) {
|
|
|
2242
2250
|
var fetchDouyinData = getDouyinData;
|
|
2243
2251
|
var fetchBilibiliData = getBilibiliData;
|
|
2244
2252
|
var fetchKuaishouData = getKuaishouData;
|
|
2253
|
+
var getPackageLogsPath = () => {
|
|
2254
|
+
const currentFileUrl = importMetaUrl;
|
|
2255
|
+
const currentFilePath = url.fileURLToPath(currentFileUrl);
|
|
2256
|
+
const currentDir = path__default.default.dirname(currentFilePath);
|
|
2257
|
+
let packageRoot = currentDir;
|
|
2258
|
+
while (packageRoot !== path__default.default.dirname(packageRoot)) {
|
|
2259
|
+
if (fs__default.default.existsSync(path__default.default.join(packageRoot, "package.json"))) {
|
|
2260
|
+
break;
|
|
2261
|
+
}
|
|
2262
|
+
packageRoot = path__default.default.dirname(packageRoot);
|
|
2263
|
+
}
|
|
2264
|
+
return path__default.default.join(packageRoot, "logs");
|
|
2265
|
+
};
|
|
2266
|
+
var logsPath = getPackageLogsPath();
|
|
2245
2267
|
log4js__default.default.configure({
|
|
2246
2268
|
appenders: {
|
|
2247
2269
|
console: {
|
|
@@ -2253,7 +2275,7 @@ log4js__default.default.configure({
|
|
|
2253
2275
|
},
|
|
2254
2276
|
command: {
|
|
2255
2277
|
type: "dateFile",
|
|
2256
|
-
filename: "
|
|
2278
|
+
filename: path__default.default.join(logsPath, "application", "command"),
|
|
2257
2279
|
pattern: "yyyy-MM-dd.log",
|
|
2258
2280
|
numBackups: 15,
|
|
2259
2281
|
alwaysIncludePattern: true,
|
|
@@ -2262,25 +2284,28 @@ log4js__default.default.configure({
|
|
|
2262
2284
|
pattern: "[%d{hh:mm:ss.SSS}][%4.4p] %m"
|
|
2263
2285
|
}
|
|
2264
2286
|
},
|
|
2265
|
-
|
|
2287
|
+
httpConsole: {
|
|
2266
2288
|
type: "stdout",
|
|
2267
2289
|
layout: {
|
|
2268
2290
|
type: "pattern",
|
|
2269
|
-
pattern: "%[[%d{hh:mm:ss.SSS}][
|
|
2291
|
+
pattern: "%[[amagi][%d{hh:mm:ss.SSS}][HTTP]%] %m"
|
|
2270
2292
|
}
|
|
2271
2293
|
},
|
|
2272
|
-
|
|
2294
|
+
httpRequest: {
|
|
2273
2295
|
type: "dateFile",
|
|
2274
|
-
filename: "
|
|
2296
|
+
filename: path__default.default.join(logsPath, "http", "requests"),
|
|
2275
2297
|
pattern: "yyyy-MM-dd.log",
|
|
2276
|
-
numBackups:
|
|
2298
|
+
numBackups: 30,
|
|
2277
2299
|
alwaysIncludePattern: true,
|
|
2278
|
-
layout: {
|
|
2300
|
+
layout: {
|
|
2301
|
+
type: "pattern",
|
|
2302
|
+
pattern: "[%d{hh:mm:ss.SSS}][%4.4p] %m"
|
|
2303
|
+
}
|
|
2279
2304
|
}
|
|
2280
2305
|
},
|
|
2281
2306
|
categories: {
|
|
2282
|
-
default: { appenders: ["console", "command"], level: "info" }
|
|
2283
|
-
|
|
2307
|
+
default: { appenders: ["console", "command"], level: "info" },
|
|
2308
|
+
http: { appenders: ["httpConsole", "httpRequest"], level: "debug" }
|
|
2284
2309
|
},
|
|
2285
2310
|
pm2: true
|
|
2286
2311
|
});
|
|
@@ -2297,15 +2322,15 @@ var CustomLogger = class {
|
|
|
2297
2322
|
gray;
|
|
2298
2323
|
constructor(name) {
|
|
2299
2324
|
this.logger = log4js__default.default.getLogger(name);
|
|
2300
|
-
this.chalk =
|
|
2301
|
-
this.red =
|
|
2302
|
-
this.green =
|
|
2303
|
-
this.yellow =
|
|
2304
|
-
this.blue =
|
|
2305
|
-
this.magenta =
|
|
2306
|
-
this.cyan =
|
|
2307
|
-
this.white =
|
|
2308
|
-
this.gray =
|
|
2325
|
+
this.chalk = new chalk.Chalk();
|
|
2326
|
+
this.red = this.chalk.red;
|
|
2327
|
+
this.green = this.chalk.green;
|
|
2328
|
+
this.yellow = this.chalk.yellow;
|
|
2329
|
+
this.blue = this.chalk.blue;
|
|
2330
|
+
this.magenta = this.chalk.magenta;
|
|
2331
|
+
this.cyan = this.chalk.cyan;
|
|
2332
|
+
this.white = this.chalk.white;
|
|
2333
|
+
this.gray = this.chalk.gray;
|
|
2309
2334
|
}
|
|
2310
2335
|
// 代理 log4js.Logger 的方法
|
|
2311
2336
|
info(message, ...args) {
|
|
@@ -2320,19 +2345,43 @@ var CustomLogger = class {
|
|
|
2320
2345
|
mark(message, ...args) {
|
|
2321
2346
|
this.logger.mark(message, ...args);
|
|
2322
2347
|
}
|
|
2348
|
+
debug(message, ...args) {
|
|
2349
|
+
this.logger.debug(message, ...args);
|
|
2350
|
+
}
|
|
2323
2351
|
};
|
|
2324
2352
|
var logger = new CustomLogger("default");
|
|
2353
|
+
var httpLogger = new CustomLogger("http");
|
|
2325
2354
|
var logMiddleware = (pathsToLog) => {
|
|
2326
2355
|
return (req, res, next) => {
|
|
2327
|
-
if (!pathsToLog || pathsToLog.some((
|
|
2356
|
+
if (!pathsToLog || pathsToLog.some((path2) => req.url.startsWith(path2))) {
|
|
2328
2357
|
const startTime = Date.now();
|
|
2329
2358
|
const url = req.url;
|
|
2330
2359
|
const method = req.method;
|
|
2331
2360
|
const clientIP = req.headers["x-forwarded-for"] || req.socket.remoteAddress;
|
|
2361
|
+
const referer = req.headers["referer"] || req.headers["referrer"] || "-";
|
|
2362
|
+
const contentType = req.headers["content-type"] || "-";
|
|
2363
|
+
const requestSize = req.headers["content-length"] || "0";
|
|
2364
|
+
const protocol = req.protocol;
|
|
2365
|
+
const httpVersion = req.httpVersion;
|
|
2332
2366
|
res.on("finish", () => {
|
|
2333
2367
|
const responseTime = Date.now() - startTime;
|
|
2334
2368
|
const statusCode = res.statusCode;
|
|
2335
|
-
|
|
2369
|
+
const responseSize = res.get("content-length") || "0";
|
|
2370
|
+
const logData = {
|
|
2371
|
+
method,
|
|
2372
|
+
url,
|
|
2373
|
+
statusCode,
|
|
2374
|
+
responseTime: `${responseTime}ms`,
|
|
2375
|
+
clientIP,
|
|
2376
|
+
referer,
|
|
2377
|
+
contentType,
|
|
2378
|
+
requestSize: `${requestSize}B`,
|
|
2379
|
+
responseSize: `${responseSize}B`,
|
|
2380
|
+
protocol,
|
|
2381
|
+
httpVersion,
|
|
2382
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
2383
|
+
};
|
|
2384
|
+
httpLogger.debug(JSON.stringify(logData));
|
|
2336
2385
|
});
|
|
2337
2386
|
}
|
|
2338
2387
|
next();
|
|
@@ -2585,9 +2634,9 @@ function createAmagiClient(options = {}) {
|
|
|
2585
2634
|
createAmagiClient.douyin = douyinUtils;
|
|
2586
2635
|
createAmagiClient.bilibili = bilibiliUtils;
|
|
2587
2636
|
createAmagiClient.kuaishou = kuaishouUtils;
|
|
2588
|
-
createAmagiClient.getDouyinData =
|
|
2589
|
-
createAmagiClient.getBilibiliData =
|
|
2590
|
-
createAmagiClient.getKuaishouData =
|
|
2637
|
+
createAmagiClient.getDouyinData = douyinUtils.getDouyinData;
|
|
2638
|
+
createAmagiClient.getBilibiliData = bilibiliUtils.getBilibiliData;
|
|
2639
|
+
createAmagiClient.getKuaishouData = kuaishouUtils.getKuaishouData;
|
|
2591
2640
|
var CreateApp = createAmagiClient;
|
|
2592
2641
|
var Client = CreateApp;
|
|
2593
2642
|
var amagi = Client;
|
|
@@ -2619,6 +2668,7 @@ exports.fetchKuaishouData = fetchKuaishouData;
|
|
|
2619
2668
|
exports.getBilibiliData = getBilibiliData;
|
|
2620
2669
|
exports.getDouyinData = getDouyinData;
|
|
2621
2670
|
exports.getKuaishouData = getKuaishouData;
|
|
2671
|
+
exports.httpLogger = httpLogger;
|
|
2622
2672
|
exports.kuaishou = kuaishou;
|
|
2623
2673
|
exports.kuaishouAPI = kuaishouAPI;
|
|
2624
2674
|
exports.kuaishouApiUrls = kuaishouApiUrls;
|
|
@@ -1,8 +1,11 @@
|
|
|
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
|
+
import path from 'path';
|
|
7
|
+
import { fileURLToPath } from 'url';
|
|
8
|
+
import fs from 'fs';
|
|
6
9
|
|
|
7
10
|
// src/platform/bilibili/API.ts
|
|
8
11
|
var BiLiBiLiAPI = class {
|
|
@@ -2230,6 +2233,20 @@ async function getKuaishouData(methodType, arg2, arg3) {
|
|
|
2230
2233
|
var fetchDouyinData = getDouyinData;
|
|
2231
2234
|
var fetchBilibiliData = getBilibiliData;
|
|
2232
2235
|
var fetchKuaishouData = getKuaishouData;
|
|
2236
|
+
var getPackageLogsPath = () => {
|
|
2237
|
+
const currentFileUrl = import.meta.url;
|
|
2238
|
+
const currentFilePath = fileURLToPath(currentFileUrl);
|
|
2239
|
+
const currentDir = path.dirname(currentFilePath);
|
|
2240
|
+
let packageRoot = currentDir;
|
|
2241
|
+
while (packageRoot !== path.dirname(packageRoot)) {
|
|
2242
|
+
if (fs.existsSync(path.join(packageRoot, "package.json"))) {
|
|
2243
|
+
break;
|
|
2244
|
+
}
|
|
2245
|
+
packageRoot = path.dirname(packageRoot);
|
|
2246
|
+
}
|
|
2247
|
+
return path.join(packageRoot, "logs");
|
|
2248
|
+
};
|
|
2249
|
+
var logsPath = getPackageLogsPath();
|
|
2233
2250
|
log4js.configure({
|
|
2234
2251
|
appenders: {
|
|
2235
2252
|
console: {
|
|
@@ -2241,7 +2258,7 @@ log4js.configure({
|
|
|
2241
2258
|
},
|
|
2242
2259
|
command: {
|
|
2243
2260
|
type: "dateFile",
|
|
2244
|
-
filename: "
|
|
2261
|
+
filename: path.join(logsPath, "application", "command"),
|
|
2245
2262
|
pattern: "yyyy-MM-dd.log",
|
|
2246
2263
|
numBackups: 15,
|
|
2247
2264
|
alwaysIncludePattern: true,
|
|
@@ -2250,25 +2267,28 @@ log4js.configure({
|
|
|
2250
2267
|
pattern: "[%d{hh:mm:ss.SSS}][%4.4p] %m"
|
|
2251
2268
|
}
|
|
2252
2269
|
},
|
|
2253
|
-
|
|
2270
|
+
httpConsole: {
|
|
2254
2271
|
type: "stdout",
|
|
2255
2272
|
layout: {
|
|
2256
2273
|
type: "pattern",
|
|
2257
|
-
pattern: "%[[%d{hh:mm:ss.SSS}][
|
|
2274
|
+
pattern: "%[[amagi][%d{hh:mm:ss.SSS}][HTTP]%] %m"
|
|
2258
2275
|
}
|
|
2259
2276
|
},
|
|
2260
|
-
|
|
2277
|
+
httpRequest: {
|
|
2261
2278
|
type: "dateFile",
|
|
2262
|
-
filename: "
|
|
2279
|
+
filename: path.join(logsPath, "http", "requests"),
|
|
2263
2280
|
pattern: "yyyy-MM-dd.log",
|
|
2264
|
-
numBackups:
|
|
2281
|
+
numBackups: 30,
|
|
2265
2282
|
alwaysIncludePattern: true,
|
|
2266
|
-
layout: {
|
|
2283
|
+
layout: {
|
|
2284
|
+
type: "pattern",
|
|
2285
|
+
pattern: "[%d{hh:mm:ss.SSS}][%4.4p] %m"
|
|
2286
|
+
}
|
|
2267
2287
|
}
|
|
2268
2288
|
},
|
|
2269
2289
|
categories: {
|
|
2270
|
-
default: { appenders: ["console", "command"], level: "info" }
|
|
2271
|
-
|
|
2290
|
+
default: { appenders: ["console", "command"], level: "info" },
|
|
2291
|
+
http: { appenders: ["httpConsole", "httpRequest"], level: "debug" }
|
|
2272
2292
|
},
|
|
2273
2293
|
pm2: true
|
|
2274
2294
|
});
|
|
@@ -2285,15 +2305,15 @@ var CustomLogger = class {
|
|
|
2285
2305
|
gray;
|
|
2286
2306
|
constructor(name) {
|
|
2287
2307
|
this.logger = log4js.getLogger(name);
|
|
2288
|
-
this.chalk =
|
|
2289
|
-
this.red = chalk.red
|
|
2290
|
-
this.green = chalk.green
|
|
2291
|
-
this.yellow = chalk.yellow
|
|
2292
|
-
this.blue = chalk.blue
|
|
2293
|
-
this.magenta = chalk.magenta
|
|
2294
|
-
this.cyan = chalk.cyan
|
|
2295
|
-
this.white = chalk.white
|
|
2296
|
-
this.gray = chalk.gray
|
|
2308
|
+
this.chalk = new Chalk();
|
|
2309
|
+
this.red = this.chalk.red;
|
|
2310
|
+
this.green = this.chalk.green;
|
|
2311
|
+
this.yellow = this.chalk.yellow;
|
|
2312
|
+
this.blue = this.chalk.blue;
|
|
2313
|
+
this.magenta = this.chalk.magenta;
|
|
2314
|
+
this.cyan = this.chalk.cyan;
|
|
2315
|
+
this.white = this.chalk.white;
|
|
2316
|
+
this.gray = this.chalk.gray;
|
|
2297
2317
|
}
|
|
2298
2318
|
// 代理 log4js.Logger 的方法
|
|
2299
2319
|
info(message, ...args) {
|
|
@@ -2308,19 +2328,43 @@ var CustomLogger = class {
|
|
|
2308
2328
|
mark(message, ...args) {
|
|
2309
2329
|
this.logger.mark(message, ...args);
|
|
2310
2330
|
}
|
|
2331
|
+
debug(message, ...args) {
|
|
2332
|
+
this.logger.debug(message, ...args);
|
|
2333
|
+
}
|
|
2311
2334
|
};
|
|
2312
2335
|
var logger = new CustomLogger("default");
|
|
2336
|
+
var httpLogger = new CustomLogger("http");
|
|
2313
2337
|
var logMiddleware = (pathsToLog) => {
|
|
2314
2338
|
return (req, res, next) => {
|
|
2315
|
-
if (!pathsToLog || pathsToLog.some((
|
|
2339
|
+
if (!pathsToLog || pathsToLog.some((path2) => req.url.startsWith(path2))) {
|
|
2316
2340
|
const startTime = Date.now();
|
|
2317
2341
|
const url = req.url;
|
|
2318
2342
|
const method = req.method;
|
|
2319
2343
|
const clientIP = req.headers["x-forwarded-for"] || req.socket.remoteAddress;
|
|
2344
|
+
const referer = req.headers["referer"] || req.headers["referrer"] || "-";
|
|
2345
|
+
const contentType = req.headers["content-type"] || "-";
|
|
2346
|
+
const requestSize = req.headers["content-length"] || "0";
|
|
2347
|
+
const protocol = req.protocol;
|
|
2348
|
+
const httpVersion = req.httpVersion;
|
|
2320
2349
|
res.on("finish", () => {
|
|
2321
2350
|
const responseTime = Date.now() - startTime;
|
|
2322
2351
|
const statusCode = res.statusCode;
|
|
2323
|
-
|
|
2352
|
+
const responseSize = res.get("content-length") || "0";
|
|
2353
|
+
const logData = {
|
|
2354
|
+
method,
|
|
2355
|
+
url,
|
|
2356
|
+
statusCode,
|
|
2357
|
+
responseTime: `${responseTime}ms`,
|
|
2358
|
+
clientIP,
|
|
2359
|
+
referer,
|
|
2360
|
+
contentType,
|
|
2361
|
+
requestSize: `${requestSize}B`,
|
|
2362
|
+
responseSize: `${responseSize}B`,
|
|
2363
|
+
protocol,
|
|
2364
|
+
httpVersion,
|
|
2365
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
2366
|
+
};
|
|
2367
|
+
httpLogger.debug(JSON.stringify(logData));
|
|
2324
2368
|
});
|
|
2325
2369
|
}
|
|
2326
2370
|
next();
|
|
@@ -2573,11 +2617,11 @@ function createAmagiClient(options = {}) {
|
|
|
2573
2617
|
createAmagiClient.douyin = douyinUtils;
|
|
2574
2618
|
createAmagiClient.bilibili = bilibiliUtils;
|
|
2575
2619
|
createAmagiClient.kuaishou = kuaishouUtils;
|
|
2576
|
-
createAmagiClient.getDouyinData =
|
|
2577
|
-
createAmagiClient.getBilibiliData =
|
|
2578
|
-
createAmagiClient.getKuaishouData =
|
|
2620
|
+
createAmagiClient.getDouyinData = douyinUtils.getDouyinData;
|
|
2621
|
+
createAmagiClient.getBilibiliData = bilibiliUtils.getBilibiliData;
|
|
2622
|
+
createAmagiClient.getKuaishouData = kuaishouUtils.getKuaishouData;
|
|
2579
2623
|
var CreateApp = createAmagiClient;
|
|
2580
2624
|
var Client = CreateApp;
|
|
2581
2625
|
var amagi = Client;
|
|
2582
2626
|
|
|
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 };
|
|
2627
|
+
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, httpLogger, 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
|
|
|
@@ -13465,7 +13465,7 @@ declare const fetchKuaishouData: typeof getKuaishouData;
|
|
|
13465
13465
|
|
|
13466
13466
|
declare class CustomLogger {
|
|
13467
13467
|
private logger;
|
|
13468
|
-
chalk:
|
|
13468
|
+
chalk: ChalkInstance;
|
|
13469
13469
|
red: (text: string) => string;
|
|
13470
13470
|
green: (text: string) => string;
|
|
13471
13471
|
yellow: (text: string) => string;
|
|
@@ -13479,8 +13479,10 @@ declare class CustomLogger {
|
|
|
13479
13479
|
warn(message: any, ...args: any[]): void;
|
|
13480
13480
|
error(message: any, ...args: any[]): void;
|
|
13481
13481
|
mark(message: any, ...args: any[]): void;
|
|
13482
|
+
debug(message: any, ...args: any[]): void;
|
|
13482
13483
|
}
|
|
13483
13484
|
declare const logger: CustomLogger;
|
|
13485
|
+
declare const httpLogger: CustomLogger;
|
|
13484
13486
|
|
|
13485
13487
|
/**
|
|
13486
13488
|
* 创建一个日志中间件,用于记录特定请求的详细信息
|
|
@@ -14216,8 +14218,8 @@ declare class amagiClient {
|
|
|
14216
14218
|
|
|
14217
14219
|
/** amagi 的构造函数类型 */
|
|
14218
14220
|
type AmagiConstructor = {
|
|
14219
|
-
new (options
|
|
14220
|
-
(options
|
|
14221
|
+
new (options?: cookiesOptions): amagiClient;
|
|
14222
|
+
(options?: cookiesOptions): amagiClient;
|
|
14221
14223
|
/** 抖音相关功能模块 (工具集) */
|
|
14222
14224
|
douyin: typeof douyinUtils;
|
|
14223
14225
|
/** B站相关功能模块 (工具集) */
|
|
@@ -14231,7 +14233,7 @@ type AmagiConstructor = {
|
|
|
14231
14233
|
* @param options - 请求参数,是一个对象
|
|
14232
14234
|
* @returns 返回接口的原始数据
|
|
14233
14235
|
*/
|
|
14234
|
-
getDouyinData:
|
|
14236
|
+
getDouyinData: typeof douyinUtils.getDouyinData;
|
|
14235
14237
|
/**
|
|
14236
14238
|
* 快捷获取B站数据
|
|
14237
14239
|
* @param type - 请求数据类型
|
|
@@ -14239,7 +14241,7 @@ type AmagiConstructor = {
|
|
|
14239
14241
|
* @param options - 请求参数,是一个对象
|
|
14240
14242
|
* @returns 返回接口的原始数据
|
|
14241
14243
|
*/
|
|
14242
|
-
getBilibiliData:
|
|
14244
|
+
getBilibiliData: typeof bilibiliUtils.getBilibiliData;
|
|
14243
14245
|
/**
|
|
14244
14246
|
* 快捷获取快手数据
|
|
14245
14247
|
* @param type - 请求数据类型
|
|
@@ -14247,7 +14249,7 @@ type AmagiConstructor = {
|
|
|
14247
14249
|
* @param options - 请求参数,是一个对象
|
|
14248
14250
|
* @returns 返回接口的原始数据
|
|
14249
14251
|
*/
|
|
14250
|
-
getKuaishouData:
|
|
14252
|
+
getKuaishouData: typeof kuaishouUtils.getKuaishouData;
|
|
14251
14253
|
};
|
|
14252
14254
|
/** After instantiation, it can interact with the specified platform API to quickly obtain data. */
|
|
14253
14255
|
declare const CreateApp: AmagiConstructor;
|
|
@@ -14255,4 +14257,4 @@ declare const CreateApp: AmagiConstructor;
|
|
|
14255
14257
|
declare const Client: AmagiConstructor;
|
|
14256
14258
|
declare const amagi: AmagiConstructor;
|
|
14257
14259
|
|
|
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 };
|
|
14260
|
+
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, httpLogger, 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.19",
|
|
4
4
|
"description": "抖音、B站的 web 端相关数据接口基于 Node.js 的实现",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"douyin",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
},
|
|
62
62
|
"dependencies": {
|
|
63
63
|
"axios": "npm:@karinjs/axios@^1.2.0",
|
|
64
|
-
"chalk": "4.1
|
|
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"
|