@ikenxuan/amagi 4.4.17 → 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 +14 -7
- package/dist/default/cjs/index.cjs +12 -13
- package/dist/default/esm/index.mjs +13 -13
- package/dist/default/index.d.ts +5 -5
- 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
|
|
|
@@ -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
|
|
@@ -2297,15 +2296,15 @@ var CustomLogger = class {
|
|
|
2297
2296
|
gray;
|
|
2298
2297
|
constructor(name) {
|
|
2299
2298
|
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 =
|
|
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;
|
|
2309
2308
|
}
|
|
2310
2309
|
// 代理 log4js.Logger 的方法
|
|
2311
2310
|
info(message, ...args) {
|
|
@@ -2585,9 +2584,9 @@ function createAmagiClient(options = {}) {
|
|
|
2585
2584
|
createAmagiClient.douyin = douyinUtils;
|
|
2586
2585
|
createAmagiClient.bilibili = bilibiliUtils;
|
|
2587
2586
|
createAmagiClient.kuaishou = kuaishouUtils;
|
|
2588
|
-
createAmagiClient.getDouyinData =
|
|
2589
|
-
createAmagiClient.getBilibiliData =
|
|
2590
|
-
createAmagiClient.getKuaishouData =
|
|
2587
|
+
createAmagiClient.getDouyinData = douyinUtils.getDouyinData;
|
|
2588
|
+
createAmagiClient.getBilibiliData = bilibiliUtils.getBilibiliData;
|
|
2589
|
+
createAmagiClient.getKuaishouData = kuaishouUtils.getKuaishouData;
|
|
2591
2590
|
var CreateApp = createAmagiClient;
|
|
2592
2591
|
var Client = CreateApp;
|
|
2593
2592
|
var amagi = 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
|
|
@@ -2285,15 +2285,15 @@ var CustomLogger = class {
|
|
|
2285
2285
|
gray;
|
|
2286
2286
|
constructor(name) {
|
|
2287
2287
|
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
|
|
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;
|
|
2297
2297
|
}
|
|
2298
2298
|
// 代理 log4js.Logger 的方法
|
|
2299
2299
|
info(message, ...args) {
|
|
@@ -2573,9 +2573,9 @@ function createAmagiClient(options = {}) {
|
|
|
2573
2573
|
createAmagiClient.douyin = douyinUtils;
|
|
2574
2574
|
createAmagiClient.bilibili = bilibiliUtils;
|
|
2575
2575
|
createAmagiClient.kuaishou = kuaishouUtils;
|
|
2576
|
-
createAmagiClient.getDouyinData =
|
|
2577
|
-
createAmagiClient.getBilibiliData =
|
|
2578
|
-
createAmagiClient.getKuaishouData =
|
|
2576
|
+
createAmagiClient.getDouyinData = douyinUtils.getDouyinData;
|
|
2577
|
+
createAmagiClient.getBilibiliData = bilibiliUtils.getBilibiliData;
|
|
2578
|
+
createAmagiClient.getKuaishouData = kuaishouUtils.getKuaishouData;
|
|
2579
2579
|
var CreateApp = createAmagiClient;
|
|
2580
2580
|
var Client = CreateApp;
|
|
2581
2581
|
var amagi = Client;
|
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;
|
|
@@ -14231,7 +14231,7 @@ type AmagiConstructor = {
|
|
|
14231
14231
|
* @param options - 请求参数,是一个对象
|
|
14232
14232
|
* @returns 返回接口的原始数据
|
|
14233
14233
|
*/
|
|
14234
|
-
getDouyinData:
|
|
14234
|
+
getDouyinData: typeof douyinUtils.getDouyinData;
|
|
14235
14235
|
/**
|
|
14236
14236
|
* 快捷获取B站数据
|
|
14237
14237
|
* @param type - 请求数据类型
|
|
@@ -14239,7 +14239,7 @@ type AmagiConstructor = {
|
|
|
14239
14239
|
* @param options - 请求参数,是一个对象
|
|
14240
14240
|
* @returns 返回接口的原始数据
|
|
14241
14241
|
*/
|
|
14242
|
-
getBilibiliData:
|
|
14242
|
+
getBilibiliData: typeof bilibiliUtils.getBilibiliData;
|
|
14243
14243
|
/**
|
|
14244
14244
|
* 快捷获取快手数据
|
|
14245
14245
|
* @param type - 请求数据类型
|
|
@@ -14247,7 +14247,7 @@ type AmagiConstructor = {
|
|
|
14247
14247
|
* @param options - 请求参数,是一个对象
|
|
14248
14248
|
* @returns 返回接口的原始数据
|
|
14249
14249
|
*/
|
|
14250
|
-
getKuaishouData:
|
|
14250
|
+
getKuaishouData: typeof kuaishouUtils.getKuaishouData;
|
|
14251
14251
|
};
|
|
14252
14252
|
/** After instantiation, it can interact with the specified platform API to quickly obtain data. */
|
|
14253
14253
|
declare const CreateApp: AmagiConstructor;
|
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",
|
|
@@ -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"
|