@floating-live/bilibili 0.16.5 → 0.16.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@floating-live/bilibili",
3
- "version": "0.16.5",
3
+ "version": "0.16.7",
4
4
  "type": "module",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -33,5 +33,5 @@
33
33
  "peerDependencies": {
34
34
  "floating-live": "^0.16.0"
35
35
  },
36
- "gitHead": "597bd2f8bbf24e5895d5f54d26cb9220a93711a3"
36
+ "gitHead": "07f6d52a78538dc22f4f597471346bafeb2929dd"
37
37
  }
package/parser.js CHANGED
@@ -147,8 +147,11 @@ const parsingFunction = {
147
147
  name: data.giftName,
148
148
  id: data.giftId,
149
149
  num: data.num,
150
- value: data.total_coin,
151
- currency: data.coin_type,
150
+ value: data.coin_type == "gold" ? data.total_coin / 100 : data.total_coin,
151
+ valueType: data.coin_type,
152
+ valueName: data.coin_type == "gold" ? "电池" : "银瓜子",
153
+ price: data.coin_type == "gold" ? data.total_coin / 1000 : 0,
154
+ currency: "CNY",
152
155
  action: data.action,
153
156
  comboId: data.batch_combo_id,
154
157
  },
@@ -170,14 +173,16 @@ const parsingFunction = {
170
173
  user: {
171
174
  name: data.username,
172
175
  id: data.uid,
173
- membership: data.guard_level,
174
176
  },
175
177
  gift: {
176
178
  name: data.gift_name,
177
179
  id: data.gift_id,
178
180
  num: data.num,
179
- value: data.price,
180
- currency: "gold",
181
+ value: data.price / 100,
182
+ valueType: "gold",
183
+ valueName: "电池",
184
+ price: data.price / 1000,
185
+ currency: "CNY",
181
186
  },
182
187
  name: data.gift_name,
183
188
  level: data.guard_level,
@@ -219,8 +224,11 @@ const parsingFunction = {
219
224
  id: data.gift.gift_id,
220
225
  name: data.gift.gift_name,
221
226
  num: data.gift.num,
222
- value: data.price * 1000, // 花费
223
- currency: "gold",
227
+ value: data.price * 10,
228
+ valueType: "gold",
229
+ valueName: "电池",
230
+ price: data.price,
231
+ currency: "CNY",
224
232
  },
225
233
  },
226
234
  };
package/plugin.js CHANGED
@@ -12,17 +12,6 @@ const platformInfo = {
12
12
  gift: {
13
13
  action: "投喂",
14
14
  },
15
- currency: {
16
- silver: {
17
- name: "银瓜子",
18
- ratio: 1,
19
- },
20
- gold: {
21
- name: "电池",
22
- ratio: 100,
23
- money: 1000,
24
- },
25
- },
26
15
  stats: {
27
16
  view: "看过",
28
17
  online: "在线",
package/utils/request.js CHANGED
@@ -11,7 +11,7 @@ export class BilibiliApiClientEx extends BilibiliApiClient {
11
11
  async xpassportQrcodePoll(params) {
12
12
  const url = new URL("https://passport.bilibili.com/x/passport-login/web/qrcode/poll");
13
13
  url.searchParams.set("qrcode_key", params.qrcode_key);
14
- const res = await this.request("https://passport.bilibili.com/x/passport-login/web/qrcode/generate");
14
+ const res = await this.request(url);
15
15
  const data = unwrapRequestData(res);
16
16
  this.cookies.setFromHeaders(res.headers);
17
17
  return data;