@ikenxuan/amagi 1.4.6 → 1.4.8

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.
@@ -9,6 +9,7 @@ export default class BilibiliData {
9
9
  this.headers = {};
10
10
  this.headers.Referer = 'https://api.bilibili.com/';
11
11
  this.headers.Cookie = cookie;
12
+ this.headers['User-Agent'] = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36 Edg/127.0.0.0';
12
13
  }
13
14
  async GetData(data = {}) {
14
15
  let result;
@@ -1,2 +1,3 @@
1
- declare const logger: import("pino").Logger<never>;
1
+ import log4js from 'log4js';
2
+ declare const logger: log4js.Logger;
2
3
  export default logger;
@@ -1,4 +1,28 @@
1
- import pino from 'pino';
2
- import pretty from 'pino-pretty';
3
- const logger = pino(pretty());
1
+ import log4js from 'log4js';
2
+ log4js.configure({
3
+ appenders: {
4
+ console: {
5
+ type: 'stdout',
6
+ layout: {
7
+ type: 'pattern',
8
+ pattern: '%[[amagi][%d{hh:mm:ss.SSS}][%4.4p]%] %m',
9
+ },
10
+ },
11
+ command: {
12
+ type: 'dateFile', // 可以是console,dateFile,file,Logstash等
13
+ filename: 'logs/command', // 将会按照filename和pattern拼接文件名
14
+ pattern: 'yyyy-MM-dd.log',
15
+ numBackups: 15,
16
+ alwaysIncludePattern: true,
17
+ layout: {
18
+ type: 'pattern',
19
+ pattern: '[%d{hh:mm:ss.SSS}][%4.4p] %m',
20
+ },
21
+ },
22
+ },
23
+ categories: {
24
+ default: { appenders: ['console'], level: 'debug' },
25
+ },
26
+ });
27
+ const logger = log4js.getLogger();
4
28
  export default logger;
@@ -1,9 +1,9 @@
1
1
  import { logger } from '../model/index.js';
2
2
  /** 启动监听 */
3
3
  export const StartClient = async (client, options) => {
4
- return client.listen({ port: options.port, host: '127.0.0.1' }, (_err, address) => {
4
+ return client.listen({ port: options.port, host: '[::]' }, (_err, _address) => {
5
5
  if (_err)
6
6
  logger.error(_err);
7
- logger.info(`amagi server listening on ${address}`);
7
+ logger.info(`amagi server listening on http://localhost:${options.port}`);
8
8
  });
9
9
  };
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@ikenxuan/amagi",
3
- "version": "1.4.6",
3
+ "version": "1.4.8",
4
4
  "type": "module",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
7
7
  "homepage": "https://github.com/ikenxuan/amagi",
8
8
  "scripts": {
9
- "dev": "tsx src/dev.ts",
9
+ "dev": "tsx lib/dev.js",
10
10
  "build": "tsc --project tsconfig.json && tsc-alias -p tsconfig.json && node src/cp.js"
11
11
  },
12
12
  "files": [
@@ -34,10 +34,9 @@
34
34
  "chokidar": "^3.6.0",
35
35
  "fastify": "^4.28.1",
36
36
  "lodash": "4.17.21",
37
+ "log4js": "^6.9.1",
37
38
  "md5": "^2.3.0",
38
- "node-fetch": "^3.3.2",
39
- "pino": "^9.3.2",
40
- "pino-pretty": "^11.2.2"
39
+ "node-fetch": "^3.3.2"
41
40
  },
42
41
  "devDependencies": {
43
42
  "@types/lodash": "latest",