@ikenxuan/amagi 1.5.4 → 1.5.6
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/lib/business/bilibili/getdata.js +3 -25
- package/lib/business/bilibili/getid.js +3 -3
- package/lib/business/bilibili/result.js +1 -1
- package/lib/business/bilibili/sign/wbi.js +5 -5
- package/lib/business/douyin/getdata.js +22 -18
- package/lib/business/douyin/getid.js +3 -3
- package/lib/business/douyin/result.js +1 -1
- package/lib/business/douyin/sign/a_bogus.d.ts +1 -49
- package/lib/business/douyin/sign/a_bogus.js +438 -258
- package/lib/index.d.ts +5 -5
- package/lib/index.js +5 -5
- package/lib/model/logger.js +15 -15
- package/lib/model/networks.d.ts +30 -30
- package/lib/model/networks.js +212 -206
- package/lib/server/client.d.ts +6 -6
- package/lib/server/client.js +97 -111
- package/lib/server/listen.js +5 -5
- package/package.json +10 -12
- package/amagi.openapi.json +0 -1
package/lib/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
import { client } from
|
|
1
|
+
export * from "./model/index.js";
|
|
2
|
+
export * from "./business/index.js";
|
|
3
|
+
export * from "./types/index.js";
|
|
4
|
+
export * from "./server/index.js";
|
|
5
|
+
import { client } from "./server/index.js";
|
|
6
6
|
declare const amagi: typeof client;
|
|
7
7
|
export { amagi as default };
|
|
8
8
|
export { amagi as Amagi };
|
package/lib/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
import { client } from
|
|
1
|
+
export * from "./model/index.js";
|
|
2
|
+
export * from "./business/index.js";
|
|
3
|
+
export * from "./types/index.js";
|
|
4
|
+
export * from "./server/index.js";
|
|
5
|
+
import { client } from "./server/index.js";
|
|
6
6
|
const amagi = client;
|
|
7
7
|
export { amagi as default };
|
|
8
8
|
export { amagi as Amagi };
|
package/lib/model/logger.js
CHANGED
|
@@ -2,27 +2,27 @@ import log from 'loglevel';
|
|
|
2
2
|
import prefix from 'loglevel-plugin-prefix';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
const colors = {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
5
|
+
TRACE: chalk.magenta,
|
|
6
|
+
DEBUG: chalk.cyan,
|
|
7
|
+
INFO: chalk.blue,
|
|
8
|
+
WARN: chalk.yellow,
|
|
9
|
+
ERROR: chalk.red
|
|
10
10
|
};
|
|
11
11
|
prefix.reg(log);
|
|
12
12
|
log.enableAll();
|
|
13
13
|
prefix.apply(log, {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
format(level, name, timestamp) {
|
|
15
|
+
const levelKey = level.toUpperCase();
|
|
16
|
+
if (!(levelKey in colors)) {
|
|
17
|
+
throw new Error(`Invalid log level: ${levelKey}`);
|
|
18
|
+
}
|
|
19
|
+
return `${chalk.gray(`[${timestamp}]`)} ${colors[levelKey](level)} ${chalk.green(`${name}:`)}`;
|
|
20
|
+
}
|
|
21
21
|
});
|
|
22
22
|
prefix.apply(log.getLogger('critical'), {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
format(level, name, timestamp) {
|
|
24
|
+
return chalk.red.bold(`[${timestamp}] ${level} ${name}:`);
|
|
25
|
+
}
|
|
26
26
|
});
|
|
27
27
|
const logger = log;
|
|
28
28
|
export default logger;
|
package/lib/model/networks.d.ts
CHANGED
|
@@ -4,35 +4,35 @@ interface HeadersObject {
|
|
|
4
4
|
[key: string]: string;
|
|
5
5
|
}
|
|
6
6
|
export default class Networks {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
7
|
+
url: string | URL;
|
|
8
|
+
method: string;
|
|
9
|
+
Headers: any;
|
|
10
|
+
type: string;
|
|
11
|
+
body?: string;
|
|
12
|
+
fetch: any;
|
|
13
|
+
isGetResult: boolean;
|
|
14
|
+
timeout: number;
|
|
15
|
+
timer: NodeJS.Timeout | undefined;
|
|
16
|
+
data: {};
|
|
17
|
+
redirect: string;
|
|
18
|
+
constructor(data: NetworksConfigType);
|
|
19
|
+
get config(): NetworksConfigType;
|
|
20
|
+
getfetch(): Promise<Response | boolean>;
|
|
21
|
+
returnResult(): Promise<Response>;
|
|
22
|
+
/** 最终地址(跟随重定向) */
|
|
23
|
+
getLongLink(): Promise<string>;
|
|
24
|
+
/** 获取首个302 */
|
|
25
|
+
getLocation(): Promise<string>;
|
|
26
|
+
/** 获取数据并处理数据的格式化,默认json */
|
|
27
|
+
getData(new_fetch?: string): Promise<any | boolean>;
|
|
28
|
+
/** 获取响应头 */
|
|
29
|
+
getHeaders(): Promise<HeadersObject | null>;
|
|
30
|
+
/** 一次性获取响应头和响应体 */
|
|
31
|
+
getHeadersAndData(): Promise<object>;
|
|
32
|
+
Tojson(): Promise<any>;
|
|
33
|
+
ToText(): Promise<void>;
|
|
34
|
+
ToArrayBuffer(): Promise<void>;
|
|
35
|
+
ToBlob(): Promise<void>;
|
|
36
|
+
timeoutPromise(timeout: number): Promise<Response>;
|
|
37
37
|
}
|
|
38
38
|
export {};
|
package/lib/model/networks.js
CHANGED
|
@@ -1,224 +1,230 @@
|
|
|
1
1
|
import fetch, { Response } from 'node-fetch';
|
|
2
2
|
import { logger } from '../model/index.js';
|
|
3
|
+
const controller = new AbortController();
|
|
3
4
|
export default class Networks {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
else
|
|
23
|
-
this.Headers = {};
|
|
24
|
-
this.url = data.url || '';
|
|
25
|
-
this.type = data.type || 'json';
|
|
26
|
-
this.method = data.method || 'GET';
|
|
27
|
-
this.body = data.body || ''; // 用于POST请求
|
|
28
|
-
this.data = {};
|
|
29
|
-
this.timeout = data.timeout || 15000;
|
|
30
|
-
this.isGetResult = false;
|
|
31
|
-
this.timer = undefined;
|
|
32
|
-
this.redirect = 'follow'; // 默认跟随重定向
|
|
33
|
-
}
|
|
34
|
-
get config() {
|
|
35
|
-
let data = {
|
|
36
|
-
headers: this.Headers,
|
|
37
|
-
method: this.method,
|
|
38
|
-
};
|
|
39
|
-
if (this.method === 'POST') {
|
|
40
|
-
data = { ...data, body: JSON.stringify(this.body) || '' };
|
|
41
|
-
}
|
|
42
|
-
return data;
|
|
43
|
-
}
|
|
44
|
-
async getfetch() {
|
|
45
|
-
try {
|
|
46
|
-
const result = await this.returnResult();
|
|
47
|
-
if (result.status === 504) {
|
|
48
|
-
return result;
|
|
49
|
-
}
|
|
50
|
-
this.isGetResult = true;
|
|
51
|
-
return result;
|
|
52
|
-
}
|
|
53
|
-
catch (error) {
|
|
54
|
-
logger.info(error);
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
5
|
+
url;
|
|
6
|
+
method;
|
|
7
|
+
Headers;
|
|
8
|
+
type;
|
|
9
|
+
body;
|
|
10
|
+
fetch;
|
|
11
|
+
isGetResult;
|
|
12
|
+
timeout;
|
|
13
|
+
timer;
|
|
14
|
+
data;
|
|
15
|
+
redirect;
|
|
16
|
+
constructor(data) {
|
|
17
|
+
this.Headers = new Headers();
|
|
18
|
+
if (data.headers && Object.keys(data.headers).length > 0) {
|
|
19
|
+
for (const [key, value] of Object.entries(data.headers)) {
|
|
20
|
+
this.Headers.append(key, value);
|
|
21
|
+
}
|
|
57
22
|
}
|
|
58
|
-
|
|
59
|
-
|
|
23
|
+
else
|
|
24
|
+
this.Headers = {};
|
|
25
|
+
this.url = data.url || '';
|
|
26
|
+
this.type = data.type || 'json';
|
|
27
|
+
this.method = data.method || 'GET';
|
|
28
|
+
this.body = data.body || ''; // 用于POST请求
|
|
29
|
+
this.data = {};
|
|
30
|
+
this.timeout = data.timeout || 15000;
|
|
31
|
+
this.isGetResult = false;
|
|
32
|
+
this.timer = undefined;
|
|
33
|
+
this.redirect = 'follow'; // 默认跟随重定向
|
|
34
|
+
}
|
|
35
|
+
get config() {
|
|
36
|
+
let data = {
|
|
37
|
+
headers: this.Headers,
|
|
38
|
+
method: this.method
|
|
39
|
+
};
|
|
40
|
+
if (this.method === 'POST') {
|
|
41
|
+
data = { ...data, body: JSON.stringify(this.body) || '' };
|
|
60
42
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
43
|
+
return data;
|
|
44
|
+
}
|
|
45
|
+
async getfetch() {
|
|
46
|
+
try {
|
|
47
|
+
const result = await this.returnResult();
|
|
48
|
+
if (result.status === 504) {
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
this.isGetResult = true;
|
|
52
|
+
return result;
|
|
71
53
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
const response = await fetch(this.url, {
|
|
76
|
-
method: 'GET',
|
|
77
|
-
redirect: 'manual', // 不跟随重定向
|
|
78
|
-
});
|
|
79
|
-
// 取location返回
|
|
80
|
-
return response.headers.get('location');
|
|
81
|
-
}
|
|
82
|
-
catch (error) {
|
|
83
|
-
logger.error(error);
|
|
84
|
-
return '';
|
|
85
|
-
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
logger.info(error);
|
|
56
|
+
return false;
|
|
86
57
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
this.isGetResult = true;
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
this.fetch = new_fetch;
|
|
100
|
-
}
|
|
101
|
-
switch (this.type) {
|
|
102
|
-
case 'json':
|
|
103
|
-
await this.Tojson();
|
|
104
|
-
break;
|
|
105
|
-
case 'text':
|
|
106
|
-
await this.ToText();
|
|
107
|
-
break;
|
|
108
|
-
case 'arrayBuffer':
|
|
109
|
-
await this.ToArrayBuffer();
|
|
110
|
-
break;
|
|
111
|
-
case 'blob':
|
|
112
|
-
await this.ToBlob();
|
|
113
|
-
break;
|
|
114
|
-
}
|
|
115
|
-
return this.fetch;
|
|
116
|
-
}
|
|
117
|
-
catch (error) {
|
|
118
|
-
logger.error(error);
|
|
119
|
-
return false;
|
|
120
|
-
}
|
|
58
|
+
}
|
|
59
|
+
async returnResult() {
|
|
60
|
+
return await fetch(this.url, this.config);
|
|
61
|
+
}
|
|
62
|
+
/** 最终地址(跟随重定向) */
|
|
63
|
+
async getLongLink() {
|
|
64
|
+
try {
|
|
65
|
+
const result = await this.returnResult();
|
|
66
|
+
return result.url;
|
|
121
67
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
this.fetch = await this.returnResult();
|
|
126
|
-
if (this.fetch) {
|
|
127
|
-
if (this.fetch.headers) {
|
|
128
|
-
const headers = this.fetch.headers;
|
|
129
|
-
const headersObject = {};
|
|
130
|
-
for (const [key, value] of headers.entries()) {
|
|
131
|
-
headersObject[key] = value;
|
|
132
|
-
}
|
|
133
|
-
return headersObject;
|
|
134
|
-
}
|
|
135
|
-
else {
|
|
136
|
-
logger.error('未获取到响应头');
|
|
137
|
-
return null;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
else {
|
|
141
|
-
logger.error('未获取到响应对象');
|
|
142
|
-
return null;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
catch (error) {
|
|
146
|
-
logger.error('获取响应头失败:', error);
|
|
147
|
-
return null;
|
|
148
|
-
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
logger.error(error);
|
|
70
|
+
return '';
|
|
149
71
|
}
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
72
|
+
}
|
|
73
|
+
/** 获取首个302 */
|
|
74
|
+
async getLocation() {
|
|
75
|
+
try {
|
|
76
|
+
const response = await fetch(this.url, {
|
|
77
|
+
method: 'GET',
|
|
78
|
+
redirect: 'manual' // 不跟随重定向
|
|
79
|
+
});
|
|
80
|
+
// 取location返回
|
|
81
|
+
return response.headers.get('location');
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
logger.error(error);
|
|
85
|
+
return '';
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/** 获取数据并处理数据的格式化,默认json */
|
|
89
|
+
async getData(new_fetch = '') {
|
|
90
|
+
try {
|
|
91
|
+
if (!new_fetch) {
|
|
92
|
+
const result = await this.returnResult();
|
|
93
|
+
if (result.status === 504) {
|
|
94
|
+
return result;
|
|
95
|
+
}
|
|
96
|
+
if (result.status === 429) {
|
|
97
|
+
logger.warn('HTTP 响应状态码: 429');
|
|
98
|
+
throw new Error('ratelimit triggered, 触发 https://www.douyin.com/ 的速率限制!!!');
|
|
99
|
+
}
|
|
100
|
+
this.fetch = result;
|
|
101
|
+
this.isGetResult = true;
|
|
102
|
+
}
|
|
103
|
+
else {
|
|
104
|
+
this.fetch = new_fetch;
|
|
105
|
+
}
|
|
106
|
+
switch (this.type) {
|
|
107
|
+
case 'json':
|
|
108
|
+
await this.Tojson();
|
|
109
|
+
break;
|
|
110
|
+
case 'text':
|
|
111
|
+
await this.ToText();
|
|
112
|
+
break;
|
|
113
|
+
case 'arrayBuffer':
|
|
114
|
+
await this.ToArrayBuffer();
|
|
115
|
+
break;
|
|
116
|
+
case 'blob':
|
|
117
|
+
await this.ToBlob();
|
|
118
|
+
break;
|
|
119
|
+
default:
|
|
120
|
+
}
|
|
121
|
+
return this.fetch;
|
|
195
122
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
123
|
+
catch (error) {
|
|
124
|
+
logger.error(error);
|
|
125
|
+
return false;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
/** 获取响应头 */
|
|
129
|
+
async getHeaders() {
|
|
130
|
+
try {
|
|
131
|
+
this.fetch = await this.returnResult();
|
|
132
|
+
if (this.fetch) {
|
|
133
|
+
if (this.fetch.headers) {
|
|
134
|
+
const headers = this.fetch.headers;
|
|
135
|
+
const headersObject = {};
|
|
136
|
+
for (const [key, value] of headers.entries()) {
|
|
137
|
+
headersObject[key] = value;
|
|
138
|
+
}
|
|
139
|
+
return headersObject;
|
|
199
140
|
}
|
|
200
141
|
else {
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}
|
|
142
|
+
logger.error('未获取到响应头');
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
logger.error('未获取到响应对象');
|
|
148
|
+
return null;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
catch (error) {
|
|
152
|
+
logger.error('获取响应头失败:', error);
|
|
153
|
+
return null;
|
|
204
154
|
}
|
|
205
|
-
|
|
206
|
-
|
|
155
|
+
}
|
|
156
|
+
/** 一次性获取响应头和响应体 */
|
|
157
|
+
async getHeadersAndData() {
|
|
158
|
+
try {
|
|
159
|
+
// 发起网络请求获取响应对象
|
|
160
|
+
this.fetch = await this.returnResult();
|
|
161
|
+
// 初始化响应头和响应数据
|
|
162
|
+
let headers = null;
|
|
163
|
+
let data = null;
|
|
164
|
+
if (this.fetch) {
|
|
165
|
+
// 获取响应头
|
|
166
|
+
if (this.fetch.headers) {
|
|
167
|
+
headers = {};
|
|
168
|
+
const fetchHeaders = this.fetch.headers;
|
|
169
|
+
for (const [key, value] of fetchHeaders.entries()) {
|
|
170
|
+
headers[key] = value;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
logger.error('未获取到响应头');
|
|
175
|
+
}
|
|
176
|
+
// 获取响应数据
|
|
177
|
+
switch (this.type) {
|
|
178
|
+
case 'json':
|
|
179
|
+
data = await this.fetch.json();
|
|
180
|
+
break;
|
|
181
|
+
case 'text':
|
|
182
|
+
data = await this.fetch.text();
|
|
183
|
+
break;
|
|
184
|
+
case 'arrayBuffer':
|
|
185
|
+
data = await this.ToArrayBuffer();
|
|
186
|
+
break;
|
|
187
|
+
case 'blob':
|
|
188
|
+
data = await this.ToBlob();
|
|
189
|
+
break;
|
|
190
|
+
default:
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
logger.error('未获取到响应对象');
|
|
195
|
+
}
|
|
196
|
+
return { headers, data };
|
|
207
197
|
}
|
|
208
|
-
|
|
209
|
-
|
|
198
|
+
catch (error) {
|
|
199
|
+
logger.error('获取响应头和数据失败:', error);
|
|
200
|
+
return { headers: null, data: null };
|
|
210
201
|
}
|
|
211
|
-
|
|
212
|
-
|
|
202
|
+
}
|
|
203
|
+
async Tojson() {
|
|
204
|
+
if (this.fetch.headers.get('content-type').includes('json')) {
|
|
205
|
+
this.fetch = await this.fetch.json();
|
|
213
206
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
this.timer = setTimeout(() => {
|
|
218
|
-
logger.info('执行力');
|
|
219
|
-
controller.abort();
|
|
220
|
-
resolve(new Response('timeout', { status: 504, statusText: 'timeout' }));
|
|
221
|
-
}, timeout);
|
|
222
|
-
});
|
|
207
|
+
else {
|
|
208
|
+
this.fetch = await this.fetch.text();
|
|
209
|
+
this.type = 'text';
|
|
223
210
|
}
|
|
211
|
+
}
|
|
212
|
+
async ToText() {
|
|
213
|
+
this.fetch = await this.fetch.text();
|
|
214
|
+
}
|
|
215
|
+
async ToArrayBuffer() {
|
|
216
|
+
this.fetch = await this.fetch.arrayBuffer();
|
|
217
|
+
}
|
|
218
|
+
async ToBlob() {
|
|
219
|
+
this.fetch = await this.fetch.blob();
|
|
220
|
+
}
|
|
221
|
+
timeoutPromise(timeout) {
|
|
222
|
+
return new Promise((resolve, reject) => {
|
|
223
|
+
this.timer = setTimeout(() => {
|
|
224
|
+
logger.info('执行力');
|
|
225
|
+
controller.abort();
|
|
226
|
+
resolve(new Response('timeout', { status: 504, statusText: 'timeout' }));
|
|
227
|
+
}, timeout);
|
|
228
|
+
});
|
|
229
|
+
}
|
|
224
230
|
}
|
package/lib/server/client.d.ts
CHANGED
|
@@ -6,18 +6,18 @@ interface initClientParams {
|
|
|
6
6
|
bilibili: string;
|
|
7
7
|
}
|
|
8
8
|
export declare class client {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
private readonly douyin;
|
|
10
|
+
private readonly bilibili;
|
|
11
|
+
/**
|
|
12
12
|
*
|
|
13
13
|
* @param cookies 包含抖音和B站cookie的参数对象
|
|
14
14
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
constructor(cookies: initClientParams);
|
|
16
|
+
/**
|
|
17
17
|
* 初始化 fastify 实例
|
|
18
18
|
* @param log 是否启用日志
|
|
19
19
|
* @returns fastify 实例
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
initServer(log?: boolean): Promise<FastifyInstance>;
|
|
22
22
|
}
|
|
23
23
|
export {};
|