@ikenxuan/amagi 2.1.4 → 2.1.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/README.md
CHANGED
|
@@ -56,6 +56,9 @@ pnpm build
|
|
|
56
56
|
[GPL-3.0](https://github.com/ikenxuan/amagi/blob/main/LICENSE)
|
|
57
57
|
|
|
58
58
|
## 声明
|
|
59
|
+
本库没有后门,本库不会上传有关你的任何信息到第三方。
|
|
60
|
+
所配置的ck只会用于请求官方API接口
|
|
61
|
+
|
|
59
62
|
该项目代码从 [kkkkkk-10086](https://github.com/ikenxuan/kkkkkk-10086) 提取修改并发布
|
|
60
63
|
|
|
61
64
|
<h2>未经同意,禁止将本项目的开源代码用于任何商业目的。因使用本项目产生的一切问题与后果由使用者自行承担,项目开发者不承担任何责任</h2>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BiLiBiLiAPI, qtparam, wbi_sign } from '../../business/bilibili/index.js';
|
|
2
|
-
import { Networks } from '../../model/index.js';
|
|
2
|
+
import { Networks, logger } from '../../model/index.js';
|
|
3
3
|
export default class BilibiliData {
|
|
4
4
|
type;
|
|
5
5
|
headers;
|
|
@@ -8,7 +8,7 @@ export default class BilibiliData {
|
|
|
8
8
|
this.type = type;
|
|
9
9
|
this.headers = {};
|
|
10
10
|
this.headers.Referer = 'https://api.bilibili.com/';
|
|
11
|
-
this.headers.Cookie = cookie.replace(/\s+/g, '');
|
|
11
|
+
this.headers.Cookie = cookie ? cookie.replace(/\s+/g, '') : '';
|
|
12
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';
|
|
13
13
|
}
|
|
14
14
|
async GetData(data = {}) {
|
|
@@ -132,7 +132,8 @@ export default class BilibiliData {
|
|
|
132
132
|
const result = await new Networks(options).getData();
|
|
133
133
|
if (result && result.code !== 0) {
|
|
134
134
|
const errorMessage = errorMap[result.code] || '未知错误';
|
|
135
|
-
|
|
135
|
+
logger.warn(`响应数据失败!\n请求接口类型:${this.type}\n请求URL:${options.url}\n错误代码:${result.code},\n含义:${errorMessage}`);
|
|
136
|
+
return result;
|
|
136
137
|
}
|
|
137
138
|
else {
|
|
138
139
|
return result;
|
|
@@ -8,7 +8,7 @@ export default class DouyinData {
|
|
|
8
8
|
this.type = type;
|
|
9
9
|
this.headers = {
|
|
10
10
|
Referer: 'https://www.douyin.com/',
|
|
11
|
-
Cookie: cookie.replace(/\s+/g, ''),
|
|
11
|
+
Cookie: cookie ? cookie.replace(/\s+/g, '') : '',
|
|
12
12
|
Accept: '*/*',
|
|
13
13
|
'Content-Type': 'application/json',
|
|
14
14
|
'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6',
|