@forward-widget/danmu-universe 0.0.2 → 0.0.4

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.
@@ -217,6 +217,253 @@ var __webpack_modules__ = {
217
217
  return n - o;
218
218
  };
219
219
  },
220
+ "./src/scrapers/bilibili/dm.proto": function(e, t, n) {
221
+ e = n.nmd(e), function(t, r) {
222
+ 'function' == typeof define && define.amd ? define([
223
+ "protobufjs/minimal"
224
+ ], r) : e && e.exports && (e.exports = r(n("../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/minimal.js")));
225
+ }(0, function(e) {
226
+ "use strict";
227
+ var t = e.Reader, n = e.Writer, r = e.util, i = e.roots.default || (e.roots.default = {});
228
+ return i.biliproto = function() {
229
+ var o = {};
230
+ return o.community = function() {
231
+ var o = {};
232
+ return o.service = function() {
233
+ var o = {};
234
+ return o.dm = function() {
235
+ var o = {};
236
+ return o.v1 = function() {
237
+ var o = {};
238
+ return o.DanmakuElem = function() {
239
+ function o(e) {
240
+ if (e) for(var t = Object.keys(e), n = 0; n < t.length; ++n)null != e[t[n]] && (this[t[n]] = e[t[n]]);
241
+ }
242
+ return o.prototype.id = r.Long ? r.Long.fromBits(0, 0, !1) : 0, o.prototype.progress = 0, o.prototype.mode = 0, o.prototype.fontsize = 0, o.prototype.color = 0, o.prototype.midHash = "", o.prototype.content = "", o.prototype.ctime = r.Long ? r.Long.fromBits(0, 0, !1) : 0, o.prototype.weight = 0, o.prototype.action = "", o.prototype.pool = 0, o.prototype.idStr = "", o.prototype.attr = 0, o.prototype.animation = "", o.prototype.likeNum = 0, o.prototype.colorV2 = "", o.prototype.dmTypeV2 = 0, o.create = function(e) {
243
+ return new o(e);
244
+ }, o.encode = function(e, t) {
245
+ return t || (t = n.create()), null != e.id && Object.hasOwnProperty.call(e, "id") && t.uint32(8).int64(e.id), null != e.progress && Object.hasOwnProperty.call(e, "progress") && t.uint32(16).int32(e.progress), null != e.mode && Object.hasOwnProperty.call(e, "mode") && t.uint32(24).int32(e.mode), null != e.fontsize && Object.hasOwnProperty.call(e, "fontsize") && t.uint32(32).int32(e.fontsize), null != e.color && Object.hasOwnProperty.call(e, "color") && t.uint32(40).uint32(e.color), null != e.midHash && Object.hasOwnProperty.call(e, "midHash") && t.uint32(50).string(e.midHash), null != e.content && Object.hasOwnProperty.call(e, "content") && t.uint32(58).string(e.content), null != e.ctime && Object.hasOwnProperty.call(e, "ctime") && t.uint32(64).int64(e.ctime), null != e.weight && Object.hasOwnProperty.call(e, "weight") && t.uint32(72).int32(e.weight), null != e.action && Object.hasOwnProperty.call(e, "action") && t.uint32(82).string(e.action), null != e.pool && Object.hasOwnProperty.call(e, "pool") && t.uint32(88).int32(e.pool), null != e.idStr && Object.hasOwnProperty.call(e, "idStr") && t.uint32(98).string(e.idStr), null != e.attr && Object.hasOwnProperty.call(e, "attr") && t.uint32(104).int32(e.attr), null != e.animation && Object.hasOwnProperty.call(e, "animation") && t.uint32(114).string(e.animation), null != e.likeNum && Object.hasOwnProperty.call(e, "likeNum") && t.uint32(120).uint32(e.likeNum), null != e.colorV2 && Object.hasOwnProperty.call(e, "colorV2") && t.uint32(130).string(e.colorV2), null != e.dmTypeV2 && Object.hasOwnProperty.call(e, "dmTypeV2") && t.uint32(136).uint32(e.dmTypeV2), t;
246
+ }, o.encodeDelimited = function(e, t) {
247
+ return this.encode(e, t).ldelim();
248
+ }, o.decode = function(e, n, r) {
249
+ e instanceof t || (e = t.create(e));
250
+ for(var o = void 0 === n ? e.len : e.pos + n, s = new i.biliproto.community.service.dm.v1.DanmakuElem(); e.pos < o;){
251
+ var a = e.uint32();
252
+ if (a === r) break;
253
+ switch(a >>> 3){
254
+ case 1:
255
+ s.id = e.int64();
256
+ break;
257
+ case 2:
258
+ s.progress = e.int32();
259
+ break;
260
+ case 3:
261
+ s.mode = e.int32();
262
+ break;
263
+ case 4:
264
+ s.fontsize = e.int32();
265
+ break;
266
+ case 5:
267
+ s.color = e.uint32();
268
+ break;
269
+ case 6:
270
+ s.midHash = e.string();
271
+ break;
272
+ case 7:
273
+ s.content = e.string();
274
+ break;
275
+ case 8:
276
+ s.ctime = e.int64();
277
+ break;
278
+ case 9:
279
+ s.weight = e.int32();
280
+ break;
281
+ case 10:
282
+ s.action = e.string();
283
+ break;
284
+ case 11:
285
+ s.pool = e.int32();
286
+ break;
287
+ case 12:
288
+ s.idStr = e.string();
289
+ break;
290
+ case 13:
291
+ s.attr = e.int32();
292
+ break;
293
+ case 14:
294
+ s.animation = e.string();
295
+ break;
296
+ case 15:
297
+ s.likeNum = e.uint32();
298
+ break;
299
+ case 16:
300
+ s.colorV2 = e.string();
301
+ break;
302
+ case 17:
303
+ s.dmTypeV2 = e.uint32();
304
+ break;
305
+ default:
306
+ e.skipType(7 & a);
307
+ }
308
+ }
309
+ return s;
310
+ }, o.decodeDelimited = function(e) {
311
+ return e instanceof t || (e = new t(e)), this.decode(e, e.uint32());
312
+ }, o.verify = function(e) {
313
+ return "object" != typeof e || null === e ? "object expected" : null != e.id && e.hasOwnProperty("id") && !r.isInteger(e.id) && !(e.id && r.isInteger(e.id.low) && r.isInteger(e.id.high)) ? "id: integer|Long expected" : null != e.progress && e.hasOwnProperty("progress") && !r.isInteger(e.progress) ? "progress: integer expected" : null != e.mode && e.hasOwnProperty("mode") && !r.isInteger(e.mode) ? "mode: integer expected" : null != e.fontsize && e.hasOwnProperty("fontsize") && !r.isInteger(e.fontsize) ? "fontsize: integer expected" : null != e.color && e.hasOwnProperty("color") && !r.isInteger(e.color) ? "color: integer expected" : null != e.midHash && e.hasOwnProperty("midHash") && !r.isString(e.midHash) ? "midHash: string expected" : null != e.content && e.hasOwnProperty("content") && !r.isString(e.content) ? "content: string expected" : null != e.ctime && e.hasOwnProperty("ctime") && !r.isInteger(e.ctime) && !(e.ctime && r.isInteger(e.ctime.low) && r.isInteger(e.ctime.high)) ? "ctime: integer|Long expected" : null != e.weight && e.hasOwnProperty("weight") && !r.isInteger(e.weight) ? "weight: integer expected" : null != e.action && e.hasOwnProperty("action") && !r.isString(e.action) ? "action: string expected" : null != e.pool && e.hasOwnProperty("pool") && !r.isInteger(e.pool) ? "pool: integer expected" : null != e.idStr && e.hasOwnProperty("idStr") && !r.isString(e.idStr) ? "idStr: string expected" : null != e.attr && e.hasOwnProperty("attr") && !r.isInteger(e.attr) ? "attr: integer expected" : null != e.animation && e.hasOwnProperty("animation") && !r.isString(e.animation) ? "animation: string expected" : null != e.likeNum && e.hasOwnProperty("likeNum") && !r.isInteger(e.likeNum) ? "likeNum: integer expected" : null != e.colorV2 && e.hasOwnProperty("colorV2") && !r.isString(e.colorV2) ? "colorV2: string expected" : null != e.dmTypeV2 && e.hasOwnProperty("dmTypeV2") && !r.isInteger(e.dmTypeV2) ? "dmTypeV2: integer expected" : null;
314
+ }, o.fromObject = function(e) {
315
+ if (e instanceof i.biliproto.community.service.dm.v1.DanmakuElem) return e;
316
+ var t = new i.biliproto.community.service.dm.v1.DanmakuElem();
317
+ return null != e.id && (r.Long ? (t.id = r.Long.fromValue(e.id)).unsigned = !1 : "string" == typeof e.id ? t.id = parseInt(e.id, 10) : "number" == typeof e.id ? t.id = e.id : "object" == typeof e.id && (t.id = new r.LongBits(e.id.low >>> 0, e.id.high >>> 0).toNumber())), null != e.progress && (t.progress = 0 | e.progress), null != e.mode && (t.mode = 0 | e.mode), null != e.fontsize && (t.fontsize = 0 | e.fontsize), null != e.color && (t.color = e.color >>> 0), null != e.midHash && (t.midHash = String(e.midHash)), null != e.content && (t.content = String(e.content)), null != e.ctime && (r.Long ? (t.ctime = r.Long.fromValue(e.ctime)).unsigned = !1 : "string" == typeof e.ctime ? t.ctime = parseInt(e.ctime, 10) : "number" == typeof e.ctime ? t.ctime = e.ctime : "object" == typeof e.ctime && (t.ctime = new r.LongBits(e.ctime.low >>> 0, e.ctime.high >>> 0).toNumber())), null != e.weight && (t.weight = 0 | e.weight), null != e.action && (t.action = String(e.action)), null != e.pool && (t.pool = 0 | e.pool), null != e.idStr && (t.idStr = String(e.idStr)), null != e.attr && (t.attr = 0 | e.attr), null != e.animation && (t.animation = String(e.animation)), null != e.likeNum && (t.likeNum = e.likeNum >>> 0), null != e.colorV2 && (t.colorV2 = String(e.colorV2)), null != e.dmTypeV2 && (t.dmTypeV2 = e.dmTypeV2 >>> 0), t;
318
+ }, o.toObject = function(e, t) {
319
+ t || (t = {});
320
+ var n = {};
321
+ if (t.defaults) {
322
+ if (r.Long) {
323
+ var i = new r.Long(0, 0, !1);
324
+ n.id = t.longs === String ? i.toString() : t.longs === Number ? i.toNumber() : i;
325
+ } else n.id = t.longs === String ? "0" : 0;
326
+ if (n.progress = 0, n.mode = 0, n.fontsize = 0, n.color = 0, n.midHash = "", n.content = "", r.Long) {
327
+ var i = new r.Long(0, 0, !1);
328
+ n.ctime = t.longs === String ? i.toString() : t.longs === Number ? i.toNumber() : i;
329
+ } else n.ctime = t.longs === String ? "0" : 0;
330
+ n.weight = 0, n.action = "", n.pool = 0, n.idStr = "", n.attr = 0, n.animation = "", n.likeNum = 0, n.colorV2 = "", n.dmTypeV2 = 0;
331
+ }
332
+ return null != e.id && e.hasOwnProperty("id") && ("number" == typeof e.id ? n.id = t.longs === String ? String(e.id) : e.id : n.id = t.longs === String ? r.Long.prototype.toString.call(e.id) : t.longs === Number ? new r.LongBits(e.id.low >>> 0, e.id.high >>> 0).toNumber() : e.id), null != e.progress && e.hasOwnProperty("progress") && (n.progress = e.progress), null != e.mode && e.hasOwnProperty("mode") && (n.mode = e.mode), null != e.fontsize && e.hasOwnProperty("fontsize") && (n.fontsize = e.fontsize), null != e.color && e.hasOwnProperty("color") && (n.color = e.color), null != e.midHash && e.hasOwnProperty("midHash") && (n.midHash = e.midHash), null != e.content && e.hasOwnProperty("content") && (n.content = e.content), null != e.ctime && e.hasOwnProperty("ctime") && ("number" == typeof e.ctime ? n.ctime = t.longs === String ? String(e.ctime) : e.ctime : n.ctime = t.longs === String ? r.Long.prototype.toString.call(e.ctime) : t.longs === Number ? new r.LongBits(e.ctime.low >>> 0, e.ctime.high >>> 0).toNumber() : e.ctime), null != e.weight && e.hasOwnProperty("weight") && (n.weight = e.weight), null != e.action && e.hasOwnProperty("action") && (n.action = e.action), null != e.pool && e.hasOwnProperty("pool") && (n.pool = e.pool), null != e.idStr && e.hasOwnProperty("idStr") && (n.idStr = e.idStr), null != e.attr && e.hasOwnProperty("attr") && (n.attr = e.attr), null != e.animation && e.hasOwnProperty("animation") && (n.animation = e.animation), null != e.likeNum && e.hasOwnProperty("likeNum") && (n.likeNum = e.likeNum), null != e.colorV2 && e.hasOwnProperty("colorV2") && (n.colorV2 = e.colorV2), null != e.dmTypeV2 && e.hasOwnProperty("dmTypeV2") && (n.dmTypeV2 = e.dmTypeV2), n;
333
+ }, o.prototype.toJSON = function() {
334
+ return this.constructor.toObject(this, e.util.toJSONOptions);
335
+ }, o.getTypeUrl = function(e) {
336
+ return void 0 === e && (e = "type.googleapis.com"), e + "/biliproto.community.service.dm.v1.DanmakuElem";
337
+ }, o;
338
+ }(), o.Flag = function() {
339
+ function o(e) {
340
+ if (e) for(var t = Object.keys(e), n = 0; n < t.length; ++n)null != e[t[n]] && (this[t[n]] = e[t[n]]);
341
+ }
342
+ return o.prototype.value = 0, o.prototype.description = "", o.create = function(e) {
343
+ return new o(e);
344
+ }, o.encode = function(e, t) {
345
+ return t || (t = n.create()), null != e.value && Object.hasOwnProperty.call(e, "value") && t.uint32(8).int32(e.value), null != e.description && Object.hasOwnProperty.call(e, "description") && t.uint32(18).string(e.description), t;
346
+ }, o.encodeDelimited = function(e, t) {
347
+ return this.encode(e, t).ldelim();
348
+ }, o.decode = function(e, n, r) {
349
+ e instanceof t || (e = t.create(e));
350
+ for(var o = void 0 === n ? e.len : e.pos + n, s = new i.biliproto.community.service.dm.v1.Flag(); e.pos < o;){
351
+ var a = e.uint32();
352
+ if (a === r) break;
353
+ switch(a >>> 3){
354
+ case 1:
355
+ s.value = e.int32();
356
+ break;
357
+ case 2:
358
+ s.description = e.string();
359
+ break;
360
+ default:
361
+ e.skipType(7 & a);
362
+ }
363
+ }
364
+ return s;
365
+ }, o.decodeDelimited = function(e) {
366
+ return e instanceof t || (e = new t(e)), this.decode(e, e.uint32());
367
+ }, o.verify = function(e) {
368
+ return "object" != typeof e || null === e ? "object expected" : null != e.value && e.hasOwnProperty("value") && !r.isInteger(e.value) ? "value: integer expected" : null != e.description && e.hasOwnProperty("description") && !r.isString(e.description) ? "description: string expected" : null;
369
+ }, o.fromObject = function(e) {
370
+ if (e instanceof i.biliproto.community.service.dm.v1.Flag) return e;
371
+ var t = new i.biliproto.community.service.dm.v1.Flag();
372
+ return null != e.value && (t.value = 0 | e.value), null != e.description && (t.description = String(e.description)), t;
373
+ }, o.toObject = function(e, t) {
374
+ t || (t = {});
375
+ var n = {};
376
+ return t.defaults && (n.value = 0, n.description = ""), null != e.value && e.hasOwnProperty("value") && (n.value = e.value), null != e.description && e.hasOwnProperty("description") && (n.description = e.description), n;
377
+ }, o.prototype.toJSON = function() {
378
+ return this.constructor.toObject(this, e.util.toJSONOptions);
379
+ }, o.getTypeUrl = function(e) {
380
+ return void 0 === e && (e = "type.googleapis.com"), e + "/biliproto.community.service.dm.v1.Flag";
381
+ }, o;
382
+ }(), o.DmSegMobileReply = function() {
383
+ function o(e) {
384
+ if (this.elems = [], e) for(var t = Object.keys(e), n = 0; n < t.length; ++n)null != e[t[n]] && (this[t[n]] = e[t[n]]);
385
+ }
386
+ return o.prototype.elems = r.emptyArray, o.prototype.state = 0, o.prototype.aiFlagForSummary = null, o.create = function(e) {
387
+ return new o(e);
388
+ }, o.encode = function(e, t) {
389
+ if (t || (t = n.create()), null != e.elems && e.elems.length) for(var r = 0; r < e.elems.length; ++r)i.biliproto.community.service.dm.v1.DanmakuElem.encode(e.elems[r], t.uint32(10).fork()).ldelim();
390
+ return null != e.state && Object.hasOwnProperty.call(e, "state") && t.uint32(16).int32(e.state), null != e.aiFlagForSummary && Object.hasOwnProperty.call(e, "aiFlagForSummary") && i.biliproto.community.service.dm.v1.Flag.encode(e.aiFlagForSummary, t.uint32(26).fork()).ldelim(), t;
391
+ }, o.encodeDelimited = function(e, t) {
392
+ return this.encode(e, t).ldelim();
393
+ }, o.decode = function(e, n, r) {
394
+ e instanceof t || (e = t.create(e));
395
+ for(var o = void 0 === n ? e.len : e.pos + n, s = new i.biliproto.community.service.dm.v1.DmSegMobileReply(); e.pos < o;){
396
+ var a = e.uint32();
397
+ if (a === r) break;
398
+ switch(a >>> 3){
399
+ case 1:
400
+ s.elems && s.elems.length || (s.elems = []), s.elems.push(i.biliproto.community.service.dm.v1.DanmakuElem.decode(e, e.uint32()));
401
+ break;
402
+ case 2:
403
+ s.state = e.int32();
404
+ break;
405
+ case 3:
406
+ s.aiFlagForSummary = i.biliproto.community.service.dm.v1.Flag.decode(e, e.uint32());
407
+ break;
408
+ default:
409
+ e.skipType(7 & a);
410
+ }
411
+ }
412
+ return s;
413
+ }, o.decodeDelimited = function(e) {
414
+ return e instanceof t || (e = new t(e)), this.decode(e, e.uint32());
415
+ }, o.verify = function(e) {
416
+ if ("object" != typeof e || null === e) return "object expected";
417
+ if (null != e.elems && e.hasOwnProperty("elems")) {
418
+ if (!Array.isArray(e.elems)) return "elems: array expected";
419
+ for(var t = 0; t < e.elems.length; ++t){
420
+ var n = i.biliproto.community.service.dm.v1.DanmakuElem.verify(e.elems[t]);
421
+ if (n) return "elems." + n;
422
+ }
423
+ }
424
+ if (null != e.state && e.hasOwnProperty("state") && !r.isInteger(e.state)) return "state: integer expected";
425
+ if (null != e.aiFlagForSummary && e.hasOwnProperty("aiFlagForSummary")) {
426
+ var n = i.biliproto.community.service.dm.v1.Flag.verify(e.aiFlagForSummary);
427
+ if (n) return "aiFlagForSummary." + n;
428
+ }
429
+ return null;
430
+ }, o.fromObject = function(e) {
431
+ if (e instanceof i.biliproto.community.service.dm.v1.DmSegMobileReply) return e;
432
+ var t = new i.biliproto.community.service.dm.v1.DmSegMobileReply();
433
+ if (e.elems) {
434
+ if (!Array.isArray(e.elems)) throw TypeError(".biliproto.community.service.dm.v1.DmSegMobileReply.elems: array expected");
435
+ t.elems = [];
436
+ for(var n = 0; n < e.elems.length; ++n){
437
+ if ("object" != typeof e.elems[n]) throw TypeError(".biliproto.community.service.dm.v1.DmSegMobileReply.elems: object expected");
438
+ t.elems[n] = i.biliproto.community.service.dm.v1.DanmakuElem.fromObject(e.elems[n]);
439
+ }
440
+ }
441
+ if (null != e.state && (t.state = 0 | e.state), null != e.aiFlagForSummary) {
442
+ if ("object" != typeof e.aiFlagForSummary) throw TypeError(".biliproto.community.service.dm.v1.DmSegMobileReply.aiFlagForSummary: object expected");
443
+ t.aiFlagForSummary = i.biliproto.community.service.dm.v1.Flag.fromObject(e.aiFlagForSummary);
444
+ }
445
+ return t;
446
+ }, o.toObject = function(e, t) {
447
+ t || (t = {});
448
+ var n = {};
449
+ if ((t.arrays || t.defaults) && (n.elems = []), t.defaults && (n.state = 0, n.aiFlagForSummary = null), e.elems && e.elems.length) {
450
+ n.elems = [];
451
+ for(var r = 0; r < e.elems.length; ++r)n.elems[r] = i.biliproto.community.service.dm.v1.DanmakuElem.toObject(e.elems[r], t);
452
+ }
453
+ return null != e.state && e.hasOwnProperty("state") && (n.state = e.state), null != e.aiFlagForSummary && e.hasOwnProperty("aiFlagForSummary") && (n.aiFlagForSummary = i.biliproto.community.service.dm.v1.Flag.toObject(e.aiFlagForSummary, t)), n;
454
+ }, o.prototype.toJSON = function() {
455
+ return this.constructor.toObject(this, e.util.toJSONOptions);
456
+ }, o.getTypeUrl = function(e) {
457
+ return void 0 === e && (e = "type.googleapis.com"), e + "/biliproto.community.service.dm.v1.DmSegMobileReply";
458
+ }, o;
459
+ }(), o;
460
+ }(), o;
461
+ }(), o;
462
+ }(), o;
463
+ }(), o;
464
+ }(), i;
465
+ });
466
+ },
220
467
  "../../node_modules/.pnpm/crypto-js@4.2.0/node_modules/crypto-js/core.js": function(e, t, n) {
221
468
  !function(n, r) {
222
469
  e.exports = t = r();
@@ -267,7 +514,7 @@ var __webpack_modules__ = {
267
514
  e = this.words = e || [], t != n ? this.sigBytes = n : this.sigBytes = 4 * e.length;
268
515
  },
269
516
  toString: function(e) {
270
- return (e || p).stringify(this);
517
+ return (e || d).stringify(this);
271
518
  },
272
519
  concat: function(e) {
273
520
  var t = this.words, n = e.words, r = this.sigBytes, i = e.sigBytes;
@@ -290,7 +537,7 @@ var __webpack_modules__ = {
290
537
  for(var t = [], n = 0; n < e; n += 4)t.push(i());
291
538
  return new l.init(t, e);
292
539
  }
293
- }), c = s.enc = {}, p = c.Hex = {
540
+ }), c = s.enc = {}, d = c.Hex = {
294
541
  stringify: function(e) {
295
542
  for(var t = e.words, n = e.sigBytes, r = [], i = 0; i < n; i++){
296
543
  var o = t[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
@@ -302,7 +549,7 @@ var __webpack_modules__ = {
302
549
  for(var t = e.length, n = [], r = 0; r < t; r += 2)n[r >>> 3] |= parseInt(e.substr(r, 2), 16) << 24 - r % 8 * 4;
303
550
  return new l.init(n, t / 2);
304
551
  }
305
- }, d = c.Latin1 = {
552
+ }, p = c.Latin1 = {
306
553
  stringify: function(e) {
307
554
  for(var t = e.words, n = e.sigBytes, r = [], i = 0; i < n; i++){
308
555
  var o = t[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
@@ -317,13 +564,13 @@ var __webpack_modules__ = {
317
564
  }, f = c.Utf8 = {
318
565
  stringify: function(e) {
319
566
  try {
320
- return decodeURIComponent(escape(d.stringify(e)));
567
+ return decodeURIComponent(escape(p.stringify(e)));
321
568
  } catch (e) {
322
569
  throw Error('Malformed UTF-8 data');
323
570
  }
324
571
  },
325
572
  parse: function(e) {
326
- return d.parse(unescape(encodeURIComponent(e)));
573
+ return p.parse(unescape(encodeURIComponent(e)));
327
574
  }
328
575
  }, h = a.BufferedBlockAlgorithm = u.extend({
329
576
  reset: function() {
@@ -335,7 +582,7 @@ var __webpack_modules__ = {
335
582
  _process: function(t) {
336
583
  var n, r = this._data, i = r.words, o = r.sigBytes, s = this.blockSize, a = o / (4 * s), u = (a = t ? e.ceil(a) : e.max((0 | a) - this._minBufferSize, 0)) * s, c = e.min(4 * u, o);
337
584
  if (u) {
338
- for(var p = 0; p < u; p += s)this._doProcessBlock(i, p);
585
+ for(var d = 0; d < u; d += s)this._doProcessBlock(i, d);
339
586
  n = i.splice(0, u), r.sigBytes -= c;
340
587
  }
341
588
  return new l.init(n, c);
@@ -448,8 +695,8 @@ var __webpack_modules__ = {
448
695
  var r = t + n, i = e[r];
449
696
  e[r] = (i << 8 | i >>> 24) & 0x00ff00ff | (i << 24 | i >>> 8) & 0xff00ff00;
450
697
  }
451
- var o = this._hash.words, s = e[t + 0], u = e[t + 1], f = e[t + 2], h = e[t + 3], m = e[t + 4], g = e[t + 5], y = e[t + 6], v = e[t + 7], b = e[t + 8], _ = e[t + 9], w = e[t + 10], k = e[t + 11], x = e[t + 12], j = e[t + 13], E = e[t + 14], z = e[t + 15], S = o[0], O = o[1], $ = o[2], I = o[3];
452
- S = l(S, O, $, I, s, 7, a[0]), I = l(I, S, O, $, u, 12, a[1]), $ = l($, I, S, O, f, 17, a[2]), O = l(O, $, I, S, h, 22, a[3]), S = l(S, O, $, I, m, 7, a[4]), I = l(I, S, O, $, g, 12, a[5]), $ = l($, I, S, O, y, 17, a[6]), O = l(O, $, I, S, v, 22, a[7]), S = l(S, O, $, I, b, 7, a[8]), I = l(I, S, O, $, _, 12, a[9]), $ = l($, I, S, O, w, 17, a[10]), O = l(O, $, I, S, k, 22, a[11]), S = l(S, O, $, I, x, 7, a[12]), I = l(I, S, O, $, j, 12, a[13]), $ = l($, I, S, O, E, 17, a[14]), O = l(O, $, I, S, z, 22, a[15]), S = c(S, O, $, I, u, 5, a[16]), I = c(I, S, O, $, y, 9, a[17]), $ = c($, I, S, O, k, 14, a[18]), O = c(O, $, I, S, s, 20, a[19]), S = c(S, O, $, I, g, 5, a[20]), I = c(I, S, O, $, w, 9, a[21]), $ = c($, I, S, O, z, 14, a[22]), O = c(O, $, I, S, m, 20, a[23]), S = c(S, O, $, I, _, 5, a[24]), I = c(I, S, O, $, E, 9, a[25]), $ = c($, I, S, O, h, 14, a[26]), O = c(O, $, I, S, b, 20, a[27]), S = c(S, O, $, I, j, 5, a[28]), I = c(I, S, O, $, f, 9, a[29]), $ = c($, I, S, O, v, 14, a[30]), O = c(O, $, I, S, x, 20, a[31]), S = p(S, O, $, I, g, 4, a[32]), I = p(I, S, O, $, b, 11, a[33]), $ = p($, I, S, O, k, 16, a[34]), O = p(O, $, I, S, E, 23, a[35]), S = p(S, O, $, I, u, 4, a[36]), I = p(I, S, O, $, m, 11, a[37]), $ = p($, I, S, O, v, 16, a[38]), O = p(O, $, I, S, w, 23, a[39]), S = p(S, O, $, I, j, 4, a[40]), I = p(I, S, O, $, s, 11, a[41]), $ = p($, I, S, O, h, 16, a[42]), O = p(O, $, I, S, y, 23, a[43]), S = p(S, O, $, I, _, 4, a[44]), I = p(I, S, O, $, x, 11, a[45]), $ = p($, I, S, O, z, 16, a[46]), O = p(O, $, I, S, f, 23, a[47]), S = d(S, O, $, I, s, 6, a[48]), I = d(I, S, O, $, v, 10, a[49]), $ = d($, I, S, O, E, 15, a[50]), O = d(O, $, I, S, g, 21, a[51]), S = d(S, O, $, I, x, 6, a[52]), I = d(I, S, O, $, h, 10, a[53]), $ = d($, I, S, O, w, 15, a[54]), O = d(O, $, I, S, u, 21, a[55]), S = d(S, O, $, I, b, 6, a[56]), I = d(I, S, O, $, z, 10, a[57]), $ = d($, I, S, O, y, 15, a[58]), O = d(O, $, I, S, j, 21, a[59]), S = d(S, O, $, I, m, 6, a[60]), I = d(I, S, O, $, k, 10, a[61]), $ = d($, I, S, O, f, 15, a[62]), O = d(O, $, I, S, _, 21, a[63]), o[0] = o[0] + S | 0, o[1] = o[1] + O | 0, o[2] = o[2] + $ | 0, o[3] = o[3] + I | 0;
698
+ var o = this._hash.words, s = e[t + 0], u = e[t + 1], f = e[t + 2], h = e[t + 3], m = e[t + 4], g = e[t + 5], v = e[t + 6], y = e[t + 7], b = e[t + 8], _ = e[t + 9], w = e[t + 10], x = e[t + 11], k = e[t + 12], j = e[t + 13], S = e[t + 14], E = e[t + 15], z = o[0], O = o[1], I = o[2], $ = o[3];
699
+ z = l(z, O, I, $, s, 7, a[0]), $ = l($, z, O, I, u, 12, a[1]), I = l(I, $, z, O, f, 17, a[2]), O = l(O, I, $, z, h, 22, a[3]), z = l(z, O, I, $, m, 7, a[4]), $ = l($, z, O, I, g, 12, a[5]), I = l(I, $, z, O, v, 17, a[6]), O = l(O, I, $, z, y, 22, a[7]), z = l(z, O, I, $, b, 7, a[8]), $ = l($, z, O, I, _, 12, a[9]), I = l(I, $, z, O, w, 17, a[10]), O = l(O, I, $, z, x, 22, a[11]), z = l(z, O, I, $, k, 7, a[12]), $ = l($, z, O, I, j, 12, a[13]), I = l(I, $, z, O, S, 17, a[14]), O = l(O, I, $, z, E, 22, a[15]), z = c(z, O, I, $, u, 5, a[16]), $ = c($, z, O, I, v, 9, a[17]), I = c(I, $, z, O, x, 14, a[18]), O = c(O, I, $, z, s, 20, a[19]), z = c(z, O, I, $, g, 5, a[20]), $ = c($, z, O, I, w, 9, a[21]), I = c(I, $, z, O, E, 14, a[22]), O = c(O, I, $, z, m, 20, a[23]), z = c(z, O, I, $, _, 5, a[24]), $ = c($, z, O, I, S, 9, a[25]), I = c(I, $, z, O, h, 14, a[26]), O = c(O, I, $, z, b, 20, a[27]), z = c(z, O, I, $, j, 5, a[28]), $ = c($, z, O, I, f, 9, a[29]), I = c(I, $, z, O, y, 14, a[30]), O = c(O, I, $, z, k, 20, a[31]), z = d(z, O, I, $, g, 4, a[32]), $ = d($, z, O, I, b, 11, a[33]), I = d(I, $, z, O, x, 16, a[34]), O = d(O, I, $, z, S, 23, a[35]), z = d(z, O, I, $, u, 4, a[36]), $ = d($, z, O, I, m, 11, a[37]), I = d(I, $, z, O, y, 16, a[38]), O = d(O, I, $, z, w, 23, a[39]), z = d(z, O, I, $, j, 4, a[40]), $ = d($, z, O, I, s, 11, a[41]), I = d(I, $, z, O, h, 16, a[42]), O = d(O, I, $, z, v, 23, a[43]), z = d(z, O, I, $, _, 4, a[44]), $ = d($, z, O, I, k, 11, a[45]), I = d(I, $, z, O, E, 16, a[46]), O = d(O, I, $, z, f, 23, a[47]), z = p(z, O, I, $, s, 6, a[48]), $ = p($, z, O, I, y, 10, a[49]), I = p(I, $, z, O, S, 15, a[50]), O = p(O, I, $, z, g, 21, a[51]), z = p(z, O, I, $, k, 6, a[52]), $ = p($, z, O, I, h, 10, a[53]), I = p(I, $, z, O, w, 15, a[54]), O = p(O, I, $, z, u, 21, a[55]), z = p(z, O, I, $, b, 6, a[56]), $ = p($, z, O, I, E, 10, a[57]), I = p(I, $, z, O, v, 15, a[58]), O = p(O, I, $, z, j, 21, a[59]), z = p(z, O, I, $, m, 6, a[60]), $ = p($, z, O, I, x, 10, a[61]), I = p(I, $, z, O, f, 15, a[62]), O = p(O, I, $, z, _, 21, a[63]), o[0] = o[0] + z | 0, o[1] = o[1] + O | 0, o[2] = o[2] + I | 0, o[3] = o[3] + $ | 0;
453
700
  },
454
701
  _doFinalize: function() {
455
702
  var e = this._data, n = e.words, r = 8 * this._nDataBytes, i = 8 * e.sigBytes;
@@ -475,11 +722,11 @@ var __webpack_modules__ = {
475
722
  var a = e + (t & r | n & ~r) + i + s;
476
723
  return (a << o | a >>> 32 - o) + t;
477
724
  }
478
- function p(e, t, n, r, i, o, s) {
725
+ function d(e, t, n, r, i, o, s) {
479
726
  var a = e + (t ^ n ^ r) + i + s;
480
727
  return (a << o | a >>> 32 - o) + t;
481
728
  }
482
- function d(e, t, n, r, i, o, s) {
729
+ function p(e, t, n, r, i, o, s) {
483
730
  var a = e + (n ^ (t | ~r)) + i + s;
484
731
  return (a << o | a >>> 32 - o) + t;
485
732
  }
@@ -519,7 +766,7 @@ var __webpack_modules__ = {
519
766
  })(e);
520
767
  } : l;
521
768
  };
522
- function p() {
769
+ function d() {
523
770
  var e = new o(0, 0), t = 0;
524
771
  if (this.len - this.pos > 4) {
525
772
  for(; t < 4; ++t)if (e.lo = (e.lo | (127 & this.buf[this.pos]) << 7 * t) >>> 0, this.buf[this.pos++] < 128) return e;
@@ -540,12 +787,12 @@ var __webpack_modules__ = {
540
787
  }
541
788
  throw Error("invalid varint encoding");
542
789
  }
543
- function d(e, t) {
790
+ function p(e, t) {
544
791
  return (e[t - 4] | e[t - 3] << 8 | e[t - 2] << 16 | e[t - 1] << 24) >>> 0;
545
792
  }
546
793
  function f() {
547
794
  if (this.pos + 8 > this.len) throw a(this, 8);
548
- return new o(d(this.buf, this.pos += 4), d(this.buf, this.pos += 4));
795
+ return new o(p(this.buf, this.pos += 4), p(this.buf, this.pos += 4));
549
796
  }
550
797
  u.create = c(), u.prototype._slice = i.Array.prototype.subarray || i.Array.prototype.slice, u.prototype.uint32 = function() {
551
798
  var e = 4294967295;
@@ -563,10 +810,10 @@ var __webpack_modules__ = {
563
810
  return 0 !== this.uint32();
564
811
  }, u.prototype.fixed32 = function() {
565
812
  if (this.pos + 4 > this.len) throw a(this, 4);
566
- return d(this.buf, this.pos += 4);
813
+ return p(this.buf, this.pos += 4);
567
814
  }, u.prototype.sfixed32 = function() {
568
815
  if (this.pos + 4 > this.len) throw a(this, 4);
569
- return 0 | d(this.buf, this.pos += 4);
816
+ return 0 | p(this.buf, this.pos += 4);
570
817
  }, u.prototype.float = function() {
571
818
  if (this.pos + 4 > this.len) throw a(this, 4);
572
819
  var e = i.float.readFloatLE(this.buf, this.pos);
@@ -620,13 +867,13 @@ var __webpack_modules__ = {
620
867
  var t = i.Long ? "toLong" : "toNumber";
621
868
  i.merge(u.prototype, {
622
869
  int64: function() {
623
- return p.call(this)[t](!1);
870
+ return d.call(this)[t](!1);
624
871
  },
625
872
  uint64: function() {
626
- return p.call(this)[t](!0);
873
+ return d.call(this)[t](!0);
627
874
  },
628
875
  sint64: function() {
629
- return p.call(this).zzDecode()[t](!1);
876
+ return d.call(this).zzDecode()[t](!1);
630
877
  },
631
878
  fixed64: function() {
632
879
  return f.call(this)[t](!0);
@@ -843,7 +1090,7 @@ var __webpack_modules__ = {
843
1090
  };
844
1091
  },
845
1092
  "../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/writer.js": function(e, t, n) {
846
- e.exports = p;
1093
+ e.exports = d;
847
1094
  var r, i = n("../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/util/minimal.js"), o = i.LongBits, s = i.base64, a = i.utf8;
848
1095
  function u(e, t, n) {
849
1096
  this.fn = e, this.len = t, this.next = void 0, this.val = n;
@@ -852,16 +1099,16 @@ var __webpack_modules__ = {
852
1099
  function c(e) {
853
1100
  this.head = e.head, this.tail = e.tail, this.len = e.len, this.next = e.states;
854
1101
  }
855
- function p() {
1102
+ function d() {
856
1103
  this.len = 0, this.head = new u(l, 0, 0), this.tail = this.head, this.states = null;
857
1104
  }
858
- var d = function() {
1105
+ var p = function() {
859
1106
  return i.Buffer ? function() {
860
- return (p.create = function() {
1107
+ return (d.create = function() {
861
1108
  return new r();
862
1109
  })();
863
1110
  } : function() {
864
- return new p();
1111
+ return new d();
865
1112
  };
866
1113
  };
867
1114
  function f(e, t, n) {
@@ -879,65 +1126,65 @@ var __webpack_modules__ = {
879
1126
  for(; e.lo > 127;)t[n++] = 127 & e.lo | 128, e.lo = e.lo >>> 7;
880
1127
  t[n++] = e.lo;
881
1128
  }
882
- function y(e, t, n) {
1129
+ function v(e, t, n) {
883
1130
  t[n] = 255 & e, t[n + 1] = e >>> 8 & 255, t[n + 2] = e >>> 16 & 255, t[n + 3] = e >>> 24;
884
1131
  }
885
- p.create = d(), p.alloc = function(e) {
1132
+ d.create = p(), d.alloc = function(e) {
886
1133
  return new i.Array(e);
887
- }, i.Array !== Array && (p.alloc = i.pool(p.alloc, i.Array.prototype.subarray)), p.prototype._push = function(e, t, n) {
1134
+ }, i.Array !== Array && (d.alloc = i.pool(d.alloc, i.Array.prototype.subarray)), d.prototype._push = function(e, t, n) {
888
1135
  return this.tail = this.tail.next = new u(e, t, n), this.len += t, this;
889
- }, m.prototype = Object.create(u.prototype), m.prototype.fn = h, p.prototype.uint32 = function(e) {
1136
+ }, m.prototype = Object.create(u.prototype), m.prototype.fn = h, d.prototype.uint32 = function(e) {
890
1137
  return this.len += (this.tail = this.tail.next = new m((e >>>= 0) < 128 ? 1 : e < 16384 ? 2 : e < 2097152 ? 3 : e < 268435456 ? 4 : 5, e)).len, this;
891
- }, p.prototype.int32 = function(e) {
1138
+ }, d.prototype.int32 = function(e) {
892
1139
  return e < 0 ? this._push(g, 10, o.fromNumber(e)) : this.uint32(e);
893
- }, p.prototype.sint32 = function(e) {
1140
+ }, d.prototype.sint32 = function(e) {
894
1141
  return this.uint32((e << 1 ^ e >> 31) >>> 0);
895
- }, p.prototype.uint64 = function(e) {
1142
+ }, d.prototype.uint64 = function(e) {
896
1143
  var t = o.from(e);
897
1144
  return this._push(g, t.length(), t);
898
- }, p.prototype.int64 = p.prototype.uint64, p.prototype.sint64 = function(e) {
1145
+ }, d.prototype.int64 = d.prototype.uint64, d.prototype.sint64 = function(e) {
899
1146
  var t = o.from(e).zzEncode();
900
1147
  return this._push(g, t.length(), t);
901
- }, p.prototype.bool = function(e) {
1148
+ }, d.prototype.bool = function(e) {
902
1149
  return this._push(f, 1, +!!e);
903
- }, p.prototype.fixed32 = function(e) {
904
- return this._push(y, 4, e >>> 0);
905
- }, p.prototype.sfixed32 = p.prototype.fixed32, p.prototype.fixed64 = function(e) {
1150
+ }, d.prototype.fixed32 = function(e) {
1151
+ return this._push(v, 4, e >>> 0);
1152
+ }, d.prototype.sfixed32 = d.prototype.fixed32, d.prototype.fixed64 = function(e) {
906
1153
  var t = o.from(e);
907
- return this._push(y, 4, t.lo)._push(y, 4, t.hi);
908
- }, p.prototype.sfixed64 = p.prototype.fixed64, p.prototype.float = function(e) {
1154
+ return this._push(v, 4, t.lo)._push(v, 4, t.hi);
1155
+ }, d.prototype.sfixed64 = d.prototype.fixed64, d.prototype.float = function(e) {
909
1156
  return this._push(i.float.writeFloatLE, 4, e);
910
- }, p.prototype.double = function(e) {
1157
+ }, d.prototype.double = function(e) {
911
1158
  return this._push(i.float.writeDoubleLE, 8, e);
912
1159
  };
913
- var v = i.Array.prototype.set ? function(e, t, n) {
1160
+ var y = i.Array.prototype.set ? function(e, t, n) {
914
1161
  t.set(e, n);
915
1162
  } : function(e, t, n) {
916
1163
  for(var r = 0; r < e.length; ++r)t[n + r] = e[r];
917
1164
  };
918
- p.prototype.bytes = function(e) {
1165
+ d.prototype.bytes = function(e) {
919
1166
  var t = e.length >>> 0;
920
1167
  if (!t) return this._push(f, 1, 0);
921
1168
  if (i.isString(e)) {
922
- var n = p.alloc(t = s.length(e));
1169
+ var n = d.alloc(t = s.length(e));
923
1170
  s.decode(e, n, 0), e = n;
924
1171
  }
925
- return this.uint32(t)._push(v, t, e);
926
- }, p.prototype.string = function(e) {
1172
+ return this.uint32(t)._push(y, t, e);
1173
+ }, d.prototype.string = function(e) {
927
1174
  var t = a.length(e);
928
1175
  return t ? this.uint32(t)._push(a.write, t, e) : this._push(f, 1, 0);
929
- }, p.prototype.fork = function() {
1176
+ }, d.prototype.fork = function() {
930
1177
  return this.states = new c(this), this.head = this.tail = new u(l, 0, 0), this.len = 0, this;
931
- }, p.prototype.reset = function() {
1178
+ }, d.prototype.reset = function() {
932
1179
  return this.states ? (this.head = this.states.head, this.tail = this.states.tail, this.len = this.states.len, this.states = this.states.next) : (this.head = this.tail = new u(l, 0, 0), this.len = 0), this;
933
- }, p.prototype.ldelim = function() {
1180
+ }, d.prototype.ldelim = function() {
934
1181
  var e = this.head, t = this.tail, n = this.len;
935
1182
  return this.reset().uint32(n), n && (this.tail.next = e.next, this.tail = t, this.len += n), this;
936
- }, p.prototype.finish = function() {
1183
+ }, d.prototype.finish = function() {
937
1184
  for(var e = this.head.next, t = this.constructor.alloc(this.len), n = 0; e;)e.fn(e.val, t, n), n += e.len, e = e.next;
938
1185
  return t;
939
- }, p._configure = function(e) {
940
- r = e, p.create = d(), r._configure();
1186
+ }, d._configure = function(e) {
1187
+ r = e, d.create = p(), r._configure();
941
1188
  };
942
1189
  },
943
1190
  "../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/writer_buffer.js": function(e, t, n) {
@@ -1021,10 +1268,10 @@ var __webpack_modules__ = {
1021
1268
  },
1022
1269
  "../../node_modules/.pnpm/url-parse@1.5.10/node_modules/url-parse/index.js": function(e, t, n) {
1023
1270
  var r = n("../../node_modules/.pnpm/requires-port@1.0.0/node_modules/requires-port/index.js"), i = n("../../node_modules/.pnpm/querystringify@2.2.0/node_modules/querystringify/index.js"), o = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/, s = /[\n\r\t]/g, a = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//, u = /:\d+$/, l = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i, c = /^[a-zA-Z]:/;
1024
- function p(e) {
1271
+ function d(e) {
1025
1272
  return (e || '').toString().replace(o, '');
1026
1273
  }
1027
- var d = [
1274
+ var p = [
1028
1275
  [
1029
1276
  '#',
1030
1277
  'hash'
@@ -1071,8 +1318,8 @@ var __webpack_modules__ = {
1071
1318
  };
1072
1319
  function h(e) {
1073
1320
  var t, r, i = (t = 'undefined' != typeof window ? window : void 0 !== n.g ? n.g : 'undefined' != typeof self ? self : {}).location || {}, o = {}, s = typeof (e = e || i);
1074
- if ('blob:' === e.protocol) o = new v(unescape(e.pathname), {});
1075
- else if ('string' === s) for(r in o = new v(e, {}), f)delete o[r];
1321
+ if ('blob:' === e.protocol) o = new y(unescape(e.pathname), {});
1322
+ else if ('string' === s) for(r in o = new y(e, {}), f)delete o[r];
1076
1323
  else if ('object' === s) {
1077
1324
  for(r in e)r in f || (o[r] = e[r]);
1078
1325
  void 0 === o.slashes && (o.slashes = a.test(e.href));
@@ -1083,7 +1330,7 @@ var __webpack_modules__ = {
1083
1330
  return 'file:' === e || 'ftp:' === e || 'http:' === e || 'https:' === e || 'ws:' === e || 'wss:' === e;
1084
1331
  }
1085
1332
  function g(e, t) {
1086
- e = (e = p(e)).replace(s, ''), t = t || {};
1333
+ e = (e = d(e)).replace(s, ''), t = t || {};
1087
1334
  var n, r = l.exec(e), i = r[1] ? r[1].toLowerCase() : '', o = !!r[2], a = !!r[3], u = 0;
1088
1335
  return o ? a ? (n = r[2] + r[3] + r[4], u = r[2].length + r[3].length) : (n = r[2] + r[4], u = r[2].length) : a ? (n = r[3] + r[4], u = r[3].length) : n = r[4], 'file:' === i ? u >= 2 && (n = n.slice(2)) : m(i) ? n = r[4] : i ? o && (n = n.slice(2)) : u >= 2 && m(t.protocol) && (n = r[4]), {
1089
1336
  protocol: i,
@@ -1092,27 +1339,27 @@ var __webpack_modules__ = {
1092
1339
  rest: n
1093
1340
  };
1094
1341
  }
1095
- function y(e, t) {
1342
+ function v(e, t) {
1096
1343
  if ('' === e) return t;
1097
1344
  for(var n = (t || '/').split('/').slice(0, -1).concat(e.split('/')), r = n.length, i = n[r - 1], o = !1, s = 0; r--;)'.' === n[r] ? n.splice(r, 1) : '..' === n[r] ? (n.splice(r, 1), s++) : s && (0 === r && (o = !0), n.splice(r, 1), s--);
1098
1345
  return o && n.unshift(''), ('.' === i || '..' === i) && n.push(''), n.join('/');
1099
1346
  }
1100
- function v(e, t, n) {
1101
- if (e = (e = p(e)).replace(s, ''), !(this instanceof v)) return new v(e, t, n);
1102
- var o, a, u, l, f, b, _ = d.slice(), w = typeof t, k = this, x = 0;
1103
- for('object' !== w && 'string' !== w && (n = t, t = null), n && 'function' != typeof n && (n = i.parse), o = !(a = g(e || '', t = h(t))).protocol && !a.slashes, k.slashes = a.slashes || o && t.slashes, k.protocol = a.protocol || t.protocol || '', e = a.rest, ('file:' === a.protocol && (2 !== a.slashesCount || c.test(e)) || !a.slashes && (a.protocol || a.slashesCount < 2 || !m(k.protocol))) && (_[3] = [
1347
+ function y(e, t, n) {
1348
+ if (e = (e = d(e)).replace(s, ''), !(this instanceof y)) return new y(e, t, n);
1349
+ var o, a, u, l, f, b, _ = p.slice(), w = typeof t, x = this, k = 0;
1350
+ for('object' !== w && 'string' !== w && (n = t, t = null), n && 'function' != typeof n && (n = i.parse), o = !(a = g(e || '', t = h(t))).protocol && !a.slashes, x.slashes = a.slashes || o && t.slashes, x.protocol = a.protocol || t.protocol || '', e = a.rest, ('file:' === a.protocol && (2 !== a.slashesCount || c.test(e)) || !a.slashes && (a.protocol || a.slashesCount < 2 || !m(x.protocol))) && (_[3] = [
1104
1351
  /(.*)/,
1105
1352
  'pathname'
1106
- ]); x < _.length; x++){
1107
- if ('function' == typeof (l = _[x])) {
1108
- e = l(e, k);
1353
+ ]); k < _.length; k++){
1354
+ if ('function' == typeof (l = _[k])) {
1355
+ e = l(e, x);
1109
1356
  continue;
1110
1357
  }
1111
- u = l[0], b = l[1], u != u ? k[b] = e : 'string' == typeof u ? ~(f = '@' === u ? e.lastIndexOf(u) : e.indexOf(u)) && ('number' == typeof l[2] ? (k[b] = e.slice(0, f), e = e.slice(f + l[2])) : (k[b] = e.slice(f), e = e.slice(0, f))) : (f = u.exec(e)) && (k[b] = f[1], e = e.slice(0, f.index)), k[b] = k[b] || o && l[3] && t[b] || '', l[4] && (k[b] = k[b].toLowerCase());
1358
+ u = l[0], b = l[1], u != u ? x[b] = e : 'string' == typeof u ? ~(f = '@' === u ? e.lastIndexOf(u) : e.indexOf(u)) && ('number' == typeof l[2] ? (x[b] = e.slice(0, f), e = e.slice(f + l[2])) : (x[b] = e.slice(f), e = e.slice(0, f))) : (f = u.exec(e)) && (x[b] = f[1], e = e.slice(0, f.index)), x[b] = x[b] || o && l[3] && t[b] || '', l[4] && (x[b] = x[b].toLowerCase());
1112
1359
  }
1113
- n && (k.query = n(k.query)), o && t.slashes && '/' !== k.pathname.charAt(0) && ('' !== k.pathname || '' !== t.pathname) && (k.pathname = y(k.pathname, t.pathname)), '/' !== k.pathname.charAt(0) && m(k.protocol) && (k.pathname = '/' + k.pathname), r(k.port, k.protocol) || (k.host = k.hostname, k.port = ''), k.username = k.password = '', k.auth && (~(f = k.auth.indexOf(':')) ? (k.username = k.auth.slice(0, f), k.username = encodeURIComponent(decodeURIComponent(k.username)), k.password = k.auth.slice(f + 1), k.password = encodeURIComponent(decodeURIComponent(k.password))) : k.username = encodeURIComponent(decodeURIComponent(k.auth)), k.auth = k.password ? k.username + ':' + k.password : k.username), k.origin = 'file:' !== k.protocol && m(k.protocol) && k.host ? k.protocol + '//' + k.host : 'null', k.href = k.toString();
1360
+ n && (x.query = n(x.query)), o && t.slashes && '/' !== x.pathname.charAt(0) && ('' !== x.pathname || '' !== t.pathname) && (x.pathname = v(x.pathname, t.pathname)), '/' !== x.pathname.charAt(0) && m(x.protocol) && (x.pathname = '/' + x.pathname), r(x.port, x.protocol) || (x.host = x.hostname, x.port = ''), x.username = x.password = '', x.auth && (~(f = x.auth.indexOf(':')) ? (x.username = x.auth.slice(0, f), x.username = encodeURIComponent(decodeURIComponent(x.username)), x.password = x.auth.slice(f + 1), x.password = encodeURIComponent(decodeURIComponent(x.password))) : x.username = encodeURIComponent(decodeURIComponent(x.auth)), x.auth = x.password ? x.username + ':' + x.password : x.username), x.origin = 'file:' !== x.protocol && m(x.protocol) && x.host ? x.protocol + '//' + x.host : 'null', x.href = x.toString();
1114
1361
  }
1115
- v.prototype = {
1362
+ y.prototype = {
1116
1363
  set: function(e, t, n) {
1117
1364
  var o = this;
1118
1365
  switch(e){
@@ -1146,8 +1393,8 @@ var __webpack_modules__ = {
1146
1393
  var a = t.indexOf(':');
1147
1394
  ~a ? (o.username = t.slice(0, a), o.username = encodeURIComponent(decodeURIComponent(o.username)), o.password = t.slice(a + 1), o.password = encodeURIComponent(decodeURIComponent(o.password))) : o.username = encodeURIComponent(decodeURIComponent(t));
1148
1395
  }
1149
- for(var l = 0; l < d.length; l++){
1150
- var c = d[l];
1396
+ for(var l = 0; l < p.length; l++){
1397
+ var c = p[l];
1151
1398
  c[4] && (o[c[1]] = o[c[1]].toLowerCase());
1152
1399
  }
1153
1400
  return o.auth = o.password ? o.username + ':' + o.password : o.username, o.origin = 'file:' !== o.protocol && m(o.protocol) && o.host ? o.protocol + '//' + o.host : 'null', o.href = o.toString(), o;
@@ -1159,7 +1406,7 @@ var __webpack_modules__ = {
1159
1406
  var s = o + (n.protocol && n.slashes || m(n.protocol) ? '//' : '');
1160
1407
  return n.username ? (s += n.username, n.password && (s += ':' + n.password), s += '@') : n.password ? (s += ':' + n.password, s += '@') : 'file:' !== n.protocol && m(n.protocol) && !r && '/' !== n.pathname && (s += '@'), (':' === r[r.length - 1] || u.test(n.hostname) && !n.port) && (r += ':'), s += r + n.pathname, (t = 'object' == typeof n.query ? e(n.query) : n.query) && (s += '?' !== t.charAt(0) ? '?' + t : t), n.hash && (s += n.hash), s;
1161
1408
  }
1162
- }, v.extractProtocol = g, v.location = h, v.trimLeft = p, v.qs = i, e.exports = v;
1409
+ }, y.extractProtocol = g, y.location = h, y.trimLeft = d, y.qs = i, e.exports = y;
1163
1410
  },
1164
1411
  "?370f": function() {}
1165
1412
  }, __webpack_module_cache__ = {};
@@ -1167,9 +1414,11 @@ function __webpack_require__(e) {
1167
1414
  var t = __webpack_module_cache__[e];
1168
1415
  if (void 0 !== t) return t.exports;
1169
1416
  var n = __webpack_module_cache__[e] = {
1417
+ id: e,
1418
+ loaded: !1,
1170
1419
  exports: {}
1171
1420
  };
1172
- return __webpack_modules__[e].call(n.exports, n, n.exports, __webpack_require__), n.exports;
1421
+ return __webpack_modules__[e].call(n.exports, n, n.exports, __webpack_require__), n.loaded = !0, n.exports;
1173
1422
  }
1174
1423
  (()=>{
1175
1424
  __webpack_require__.n = (e)=>{
@@ -1196,6 +1445,8 @@ function __webpack_require__(e) {
1196
1445
  })();
1197
1446
  })(), (()=>{
1198
1447
  __webpack_require__.o = (e, t)=>Object.prototype.hasOwnProperty.call(e, t);
1448
+ })(), (()=>{
1449
+ __webpack_require__.nmd = (e)=>(e.paths = [], e.children || (e.children = []), e);
1199
1450
  })();
1200
1451
  const DOUBAN_API_KEY = "0ac44ae016490db2204ce0a042db2916", PROVIDER_NAMES = {
1201
1452
  tencent: "\u817E\u8BAF\u89C6\u9891",
@@ -2368,46 +2619,46 @@ const $ZodObject = $constructor("$ZodObject", (e, t)=>{
2368
2619
  let a = t.compile();
2369
2620
  return (t, n)=>a(e, t, n);
2370
2621
  }, s = util_isObject, a = !globalConfig.jitless, u = util_allowsEval, l = a && u.value, c = t.catchall;
2371
- e._zod.parse = (u, p)=>{
2622
+ e._zod.parse = (u, d)=>{
2372
2623
  r ?? (r = i.value);
2373
- let d = u.value;
2374
- if (!s(d)) return u.issues.push({
2624
+ let p = u.value;
2625
+ if (!s(p)) return u.issues.push({
2375
2626
  expected: "object",
2376
2627
  code: "invalid_type",
2377
- input: d,
2628
+ input: p,
2378
2629
  inst: e
2379
2630
  }), u;
2380
2631
  let f = [];
2381
- if (a && l && p?.async === !1 && !0 !== p.jitless) n || (n = o(t.shape)), u = n(u, p);
2632
+ if (a && l && d?.async === !1 && !0 !== d.jitless) n || (n = o(t.shape)), u = n(u, d);
2382
2633
  else {
2383
2634
  u.value = {};
2384
2635
  let e = r.shape;
2385
2636
  for (let t of r.keys){
2386
2637
  let n = e[t]._zod.run({
2387
- value: d[t],
2638
+ value: p[t],
2388
2639
  issues: []
2389
- }, p);
2390
- n instanceof Promise ? f.push(n.then((e)=>handlePropertyResult(e, u, t, d))) : handlePropertyResult(n, u, t, d);
2640
+ }, d);
2641
+ n instanceof Promise ? f.push(n.then((e)=>handlePropertyResult(e, u, t, p))) : handlePropertyResult(n, u, t, p);
2391
2642
  }
2392
2643
  }
2393
2644
  if (!c) return f.length ? Promise.all(f).then(()=>u) : u;
2394
- let h = [], m = r.keySet, g = c._zod, y = g.def.type;
2395
- for (let e of Object.keys(d)){
2645
+ let h = [], m = r.keySet, g = c._zod, v = g.def.type;
2646
+ for (let e of Object.keys(p)){
2396
2647
  if (m.has(e)) continue;
2397
- if ("never" === y) {
2648
+ if ("never" === v) {
2398
2649
  h.push(e);
2399
2650
  continue;
2400
2651
  }
2401
2652
  let t = g.run({
2402
- value: d[e],
2653
+ value: p[e],
2403
2654
  issues: []
2404
- }, p);
2405
- t instanceof Promise ? f.push(t.then((t)=>handlePropertyResult(t, u, e, d))) : handlePropertyResult(t, u, e, d);
2655
+ }, d);
2656
+ t instanceof Promise ? f.push(t.then((t)=>handlePropertyResult(t, u, e, p))) : handlePropertyResult(t, u, e, p);
2406
2657
  }
2407
2658
  return (h.length && u.issues.push({
2408
2659
  code: "unrecognized_keys",
2409
2660
  keys: h,
2410
- input: d,
2661
+ input: p,
2411
2662
  inst: e
2412
2663
  }), f.length) ? Promise.all(f).then(()=>u) : u;
2413
2664
  };
@@ -3676,7 +3927,7 @@ class Storage {
3676
3927
  let t = Widget.storage.get(e);
3677
3928
  if (!t) return null;
3678
3929
  let n = safeJsonParseWithZod(t, StorageValue);
3679
- return n ? (null == n ? void 0 : n.expiresAt) < Date.now() ? (console.warn(`Storage value for key: ${e} has expired`, n), this.remove(e), null) : n.value : (console.warn(`Failed to parse storage value for key: ${e}`, t), this.remove(e), null);
3930
+ return n ? (null == n ? void 0 : n.expiresAt) < Date.now() ? (console.warn(`Storage value for key: ${e} has expired`), this.remove(e), null) : n.value : (console.warn(`Failed to parse storage value for key: ${e}`), this.remove(e), null);
3680
3931
  }
3681
3932
  set(e, t, n) {
3682
3933
  var r;
@@ -3798,11 +4049,11 @@ class Fetch {
3798
4049
  }
3799
4050
  let a = o ? void 0 : n, { timeout: u, schema: l, ...c } = s;
3800
4051
  console.debug("fetch", t, a, c);
3801
- let p = o ? Widget.http.get(t, c) : Widget.http.post(t, a, c);
4052
+ let d = o ? Widget.http.get(t, c) : Widget.http.post(t, a, c);
3802
4053
  return u && u > 0 ? Promise.race([
3803
- p,
4054
+ d,
3804
4055
  this.createTimeoutPromise(u)
3805
- ]) : p;
4056
+ ]) : d;
3806
4057
  }
3807
4058
  getCacheKey(e, t) {
3808
4059
  var n;
@@ -3916,9 +4167,10 @@ const getExternalIdsByTmdbId = async (e, t)=>{
3916
4167
  switch(e.id){
3917
4168
  case "qq":
3918
4169
  {
3919
- let { cid: e } = t.query;
4170
+ let { cid: e, vid: n } = t.query;
3920
4171
  e && (o.providers.tencent = {
3921
- id: e
4172
+ cid: e,
4173
+ vid: n
3922
4174
  });
3923
4175
  break;
3924
4176
  }
@@ -3926,7 +4178,7 @@ const getExternalIdsByTmdbId = async (e, t)=>{
3926
4178
  {
3927
4179
  let { tvid: e } = t.query;
3928
4180
  e && (o.providers.iqiyi = {
3929
- id: e
4181
+ entityId: e
3930
4182
  });
3931
4183
  break;
3932
4184
  }
@@ -3934,7 +4186,7 @@ const getExternalIdsByTmdbId = async (e, t)=>{
3934
4186
  {
3935
4187
  let { showid: e } = t.query;
3936
4188
  e && (o.providers.youku = {
3937
- id: e
4189
+ showId: e
3938
4190
  });
3939
4191
  break;
3940
4192
  }
@@ -3942,7 +4194,7 @@ const getExternalIdsByTmdbId = async (e, t)=>{
3942
4194
  {
3943
4195
  let e = t.pathname.split("/").pop();
3944
4196
  e && /\d+/.test(e) && (o.providers.bilibili = {
3945
- id: e
4197
+ seasonId: e
3946
4198
  });
3947
4199
  }
3948
4200
  }
@@ -3992,31 +4244,39 @@ function base_define_property(e, t, n) {
3992
4244
  }) : e[t] = n, e;
3993
4245
  }
3994
4246
  class BaseScraper {
4247
+ parseIdString(e) {
4248
+ var t, n;
4249
+ let r = safeJsonParse(decodeURIComponent(e)), i = null == (t = this.idSchema) ? void 0 : t.safeParse(r);
4250
+ return i ? i.success ? null != (n = i.data) ? n : null : (console.log(this.providerName, "parseIdString", e, prettifyError(i.error)), null) : (console.log(this.providerName, "parseIdString", e, "idSchema is not defined"), null);
4251
+ }
4252
+ generateIdString(e) {
4253
+ return encodeURIComponent(JSON.stringify(e));
4254
+ }
3995
4255
  sleep(e) {
3996
4256
  return new Promise((t)=>setTimeout(t, e));
3997
4257
  }
3998
4258
  formatComments(e, t) {
3999
- let n = new Set(), r = new Map(), i = 0;
4000
- for (let o of e){
4001
- if (!o) continue;
4002
- let s = t(o, i, e);
4003
- if (!s || (i += 1, n.has(s.id))) continue;
4004
- n.add(s.id);
4005
- let a = s.content, u = r.get(a);
4006
- u ? (s.timestamp < u.item.timestamp && (u.item = s), u.count += 1) : r.set(a, {
4007
- item: s,
4259
+ let n = new Set(), r = new Map();
4260
+ for (let i of e){
4261
+ if (!i) continue;
4262
+ let e = t(i);
4263
+ if (!e || n.has(e.id)) continue;
4264
+ n.add(e.id);
4265
+ let o = e.content, s = r.get(o);
4266
+ s ? (e.timestamp < s.item.timestamp && (s.item = e), s.count += 1) : r.set(o, {
4267
+ item: e,
4008
4268
  count: 1
4009
4269
  });
4010
4270
  }
4011
- let o = [];
4271
+ let i = [];
4012
4272
  return r.forEach((e)=>{
4013
4273
  let { item: t, count: n } = e, r = n > 1 ? `${t.content} \xd7 ${n}` : t.content;
4014
- o.push({
4274
+ i.push({
4015
4275
  cid: t.id,
4016
4276
  p: `${t.timestamp.toFixed(2)},${t.mode},${t.color},[${this.providerName}]`,
4017
4277
  m: r
4018
4278
  });
4019
- }), o;
4279
+ }), i;
4020
4280
  }
4021
4281
  getEpisodeIndexFromTitle(e) {
4022
4282
  if (!e) return null;
@@ -4038,250 +4298,10 @@ class BaseScraper {
4038
4298
  return null;
4039
4299
  }
4040
4300
  constructor(){
4041
- base_define_property(this, "fetch", new Fetch()), base_define_property(this, "GLOBAL_EPISODE_BLACKLIST_DEFAULT", "^(.*?)((.+?\u7248)|(\u7279(\u522B|\u5178))|((\u5BFC|\u6F14)\u5458|\u5609\u5BBE|\u89D2\u8272)\u8BBF\u8C08|\u798F\u5229|\u5148\u5BFC|\u5F69\u86CB|\u82B1\u7D6E|\u9884\u544A|\u7279\u8F91|\u4E13\u8BBF|\u8BBF\u8C08|\u5E55\u540E|\u5468\u8FB9|\u8D44\u8BAF|\u770B\u70B9|\u901F\u770B|\u56DE\u987E|\u76D8\u70B9|\u5408\u96C6|PV|MV|CM|OST|ED|OP|BD|\u7279\u5178|SP|NCOP|NCED|MENU|Web-DL|rip|x264|x265|aac|flac)(.*?)$"), base_define_property(this, "PROVIDER_SPECIFIC_BLACKLIST_DEFAULT", "");
4301
+ base_define_property(this, "idSchema", void 0), base_define_property(this, "fetch", new Fetch()), base_define_property(this, "GLOBAL_EPISODE_BLACKLIST_DEFAULT", "^(.*?)((.+?\u7248)|(\u7279(\u522B|\u5178))|((\u5BFC|\u6F14)\u5458|\u5609\u5BBE|\u89D2\u8272)\u8BBF\u8C08|\u798F\u5229|\u5148\u5BFC|\u5F69\u86CB|\u82B1\u7D6E|\u9884\u544A|\u7279\u8F91|\u4E13\u8BBF|\u8BBF\u8C08|\u5E55\u540E|\u5468\u8FB9|\u8D44\u8BAF|\u770B\u70B9|\u901F\u770B|\u56DE\u987E|\u76D8\u70B9|\u5408\u96C6|PV|MV|CM|OST|ED|OP|BD|\u7279\u5178|SP|NCOP|NCED|MENU|Web-DL|rip|x264|x265|aac|flac)(.*?)$"), base_define_property(this, "PROVIDER_SPECIFIC_BLACKLIST_DEFAULT", "");
4042
4302
  }
4043
4303
  }
4044
- var minimal = __webpack_require__("../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/minimal.js");
4045
- const $Reader = minimal.Reader, $Writer = minimal.Writer, $util = minimal.util, $root = minimal.roots.default || (minimal.roots.default = {}), dm_proto_biliproto = $root.biliproto = (()=>{
4046
- let e = {};
4047
- return e.community = function() {
4048
- let e = {};
4049
- return e.service = function() {
4050
- let e = {};
4051
- return e.dm = function() {
4052
- let e = {};
4053
- return e.v1 = function() {
4054
- let e = {};
4055
- return e.DanmakuElem = function() {
4056
- function e(e) {
4057
- if (e) for(let t = Object.keys(e), n = 0; n < t.length; ++n)null != e[t[n]] && (this[t[n]] = e[t[n]]);
4058
- }
4059
- return e.prototype.id = $util.Long ? $util.Long.fromBits(0, 0, !1) : 0, e.prototype.progress = 0, e.prototype.mode = 0, e.prototype.fontsize = 0, e.prototype.color = 0, e.prototype.midHash = "", e.prototype.content = "", e.prototype.ctime = $util.Long ? $util.Long.fromBits(0, 0, !1) : 0, e.prototype.weight = 0, e.prototype.action = "", e.prototype.pool = 0, e.prototype.idStr = "", e.prototype.attr = 0, e.prototype.animation = "", e.prototype.likeNum = 0, e.prototype.colorV2 = "", e.prototype.dmTypeV2 = 0, e.create = function(t) {
4060
- return new e(t);
4061
- }, e.encode = function(e, t) {
4062
- return t || (t = $Writer.create()), null != e.id && Object.hasOwnProperty.call(e, "id") && t.uint32(8).int64(e.id), null != e.progress && Object.hasOwnProperty.call(e, "progress") && t.uint32(16).int32(e.progress), null != e.mode && Object.hasOwnProperty.call(e, "mode") && t.uint32(24).int32(e.mode), null != e.fontsize && Object.hasOwnProperty.call(e, "fontsize") && t.uint32(32).int32(e.fontsize), null != e.color && Object.hasOwnProperty.call(e, "color") && t.uint32(40).uint32(e.color), null != e.midHash && Object.hasOwnProperty.call(e, "midHash") && t.uint32(50).string(e.midHash), null != e.content && Object.hasOwnProperty.call(e, "content") && t.uint32(58).string(e.content), null != e.ctime && Object.hasOwnProperty.call(e, "ctime") && t.uint32(64).int64(e.ctime), null != e.weight && Object.hasOwnProperty.call(e, "weight") && t.uint32(72).int32(e.weight), null != e.action && Object.hasOwnProperty.call(e, "action") && t.uint32(82).string(e.action), null != e.pool && Object.hasOwnProperty.call(e, "pool") && t.uint32(88).int32(e.pool), null != e.idStr && Object.hasOwnProperty.call(e, "idStr") && t.uint32(98).string(e.idStr), null != e.attr && Object.hasOwnProperty.call(e, "attr") && t.uint32(104).int32(e.attr), null != e.animation && Object.hasOwnProperty.call(e, "animation") && t.uint32(114).string(e.animation), null != e.likeNum && Object.hasOwnProperty.call(e, "likeNum") && t.uint32(120).uint32(e.likeNum), null != e.colorV2 && Object.hasOwnProperty.call(e, "colorV2") && t.uint32(130).string(e.colorV2), null != e.dmTypeV2 && Object.hasOwnProperty.call(e, "dmTypeV2") && t.uint32(136).uint32(e.dmTypeV2), t;
4063
- }, e.encodeDelimited = function(e, t) {
4064
- return this.encode(e, t).ldelim();
4065
- }, e.decode = function(e, t, n) {
4066
- e instanceof $Reader || (e = $Reader.create(e));
4067
- let r = void 0 === t ? e.len : e.pos + t, i = new $root.biliproto.community.service.dm.v1.DanmakuElem();
4068
- for(; e.pos < r;){
4069
- let t = e.uint32();
4070
- if (t === n) break;
4071
- switch(t >>> 3){
4072
- case 1:
4073
- i.id = e.int64();
4074
- break;
4075
- case 2:
4076
- i.progress = e.int32();
4077
- break;
4078
- case 3:
4079
- i.mode = e.int32();
4080
- break;
4081
- case 4:
4082
- i.fontsize = e.int32();
4083
- break;
4084
- case 5:
4085
- i.color = e.uint32();
4086
- break;
4087
- case 6:
4088
- i.midHash = e.string();
4089
- break;
4090
- case 7:
4091
- i.content = e.string();
4092
- break;
4093
- case 8:
4094
- i.ctime = e.int64();
4095
- break;
4096
- case 9:
4097
- i.weight = e.int32();
4098
- break;
4099
- case 10:
4100
- i.action = e.string();
4101
- break;
4102
- case 11:
4103
- i.pool = e.int32();
4104
- break;
4105
- case 12:
4106
- i.idStr = e.string();
4107
- break;
4108
- case 13:
4109
- i.attr = e.int32();
4110
- break;
4111
- case 14:
4112
- i.animation = e.string();
4113
- break;
4114
- case 15:
4115
- i.likeNum = e.uint32();
4116
- break;
4117
- case 16:
4118
- i.colorV2 = e.string();
4119
- break;
4120
- case 17:
4121
- i.dmTypeV2 = e.uint32();
4122
- break;
4123
- default:
4124
- e.skipType(7 & t);
4125
- }
4126
- }
4127
- return i;
4128
- }, e.decodeDelimited = function(e) {
4129
- return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
4130
- }, e.verify = function(e) {
4131
- return "object" != typeof e || null === e ? "object expected" : null != e.id && e.hasOwnProperty("id") && !$util.isInteger(e.id) && !(e.id && $util.isInteger(e.id.low) && $util.isInteger(e.id.high)) ? "id: integer|Long expected" : null != e.progress && e.hasOwnProperty("progress") && !$util.isInteger(e.progress) ? "progress: integer expected" : null != e.mode && e.hasOwnProperty("mode") && !$util.isInteger(e.mode) ? "mode: integer expected" : null != e.fontsize && e.hasOwnProperty("fontsize") && !$util.isInteger(e.fontsize) ? "fontsize: integer expected" : null != e.color && e.hasOwnProperty("color") && !$util.isInteger(e.color) ? "color: integer expected" : null != e.midHash && e.hasOwnProperty("midHash") && !$util.isString(e.midHash) ? "midHash: string expected" : null != e.content && e.hasOwnProperty("content") && !$util.isString(e.content) ? "content: string expected" : null != e.ctime && e.hasOwnProperty("ctime") && !$util.isInteger(e.ctime) && !(e.ctime && $util.isInteger(e.ctime.low) && $util.isInteger(e.ctime.high)) ? "ctime: integer|Long expected" : null != e.weight && e.hasOwnProperty("weight") && !$util.isInteger(e.weight) ? "weight: integer expected" : null != e.action && e.hasOwnProperty("action") && !$util.isString(e.action) ? "action: string expected" : null != e.pool && e.hasOwnProperty("pool") && !$util.isInteger(e.pool) ? "pool: integer expected" : null != e.idStr && e.hasOwnProperty("idStr") && !$util.isString(e.idStr) ? "idStr: string expected" : null != e.attr && e.hasOwnProperty("attr") && !$util.isInteger(e.attr) ? "attr: integer expected" : null != e.animation && e.hasOwnProperty("animation") && !$util.isString(e.animation) ? "animation: string expected" : null != e.likeNum && e.hasOwnProperty("likeNum") && !$util.isInteger(e.likeNum) ? "likeNum: integer expected" : null != e.colorV2 && e.hasOwnProperty("colorV2") && !$util.isString(e.colorV2) ? "colorV2: string expected" : null != e.dmTypeV2 && e.hasOwnProperty("dmTypeV2") && !$util.isInteger(e.dmTypeV2) ? "dmTypeV2: integer expected" : null;
4132
- }, e.fromObject = function(e) {
4133
- if (e instanceof $root.biliproto.community.service.dm.v1.DanmakuElem) return e;
4134
- let t = new $root.biliproto.community.service.dm.v1.DanmakuElem();
4135
- return null != e.id && ($util.Long ? (t.id = $util.Long.fromValue(e.id)).unsigned = !1 : "string" == typeof e.id ? t.id = parseInt(e.id, 10) : "number" == typeof e.id ? t.id = e.id : "object" == typeof e.id && (t.id = new $util.LongBits(e.id.low >>> 0, e.id.high >>> 0).toNumber())), null != e.progress && (t.progress = 0 | e.progress), null != e.mode && (t.mode = 0 | e.mode), null != e.fontsize && (t.fontsize = 0 | e.fontsize), null != e.color && (t.color = e.color >>> 0), null != e.midHash && (t.midHash = String(e.midHash)), null != e.content && (t.content = String(e.content)), null != e.ctime && ($util.Long ? (t.ctime = $util.Long.fromValue(e.ctime)).unsigned = !1 : "string" == typeof e.ctime ? t.ctime = parseInt(e.ctime, 10) : "number" == typeof e.ctime ? t.ctime = e.ctime : "object" == typeof e.ctime && (t.ctime = new $util.LongBits(e.ctime.low >>> 0, e.ctime.high >>> 0).toNumber())), null != e.weight && (t.weight = 0 | e.weight), null != e.action && (t.action = String(e.action)), null != e.pool && (t.pool = 0 | e.pool), null != e.idStr && (t.idStr = String(e.idStr)), null != e.attr && (t.attr = 0 | e.attr), null != e.animation && (t.animation = String(e.animation)), null != e.likeNum && (t.likeNum = e.likeNum >>> 0), null != e.colorV2 && (t.colorV2 = String(e.colorV2)), null != e.dmTypeV2 && (t.dmTypeV2 = e.dmTypeV2 >>> 0), t;
4136
- }, e.toObject = function(e, t) {
4137
- t || (t = {});
4138
- let n = {};
4139
- if (t.defaults) {
4140
- if ($util.Long) {
4141
- let e = new $util.Long(0, 0, !1);
4142
- n.id = t.longs === String ? e.toString() : t.longs === Number ? e.toNumber() : e;
4143
- } else n.id = t.longs === String ? "0" : 0;
4144
- if (n.progress = 0, n.mode = 0, n.fontsize = 0, n.color = 0, n.midHash = "", n.content = "", $util.Long) {
4145
- let e = new $util.Long(0, 0, !1);
4146
- n.ctime = t.longs === String ? e.toString() : t.longs === Number ? e.toNumber() : e;
4147
- } else n.ctime = t.longs === String ? "0" : 0;
4148
- n.weight = 0, n.action = "", n.pool = 0, n.idStr = "", n.attr = 0, n.animation = "", n.likeNum = 0, n.colorV2 = "", n.dmTypeV2 = 0;
4149
- }
4150
- return null != e.id && e.hasOwnProperty("id") && ("number" == typeof e.id ? n.id = t.longs === String ? String(e.id) : e.id : n.id = t.longs === String ? $util.Long.prototype.toString.call(e.id) : t.longs === Number ? new $util.LongBits(e.id.low >>> 0, e.id.high >>> 0).toNumber() : e.id), null != e.progress && e.hasOwnProperty("progress") && (n.progress = e.progress), null != e.mode && e.hasOwnProperty("mode") && (n.mode = e.mode), null != e.fontsize && e.hasOwnProperty("fontsize") && (n.fontsize = e.fontsize), null != e.color && e.hasOwnProperty("color") && (n.color = e.color), null != e.midHash && e.hasOwnProperty("midHash") && (n.midHash = e.midHash), null != e.content && e.hasOwnProperty("content") && (n.content = e.content), null != e.ctime && e.hasOwnProperty("ctime") && ("number" == typeof e.ctime ? n.ctime = t.longs === String ? String(e.ctime) : e.ctime : n.ctime = t.longs === String ? $util.Long.prototype.toString.call(e.ctime) : t.longs === Number ? new $util.LongBits(e.ctime.low >>> 0, e.ctime.high >>> 0).toNumber() : e.ctime), null != e.weight && e.hasOwnProperty("weight") && (n.weight = e.weight), null != e.action && e.hasOwnProperty("action") && (n.action = e.action), null != e.pool && e.hasOwnProperty("pool") && (n.pool = e.pool), null != e.idStr && e.hasOwnProperty("idStr") && (n.idStr = e.idStr), null != e.attr && e.hasOwnProperty("attr") && (n.attr = e.attr), null != e.animation && e.hasOwnProperty("animation") && (n.animation = e.animation), null != e.likeNum && e.hasOwnProperty("likeNum") && (n.likeNum = e.likeNum), null != e.colorV2 && e.hasOwnProperty("colorV2") && (n.colorV2 = e.colorV2), null != e.dmTypeV2 && e.hasOwnProperty("dmTypeV2") && (n.dmTypeV2 = e.dmTypeV2), n;
4151
- }, e.prototype.toJSON = function() {
4152
- return this.constructor.toObject(this, minimal.util.toJSONOptions);
4153
- }, e.getTypeUrl = function(e) {
4154
- return void 0 === e && (e = "type.googleapis.com"), e + "/biliproto.community.service.dm.v1.DanmakuElem";
4155
- }, e;
4156
- }(), e.Flag = function() {
4157
- function e(e) {
4158
- if (e) for(let t = Object.keys(e), n = 0; n < t.length; ++n)null != e[t[n]] && (this[t[n]] = e[t[n]]);
4159
- }
4160
- return e.prototype.value = 0, e.prototype.description = "", e.create = function(t) {
4161
- return new e(t);
4162
- }, e.encode = function(e, t) {
4163
- return t || (t = $Writer.create()), null != e.value && Object.hasOwnProperty.call(e, "value") && t.uint32(8).int32(e.value), null != e.description && Object.hasOwnProperty.call(e, "description") && t.uint32(18).string(e.description), t;
4164
- }, e.encodeDelimited = function(e, t) {
4165
- return this.encode(e, t).ldelim();
4166
- }, e.decode = function(e, t, n) {
4167
- e instanceof $Reader || (e = $Reader.create(e));
4168
- let r = void 0 === t ? e.len : e.pos + t, i = new $root.biliproto.community.service.dm.v1.Flag();
4169
- for(; e.pos < r;){
4170
- let t = e.uint32();
4171
- if (t === n) break;
4172
- switch(t >>> 3){
4173
- case 1:
4174
- i.value = e.int32();
4175
- break;
4176
- case 2:
4177
- i.description = e.string();
4178
- break;
4179
- default:
4180
- e.skipType(7 & t);
4181
- }
4182
- }
4183
- return i;
4184
- }, e.decodeDelimited = function(e) {
4185
- return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
4186
- }, e.verify = function(e) {
4187
- return "object" != typeof e || null === e ? "object expected" : null != e.value && e.hasOwnProperty("value") && !$util.isInteger(e.value) ? "value: integer expected" : null != e.description && e.hasOwnProperty("description") && !$util.isString(e.description) ? "description: string expected" : null;
4188
- }, e.fromObject = function(e) {
4189
- if (e instanceof $root.biliproto.community.service.dm.v1.Flag) return e;
4190
- let t = new $root.biliproto.community.service.dm.v1.Flag();
4191
- return null != e.value && (t.value = 0 | e.value), null != e.description && (t.description = String(e.description)), t;
4192
- }, e.toObject = function(e, t) {
4193
- t || (t = {});
4194
- let n = {};
4195
- return t.defaults && (n.value = 0, n.description = ""), null != e.value && e.hasOwnProperty("value") && (n.value = e.value), null != e.description && e.hasOwnProperty("description") && (n.description = e.description), n;
4196
- }, e.prototype.toJSON = function() {
4197
- return this.constructor.toObject(this, minimal.util.toJSONOptions);
4198
- }, e.getTypeUrl = function(e) {
4199
- return void 0 === e && (e = "type.googleapis.com"), e + "/biliproto.community.service.dm.v1.Flag";
4200
- }, e;
4201
- }(), e.DmSegMobileReply = function() {
4202
- function e(e) {
4203
- if (this.elems = [], e) for(let t = Object.keys(e), n = 0; n < t.length; ++n)null != e[t[n]] && (this[t[n]] = e[t[n]]);
4204
- }
4205
- return e.prototype.elems = $util.emptyArray, e.prototype.state = 0, e.prototype.aiFlagForSummary = null, e.create = function(t) {
4206
- return new e(t);
4207
- }, e.encode = function(e, t) {
4208
- if (t || (t = $Writer.create()), null != e.elems && e.elems.length) for(let n = 0; n < e.elems.length; ++n)$root.biliproto.community.service.dm.v1.DanmakuElem.encode(e.elems[n], t.uint32(10).fork()).ldelim();
4209
- return null != e.state && Object.hasOwnProperty.call(e, "state") && t.uint32(16).int32(e.state), null != e.aiFlagForSummary && Object.hasOwnProperty.call(e, "aiFlagForSummary") && $root.biliproto.community.service.dm.v1.Flag.encode(e.aiFlagForSummary, t.uint32(26).fork()).ldelim(), t;
4210
- }, e.encodeDelimited = function(e, t) {
4211
- return this.encode(e, t).ldelim();
4212
- }, e.decode = function(e, t, n) {
4213
- e instanceof $Reader || (e = $Reader.create(e));
4214
- let r = void 0 === t ? e.len : e.pos + t, i = new $root.biliproto.community.service.dm.v1.DmSegMobileReply();
4215
- for(; e.pos < r;){
4216
- let t = e.uint32();
4217
- if (t === n) break;
4218
- switch(t >>> 3){
4219
- case 1:
4220
- i.elems && i.elems.length || (i.elems = []), i.elems.push($root.biliproto.community.service.dm.v1.DanmakuElem.decode(e, e.uint32()));
4221
- break;
4222
- case 2:
4223
- i.state = e.int32();
4224
- break;
4225
- case 3:
4226
- i.aiFlagForSummary = $root.biliproto.community.service.dm.v1.Flag.decode(e, e.uint32());
4227
- break;
4228
- default:
4229
- e.skipType(7 & t);
4230
- }
4231
- }
4232
- return i;
4233
- }, e.decodeDelimited = function(e) {
4234
- return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
4235
- }, e.verify = function(e) {
4236
- if ("object" != typeof e || null === e) return "object expected";
4237
- if (null != e.elems && e.hasOwnProperty("elems")) {
4238
- if (!Array.isArray(e.elems)) return "elems: array expected";
4239
- for(let t = 0; t < e.elems.length; ++t){
4240
- let n = $root.biliproto.community.service.dm.v1.DanmakuElem.verify(e.elems[t]);
4241
- if (n) return "elems." + n;
4242
- }
4243
- }
4244
- if (null != e.state && e.hasOwnProperty("state") && !$util.isInteger(e.state)) return "state: integer expected";
4245
- if (null != e.aiFlagForSummary && e.hasOwnProperty("aiFlagForSummary")) {
4246
- let t = $root.biliproto.community.service.dm.v1.Flag.verify(e.aiFlagForSummary);
4247
- if (t) return "aiFlagForSummary." + t;
4248
- }
4249
- return null;
4250
- }, e.fromObject = function(e) {
4251
- if (e instanceof $root.biliproto.community.service.dm.v1.DmSegMobileReply) return e;
4252
- let t = new $root.biliproto.community.service.dm.v1.DmSegMobileReply();
4253
- if (e.elems) {
4254
- if (!Array.isArray(e.elems)) throw TypeError(".biliproto.community.service.dm.v1.DmSegMobileReply.elems: array expected");
4255
- t.elems = [];
4256
- for(let n = 0; n < e.elems.length; ++n){
4257
- if ("object" != typeof e.elems[n]) throw TypeError(".biliproto.community.service.dm.v1.DmSegMobileReply.elems: object expected");
4258
- t.elems[n] = $root.biliproto.community.service.dm.v1.DanmakuElem.fromObject(e.elems[n]);
4259
- }
4260
- }
4261
- if (null != e.state && (t.state = 0 | e.state), null != e.aiFlagForSummary) {
4262
- if ("object" != typeof e.aiFlagForSummary) throw TypeError(".biliproto.community.service.dm.v1.DmSegMobileReply.aiFlagForSummary: object expected");
4263
- t.aiFlagForSummary = $root.biliproto.community.service.dm.v1.Flag.fromObject(e.aiFlagForSummary);
4264
- }
4265
- return t;
4266
- }, e.toObject = function(e, t) {
4267
- t || (t = {});
4268
- let n = {};
4269
- if ((t.arrays || t.defaults) && (n.elems = []), t.defaults && (n.state = 0, n.aiFlagForSummary = null), e.elems && e.elems.length) {
4270
- n.elems = [];
4271
- for(let r = 0; r < e.elems.length; ++r)n.elems[r] = $root.biliproto.community.service.dm.v1.DanmakuElem.toObject(e.elems[r], t);
4272
- }
4273
- return null != e.state && e.hasOwnProperty("state") && (n.state = e.state), null != e.aiFlagForSummary && e.hasOwnProperty("aiFlagForSummary") && (n.aiFlagForSummary = $root.biliproto.community.service.dm.v1.Flag.toObject(e.aiFlagForSummary, t)), n;
4274
- }, e.prototype.toJSON = function() {
4275
- return this.constructor.toObject(this, minimal.util.toJSONOptions);
4276
- }, e.getTypeUrl = function(e) {
4277
- return void 0 === e && (e = "type.googleapis.com"), e + "/biliproto.community.service.dm.v1.DmSegMobileReply";
4278
- }, e;
4279
- }(), e;
4280
- }(), e;
4281
- }(), e;
4282
- }(), e;
4283
- }(), e;
4284
- })();
4304
+ var dm_proto = __webpack_require__("./src/scrapers/bilibili/dm.proto");
4285
4305
  function bilibili_define_property(e, t, n) {
4286
4306
  return t in e ? Object.defineProperty(e, t, {
4287
4307
  value: n,
@@ -4290,7 +4310,11 @@ function bilibili_define_property(e, t, n) {
4290
4310
  writable: !0
4291
4311
  }) : e[t] = n, e;
4292
4312
  }
4293
- const pgcEpisodeSchema = schemas_object({
4313
+ const bilibiliIdSchema = schemas_object({
4314
+ seasonId: schemas_string(),
4315
+ aid: schemas_string().optional(),
4316
+ cid: schemas_string().optional()
4317
+ }), pgcEpisodeSchema = schemas_object({
4294
4318
  aid: schemas_int(),
4295
4319
  cid: schemas_int(),
4296
4320
  badge: schemas_string(),
@@ -4306,23 +4330,28 @@ const pgcEpisodeSchema = schemas_object({
4306
4330
  });
4307
4331
  class BilibiliScraper extends BaseScraper {
4308
4332
  async getEpisodes(e, t) {
4309
- let [n] = e.split("#"), r = [], i = await this.getPgcEpisodes(n), o = this.getEpisodeBlacklistPattern(), s = 1;
4333
+ let n = this.parseIdString(e);
4334
+ if (!n) return [];
4335
+ let r = [], i = await this.getPgcEpisodes(n.seasonId), o = this.getEpisodeBlacklistPattern(), s = 1;
4310
4336
  for (let e of null != i ? i : [])"\u9884\u544A" !== e.badge && (null != o && o.test(e.title) || (r.push({
4311
4337
  provider: this.providerName,
4312
- episodeId: [
4313
- n,
4314
- e.aid,
4315
- e.cid
4316
- ].join("#"),
4338
+ episodeId: this.generateIdString({
4339
+ seasonId: n.seasonId,
4340
+ aid: e.aid.toString(),
4341
+ cid: e.cid.toString()
4342
+ }),
4317
4343
  episodeTitle: e.show_title || e.title,
4318
4344
  episodeNumber: s
4319
4345
  }), s += 1));
4320
4346
  return t ? r.filter((e)=>e.episodeNumber === t) : r;
4321
4347
  }
4322
4348
  async getSegments(e) {
4323
- let [t, n, r] = e.split("#"), i = await this.getPgcEpisodes(t), o = null == i ? void 0 : i.find((e)=>e.aid === parseInt(n) && e.cid === parseInt(r));
4324
- return o ? Array.from({
4325
- length: Math.floor(o.duration / 1000 / 360) + 1
4349
+ var t;
4350
+ let { aid: n, cid: r, seasonId: i } = null != (t = this.parseIdString(e)) ? t : {};
4351
+ if (!n || !r || !i) return [];
4352
+ let o = await this.getPgcEpisodes(i), s = null == o ? void 0 : o.find((e)=>e.aid === parseInt(n) && e.cid === parseInt(r));
4353
+ return s ? Array.from({
4354
+ length: Math.floor(s.duration / 1000 / 360) + 1
4326
4355
  }, (e, t)=>({
4327
4356
  provider: this.providerName,
4328
4357
  startTime: 360 * t,
@@ -4330,13 +4359,16 @@ class BilibiliScraper extends BaseScraper {
4330
4359
  })) : [];
4331
4360
  }
4332
4361
  async getComments(e, t) {
4333
- let [n, r, i] = e.split("#"), o = await this.getPgcEpisodes(n);
4334
- if (!(null == o ? void 0 : o.find((e)=>e.aid === parseInt(r) && e.cid === parseInt(i)))) return [];
4335
- let s = await this.fetchCommentsForCid(r, i, t);
4336
- return this.formatComments(s, (e)=>{
4362
+ var n;
4363
+ let { aid: r, cid: i, seasonId: o } = null != (n = this.parseIdString(e)) ? n : {};
4364
+ if (!r || !i || !o) return [];
4365
+ let s = await this.getPgcEpisodes(o);
4366
+ if (!(null == s ? void 0 : s.find((e)=>e.aid === parseInt(r) && e.cid === parseInt(i)))) return [];
4367
+ let a = await this.fetchCommentsForCid(r, i, t);
4368
+ return this.formatComments(a, (e)=>{
4337
4369
  var t, n, r;
4338
4370
  if (!e.progress) return null;
4339
- let i = (null == (t = e.content) ? void 0 : t.replace(/\0/g, "")) || "";
4371
+ let i = (null == (t = e.content) ? void 0 : t.toString().replace(/\0/g, "")) || "";
4340
4372
  return i ? {
4341
4373
  id: e.id,
4342
4374
  timestamp: e.progress / 1000.0,
@@ -4373,7 +4405,7 @@ class BilibiliScraper extends BaseScraper {
4373
4405
  return r;
4374
4406
  }
4375
4407
  constructor(){
4376
- super(), bilibili_define_property(this, "providerName", "bilibili"), bilibili_define_property(this, "DmSegMobileReply", dm_proto_biliproto.community.service.dm.v1.DmSegMobileReply), this.fetch.setHeaders({
4408
+ super(), bilibili_define_property(this, "providerName", "bilibili"), bilibili_define_property(this, "idSchema", bilibiliIdSchema), bilibili_define_property(this, "DmSegMobileReply", dm_proto.biliproto.community.service.dm.v1.DmSegMobileReply), this.fetch.setHeaders({
4377
4409
  Referer: "https://www.bilibili.com/"
4378
4410
  });
4379
4411
  }
@@ -4785,17 +4817,17 @@ const parseXml = function(e) {
4785
4817
  }
4786
4818
  ]) : n.add(this.options.textNodeName, a), o = t + 2;
4787
4819
  } else {
4788
- let s = readTagExp(e, o, this.options.removeNSPrefix), a = s.tagName, u = s.rawTagName, l = s.tagExp, c = s.attrExpPresent, p = s.closeIndex;
4820
+ let s = readTagExp(e, o, this.options.removeNSPrefix), a = s.tagName, u = s.rawTagName, l = s.tagExp, c = s.attrExpPresent, d = s.closeIndex;
4789
4821
  this.options.transformTagName && (a = this.options.transformTagName(a)), n && r && '!xml' !== n.tagname && (r = this.saveTextToParentTag(r, n, i, !1));
4790
- let d = n;
4791
- d && -1 !== this.options.unpairedTags.indexOf(d.tagname) && (n = this.tagsNodeStack.pop(), i = i.substring(0, i.lastIndexOf("."))), a !== t.tagname && (i += i ? "." + a : a);
4822
+ let p = n;
4823
+ p && -1 !== this.options.unpairedTags.indexOf(p.tagname) && (n = this.tagsNodeStack.pop(), i = i.substring(0, i.lastIndexOf("."))), a !== t.tagname && (i += i ? "." + a : a);
4792
4824
  let f = o;
4793
4825
  if (this.isItStopNode(this.options.stopNodes, i, a)) {
4794
4826
  let t = "";
4795
4827
  if (l.length > 0 && l.lastIndexOf("/") === l.length - 1) "/" === a[a.length - 1] ? (a = a.substr(0, a.length - 1), i = i.substr(0, i.length - 1), l = a) : l = l.substr(0, l.length - 1), o = s.closeIndex;
4796
4828
  else if (-1 !== this.options.unpairedTags.indexOf(a)) o = s.closeIndex;
4797
4829
  else {
4798
- let n = this.readStopNodeData(e, u, p + 1);
4830
+ let n = this.readStopNodeData(e, u, d + 1);
4799
4831
  if (!n) throw Error(`Unexpected end of ${u}`);
4800
4832
  o = n.i, t = n.tagContent;
4801
4833
  }
@@ -4810,7 +4842,7 @@ const parseXml = function(e) {
4810
4842
  let e = new XmlNode(a);
4811
4843
  this.tagsNodeStack.push(n), a !== l && c && (e[":@"] = this.buildAttributesMap(l, i, a)), this.addChild(n, e, i, f), n = e;
4812
4844
  }
4813
- r = "", o = p;
4845
+ r = "", o = d;
4814
4846
  }
4815
4847
  }
4816
4848
  else r += e[o];
@@ -5176,7 +5208,9 @@ function iqiyi_define_property(e, t, n) {
5176
5208
  writable: !0
5177
5209
  }) : e[t] = n, e;
5178
5210
  }
5179
- const iqiyiEpisodeTabDataVideoSchema = schemas_object({
5211
+ const iqiyiIdSchema = schemas_object({
5212
+ entityId: schemas_string()
5213
+ }), iqiyiEpisodeTabDataVideoSchema = schemas_object({
5180
5214
  page_url: schemas_string(),
5181
5215
  short_display_name: schemas_string(),
5182
5216
  title: schemas_string(),
@@ -5253,18 +5287,22 @@ const iqiyiEpisodeTabDataVideoSchema = schemas_object({
5253
5287
  }).transform((e)=>e.danmu.data.entry);
5254
5288
  class IqiyiScraper extends BaseScraper {
5255
5289
  async getEpisodes(e, t) {
5256
- let n = [];
5290
+ let n = this.parseIdString(e);
5291
+ if (!n) return [];
5292
+ let r = [];
5257
5293
  try {
5258
- n = await this.getEpisodesV3(e);
5294
+ r = await this.getEpisodesV3(n.entityId);
5259
5295
  } catch (e) {
5260
- console.warn(`\u{7231}\u{5947}\u{827A}: \u{65B0}\u{7248}API (v3) \u{83B7}\u{53D6}\u{5206}\u{96C6}\u{65F6}\u{53D1}\u{751F}\u{9519}\u{8BEF}: ${e}`, e), n = [];
5296
+ console.warn(`\u{7231}\u{5947}\u{827A}: \u{65B0}\u{7248}API (v3) \u{83B7}\u{53D6}\u{5206}\u{96C6}\u{65F6}\u{53D1}\u{751F}\u{9519}\u{8BEF}: ${e}`, e), r = [];
5261
5297
  }
5262
- return !n.length, this.filterAndFinalizeEpisodes(n, t);
5298
+ return !r.length, this.filterAndFinalizeEpisodes(r, t);
5263
5299
  }
5264
5300
  async getSegments(e) {
5265
- let t = await this.getVideoBaseInfo(e), n = null == t ? void 0 : t.durationSec;
5266
- return n ? Array.from({
5267
- length: Math.floor(n / 300) + 1
5301
+ let t = this.parseIdString(e);
5302
+ if (!t) return [];
5303
+ let n = await this.getVideoBaseInfo(t.entityId), r = null == n ? void 0 : n.durationSec;
5304
+ return r ? Array.from({
5305
+ length: Math.floor(r / 300) + 1
5268
5306
  }, (e, t)=>({
5269
5307
  provider: this.providerName,
5270
5308
  startTime: 300 * t,
@@ -5272,15 +5310,15 @@ class IqiyiScraper extends BaseScraper {
5272
5310
  })) : [];
5273
5311
  }
5274
5312
  async getComments(e, t) {
5275
- let n = await this.getVideoBaseInfo(e);
5276
- if (!n) return console.warn(`\u{7231}\u{5947}\u{827A}: \u{65E0}\u{6CD5}\u{5C06} video_id '${e}' \u{8F6C}\u{6362}\u{4E3A} entity_id\u{3002}`), [];
5277
- let r = null == n ? void 0 : n.tvId.toString();
5313
+ let n = this.parseIdString(e);
5314
+ if (!n) return [];
5315
+ let r = n.entityId;
5278
5316
  if (!r || r.length < 4) return [];
5279
5317
  let i = r.slice(-4, -2), o = r.slice(-2), s = `http://cmts.iqiyi.com/bullet/${i}/${o}/${r}_300_${t}.z`;
5280
5318
  console.debug(`URL\u{6784}\u{5EFA}: s1=${i}, s2=${o}, \u{5B8C}\u{6574}URL=${s}`);
5281
5319
  let a = await this.fetch.get(s, {
5282
5320
  zlibMode: !0
5283
- }), u = this.xmlParser.parse(a.data), { success: l, data: c, error: p } = iqiyiCommentsResponseSchema.safeParse(u);
5321
+ }), u = this.xmlParser.parse(a.data), { success: l, data: c, error: d } = iqiyiCommentsResponseSchema.safeParse(u);
5284
5322
  return l ? this.formatComments(c, (e)=>{
5285
5323
  let t = 16777215;
5286
5324
  try {
@@ -5293,7 +5331,7 @@ class IqiyiScraper extends BaseScraper {
5293
5331
  color: t,
5294
5332
  content: e.content
5295
5333
  };
5296
- }) : (console.warn(`\u{7231}\u{5947}\u{827A}: \u{89E3}\u{6790}\u{5F39}\u{5E55}\u{6570}\u{636E}\u{65F6}\u{53D1}\u{751F}\u{9519}\u{8BEF}:`, prettifyError(p)), []);
5334
+ }) : (console.warn(`\u{7231}\u{5947}\u{827A}: \u{89E3}\u{6790}\u{5F39}\u{5E55}\u{6570}\u{636E}\u{65F6}\u{53D1}\u{751F}\u{9519}\u{8BEF}:`, prettifyError(d)), []);
5297
5335
  }
5298
5336
  async getEpisodesV3(e) {
5299
5337
  let t = {
@@ -5316,7 +5354,7 @@ class IqiyiScraper extends BaseScraper {
5316
5354
  };
5317
5355
  t.sign = this.createSign(t);
5318
5356
  try {
5319
- var n, r, i, o, s, a, u, l, c, p, d;
5357
+ var n, r, i, o, s, a, u, l, c, d, p;
5320
5358
  let e = (await this.fetch.get("https://www.iqiyi.com/prelw/tvg/v2/lw/base_info", {
5321
5359
  params: t,
5322
5360
  schema: iqiyiV3ApiResponseSchema
@@ -5328,7 +5366,7 @@ class IqiyiScraper extends BaseScraper {
5328
5366
  url: e.play_url
5329
5367
  }))) ? o : [];
5330
5368
  if (!f.length) {
5331
- let t = null == e || null == (p = e.data) || null == (c = p.template) || null == (l = c.tabs) || null == (u = l.find((e)=>e.blocks.some((e)=>"selector_bk" === e.bk_id && "album_episodes" === e.bk_type))) || null == (a = u.blocks) || null == (s = a.find((e)=>"selector_bk" === e.bk_id && "album_episodes" === e.bk_type)) ? void 0 : s.data, { success: n, data: r, error: i } = iqiyiEpisodeTabDataSchema.safeParse(t);
5369
+ let t = null == e || null == (d = e.data) || null == (c = d.template) || null == (l = c.tabs) || null == (u = l.find((e)=>e.blocks.some((e)=>"selector_bk" === e.bk_id && "album_episodes" === e.bk_type))) || null == (a = u.blocks) || null == (s = a.find((e)=>"selector_bk" === e.bk_id && "album_episodes" === e.bk_type)) ? void 0 : s.data, { success: n, data: r, error: i } = iqiyiEpisodeTabDataSchema.safeParse(t);
5332
5370
  if (!n) return console.warn(`\u{7231}\u{5947}\u{827A}: \u{89E3}\u{6790}\u{5206}\u{96C6}\u{6570}\u{636E}\u{65F6}\u{53D1}\u{751F}\u{9519}\u{8BEF}:`, prettifyError(i), t), [];
5333
5371
  let o = this.getEpisodeBlacklistPattern(), h = 1;
5334
5372
  for (let e of r.data){
@@ -5336,9 +5374,11 @@ class IqiyiScraper extends BaseScraper {
5336
5374
  let t = this.videoIdToEntityId(e.videoId);
5337
5375
  t && (null != o && o.test(e.title) || (f.push({
5338
5376
  provider: this.providerName,
5339
- episodeId: t,
5377
+ episodeId: this.generateIdString({
5378
+ entityId: t
5379
+ }),
5340
5380
  episodeTitle: e.title,
5341
- episodeNumber: null != (d = this.getEpisodeIndexFromTitle(e.short_display_name)) ? d : h,
5381
+ episodeNumber: null != (p = this.getEpisodeIndexFromTitle(e.short_display_name)) ? p : h,
5342
5382
  url: e.page_url
5343
5383
  }), h += 1));
5344
5384
  }
@@ -5381,7 +5421,7 @@ class IqiyiScraper extends BaseScraper {
5381
5421
  })).data) ? void 0 : t.data;
5382
5422
  }
5383
5423
  constructor(){
5384
- super(), iqiyi_define_property(this, "providerName", "iqiyi"), iqiyi_define_property(this, "xmlParser", new XMLParser()), iqiyi_define_property(this, "PROVIDER_SPECIFIC_BLACKLIST_DEFAULT", "^(.*?)(\u62A2\u5148(\u7248|\u7BC7)?|\u52A0\u66F4(\u7248|\u7BC7)?|\u82B1\u7D6E|\u9884\u544A|\u7279\u8F91|\u5F69\u86CB|\u4E13\u8BBF|\u5E55\u540E(\u6545\u4E8B|\u82B1\u7D6E)?|\u76F4\u64AD|\u7EAF\u4EAB|\u672A\u64AD|\u884D\u751F|\u756A\u5916|\u4F1A\u5458(\u4E13\u5C5E|\u52A0\u957F)?|\u7247\u82B1|\u7CBE\u534E|\u770B\u70B9|\u901F\u89C8|\u89E3\u8BFB|reaction|\u5F71\u8BC4)(.*?)$"), this.fetch.setCookie({
5424
+ super(), iqiyi_define_property(this, "providerName", "iqiyi"), iqiyi_define_property(this, "xmlParser", new XMLParser()), iqiyi_define_property(this, "idSchema", iqiyiIdSchema), iqiyi_define_property(this, "PROVIDER_SPECIFIC_BLACKLIST_DEFAULT", "^(.*?)(\u62A2\u5148(\u7248|\u7BC7)?|\u52A0\u66F4(\u7248|\u7BC7)?|\u82B1\u7D6E|\u9884\u544A|\u7279\u8F91|\u5F69\u86CB|\u4E13\u8BBF|\u5E55\u540E(\u6545\u4E8B|\u82B1\u7D6E)?|\u76F4\u64AD|\u7EAF\u4EAB|\u672A\u64AD|\u884D\u751F|\u756A\u5916|\u4F1A\u5458(\u4E13\u5C5E|\u52A0\u957F)?|\u7247\u82B1|\u7CBE\u534E|\u770B\u70B9|\u901F\u89C8|\u89E3\u8BFB|reaction|\u5F71\u8BC4)(.*?)$"), this.fetch.setCookie({
5385
5425
  pgv_pvid: "40b67e3b06027f3d",
5386
5426
  video_platform: "2",
5387
5427
  vversion_name: "8.2.95",
@@ -5400,7 +5440,10 @@ function tencent_define_property(e, t, n) {
5400
5440
  writable: !0
5401
5441
  }) : e[t] = n, e;
5402
5442
  }
5403
- const tencentEpisodeSchema = schemas_object({
5443
+ const tencentIdSchema = schemas_object({
5444
+ cid: schemas_string(),
5445
+ vid: schemas_string().optional()
5446
+ }), tencentEpisodeSchema = schemas_object({
5404
5447
  vid: schemas_string().refine((e)=>!!e),
5405
5448
  is_trailer: schemas_string().refine((e)=>"1" !== e),
5406
5449
  title: schemas_string().refine((e)=>{
@@ -5430,6 +5473,9 @@ const tencentEpisodeSchema = schemas_object({
5430
5473
  }))
5431
5474
  }))
5432
5475
  })
5476
+ }).transform((e)=>{
5477
+ var t, n, r, i, o, s;
5478
+ return null != (s = null == (o = e.data.module_list_datas) || null == (i = o[0]) || null == (r = i.module_datas) || null == (n = r[0]) || null == (t = n.item_data_lists) ? void 0 : t.item_datas) ? s : [];
5433
5479
  }), tencentSegmentIndexSchema = schemas_object({
5434
5480
  segment_index: record(schemas_string(), schemas_object({
5435
5481
  segment_name: schemas_string()
@@ -5444,60 +5490,69 @@ const tencentEpisodeSchema = schemas_object({
5444
5490
  content_style: schemas_string().optional().transform((e)=>safeJsonParseWithZod(null != e ? e : "", tencentContentStyleSchema))
5445
5491
  }), tencentSegmentSchema = schemas_object({
5446
5492
  barrage_list: schemas_array(unknown().transform((e)=>{
5447
- let { success: t, data: n } = tencentCommentItemSchema.safeParse(e);
5448
- return t ? n : null;
5493
+ var t;
5494
+ return null != (t = tencentCommentItemSchema.safeParse(e).data) ? t : null;
5449
5495
  })).transform((e)=>e.filter((e)=>null !== e))
5450
5496
  }), tencent_pageSize = 100;
5451
5497
  class TencentScraper extends BaseScraper {
5452
5498
  async getEpisodes(e, t) {
5453
- let n = (await this.internalGetEpisodes(e)).map((t, n)=>{
5454
- let r = this.getEpisodeIndexFromTitle(t.title);
5455
- return r || (r = n + 1), {
5499
+ let n = this.parseIdString(e);
5500
+ if (!n) return [];
5501
+ let r = (await this.internalGetEpisodes(n.cid)).map((e, t)=>{
5502
+ let r = this.getEpisodeIndexFromTitle(e.title);
5503
+ return r || (r = t + 1), {
5456
5504
  provider: this.providerName,
5457
- episodeId: t.vid || "",
5458
- episodeTitle: t.union_title && t.union_title !== t.title ? t.union_title : t.title,
5505
+ episodeId: this.generateIdString({
5506
+ cid: n.cid,
5507
+ vid: e.vid
5508
+ }),
5509
+ episodeTitle: e.union_title && e.union_title !== e.title ? e.union_title : e.title,
5459
5510
  episodeNumber: r,
5460
- url: `https://v.qq.com/x/cover/${e}/${t.vid}.html`
5511
+ url: `https://v.qq.com/x/cover/${n.cid}/${e.vid}.html`
5461
5512
  };
5462
5513
  });
5463
5514
  if (void 0 !== t) {
5464
- let e = n.find((e)=>e.episodeNumber === t);
5515
+ let e = r.find((e)=>e.episodeNumber === t);
5465
5516
  return e ? [
5466
5517
  e
5467
5518
  ] : [];
5468
5519
  }
5469
- return n;
5520
+ return r;
5470
5521
  }
5471
5522
  async getSegments(e) {
5472
- let t = {};
5523
+ let t = this.parseIdString(e);
5524
+ if (!t) return [];
5525
+ let n = {};
5473
5526
  try {
5474
- var n;
5475
- let r = await this.fetch.get(`https://dm.video.qq.com/barrage/base/${e}`, {
5527
+ var r;
5528
+ let e = await this.fetch.get(`https://dm.video.qq.com/barrage/base/${t.vid}`, {
5476
5529
  schema: tencentSegmentIndexSchema,
5477
5530
  cache: {
5478
- cacheKey: `tencent:segment:${e}`,
5531
+ cacheKey: `tencent:segment:${t.vid}`,
5479
5532
  ttl: TTL_2_HOURS
5480
5533
  }
5481
5534
  });
5482
- if (!r.data) return [];
5483
- if (!(null == (n = r.data) ? void 0 : n.segment_index)) return console.info(`vid='${e}' \u{6CA1}\u{6709}\u{627E}\u{5230}\u{5F39}\u{5E55}\u{5206}\u{6BB5}\u{7D22}\u{5F15}\u{3002}`), [];
5484
- t = r.data.segment_index;
5485
- } catch (t) {
5486
- return console.error(`\u{83B7}\u{53D6}\u{5F39}\u{5E55}\u{7D22}\u{5F15}\u{5931}\u{8D25} (vid=${e})`, t), [];
5535
+ if (!e.data) return [];
5536
+ if (!(null == (r = e.data) ? void 0 : r.segment_index)) return console.info(`vid='${t.vid}' \u{6CA1}\u{6709}\u{627E}\u{5230}\u{5F39}\u{5E55}\u{5206}\u{6BB5}\u{7D22}\u{5F15}\u{3002}`), [];
5537
+ n = e.data.segment_index;
5538
+ } catch (e) {
5539
+ return console.error(`\u{83B7}\u{53D6}\u{5F39}\u{5E55}\u{7D22}\u{5F15}\u{5931}\u{8D25} (vid=${t.vid})`, e), [];
5487
5540
  }
5488
- let r = Object.keys(t).sort((e, t)=>parseInt(e, 10) - parseInt(t, 10));
5489
- return console.debug(`\u{4E3A} vid='${e}' \u{627E}\u{5230} ${r.length} \u{4E2A}\u{5F39}\u{5E55}\u{5206}\u{6BB5}`), r.map((e)=>{
5490
- var n;
5541
+ let i = Object.keys(n).sort((e, t)=>parseInt(e, 10) - parseInt(t, 10));
5542
+ return console.debug(`\u{4E3A} vid='${t.vid}' \u{627E}\u{5230} ${i.length} \u{4E2A}\u{5F39}\u{5E55}\u{5206}\u{6BB5}`), i.map((e)=>{
5543
+ var t;
5491
5544
  return {
5492
5545
  provider: this.providerName,
5493
5546
  startTime: parseInt(e, 10) / 1000.0,
5494
- segmentId: null == (n = t[e]) ? void 0 : n.segment_name
5547
+ segmentId: null == (t = n[e]) ? void 0 : t.segment_name
5495
5548
  };
5496
5549
  });
5497
5550
  }
5498
5551
  async getComments(e, t) {
5499
- let n = await this.internalGetComments(e, t);
5500
- return n && 0 !== n.length ? this.formatComments(n, (e)=>{
5552
+ let n = this.parseIdString(e);
5553
+ if (!(null == n ? void 0 : n.vid)) return [];
5554
+ let r = await this.internalGetComments(n.vid, t);
5555
+ return r && 0 !== r.length ? this.formatComments(r, (e)=>{
5501
5556
  let t = 1, n = 16777215;
5502
5557
  if (e.content_style && (2 === e.content_style.position ? t = 5 : 3 === e.content_style.position && (t = 4), e.content_style.color)) try {
5503
5558
  n = parseInt(e.content_style.color, 10);
@@ -5515,9 +5570,9 @@ class TencentScraper extends BaseScraper {
5515
5570
  let t = [], n = 0, r = "";
5516
5571
  for(this.fetch.setHeaders({
5517
5572
  Referer: `https://v.qq.com/x/cover/${e}.html`
5518
- });;){
5519
- var i, o, s, a, u, l, c, p;
5520
- let d = null != (p = null == (c = (await this.fetch.post("https://pbaccess.video.qq.com/trpc.universal_backend_service.page_server_rpc.PageServer/GetPageData?video_appid=3000010&vplatform=2", {
5573
+ });;)try {
5574
+ var i;
5575
+ let o = null != (i = (await this.fetch.post("https://pbaccess.video.qq.com/trpc.universal_backend_service.page_server_rpc.PageServer/GetPageData?video_appid=3000010&vplatform=2", {
5521
5576
  page_params: {
5522
5577
  cid: e,
5523
5578
  page_type: "detail_operation",
@@ -5537,16 +5592,19 @@ class TencentScraper extends BaseScraper {
5537
5592
  cache: {
5538
5593
  cacheKey: `tencent:episodes:${e}:${n}`
5539
5594
  }
5540
- })).data) || null == (l = c.data) || null == (u = l.module_list_datas) || null == (a = u[0]) || null == (s = a.module_datas) || null == (o = s[0]) || null == (i = o.item_data_lists) ? void 0 : i.item_datas) ? p : [];
5541
- for (let e of (d.length >= tencent_pageSize ? (n += 1, r = url_parse.qs.stringify({
5595
+ })).data) ? i : [];
5596
+ for (let e of (o.length >= tencent_pageSize ? (n += 1, r = url_parse.qs.stringify({
5542
5597
  episode_begin: n * tencent_pageSize,
5543
5598
  episode_end: (n + 1) * tencent_pageSize,
5544
5599
  episode_step: tencent_pageSize
5545
- })) : r = "", d)){
5600
+ })) : r = "", o)){
5546
5601
  let { success: n, data: r } = tencentEpisodeSchema.safeParse(e.item_params);
5547
5602
  n && t.push(r);
5548
5603
  }
5549
5604
  if (!r) break;
5605
+ } catch (t) {
5606
+ console.error(`\u{83B7}\u{53D6}\u{5206}\u{96C6}\u{5217}\u{8868}\u{5931}\u{8D25} (cid=${e})`, t);
5607
+ break;
5550
5608
  }
5551
5609
  return t;
5552
5610
  }
@@ -5561,7 +5619,7 @@ class TencentScraper extends BaseScraper {
5561
5619
  }
5562
5620
  }
5563
5621
  constructor(){
5564
- super(), tencent_define_property(this, "providerName", "tencent"), this.fetch.setCookie({
5622
+ super(), tencent_define_property(this, "providerName", "tencent"), tencent_define_property(this, "idSchema", tencentIdSchema), this.fetch.setCookie({
5565
5623
  pgv_pvid: "40b67e3b06027f3d",
5566
5624
  video_platform: "2",
5567
5625
  vversion_name: "8.2.95",
@@ -5581,7 +5639,10 @@ function youku_define_property(e, t, n) {
5581
5639
  writable: !0
5582
5640
  }) : e[t] = n, e;
5583
5641
  }
5584
- const youkuEpisodeInfoSchema = schemas_object({
5642
+ const youkuIdSchema = schemas_object({
5643
+ showId: schemas_string(),
5644
+ vid: schemas_string().optional()
5645
+ }), youkuEpisodeInfoSchema = schemas_object({
5585
5646
  id: schemas_string(),
5586
5647
  title: schemas_string(),
5587
5648
  duration: schemas_string(),
@@ -5625,66 +5686,77 @@ class YoukuScraper extends BaseScraper {
5625
5686
  return null != (e = this.fetch.getCookie("cna")) ? e : "";
5626
5687
  }
5627
5688
  async getEpisodes(e, t) {
5628
- let n = [], r = 1, i = 20, o = 0;
5689
+ let n = this.parseIdString(e);
5690
+ if (!n) return [];
5691
+ let r = [], i = 1, o = 20, s = 0;
5629
5692
  for(;;)try {
5630
- let s = await this.getEpisodesPage(e, r, i);
5631
- if (!s || !s.videos || 0 === s.videos.length) break;
5632
- 1 === r && s.total && (o = s.total);
5633
- let a = s.videos.filter((e)=>!this.EPISODE_BLACKLIST_KEYWORDS.some((t)=>e.title.includes(t)));
5634
- if (n.push(...a), n.length >= o || s.videos.length < i || t && n.length >= t) break;
5635
- r++, await this.sleep(300);
5636
- } catch (t) {
5637
- console.error(`Youku: Failed to get episodes page ${r} for media_id ${e}:`, t);
5693
+ let e = await this.getEpisodesPage(n.showId, i, o);
5694
+ if (!e || !e.videos || 0 === e.videos.length) break;
5695
+ 1 === i && e.total && (s = e.total);
5696
+ let a = e.videos.filter((e)=>!this.EPISODE_BLACKLIST_KEYWORDS.some((t)=>e.title.includes(t)));
5697
+ if (r.push(...a), r.length >= s || e.videos.length < o || t && r.length >= t) break;
5698
+ i++, await this.sleep(300);
5699
+ } catch (e) {
5700
+ console.error(`Youku: Failed to get episodes page ${i} for media_id ${n.showId}:`, e);
5638
5701
  break;
5639
5702
  }
5640
- let s = n.map((e, t)=>({
5703
+ let a = r.map((e, t)=>({
5641
5704
  provider: this.providerName,
5642
- episodeId: e.id,
5705
+ episodeId: this.generateIdString({
5706
+ showId: n.showId,
5707
+ vid: e.id
5708
+ }),
5643
5709
  episodeTitle: e.title,
5644
5710
  episodeNumber: t + 1,
5645
5711
  url: e.link
5646
5712
  }));
5647
5713
  if (void 0 !== t) {
5648
- let e = s.find((e)=>e.episodeNumber === t);
5714
+ let e = a.find((e)=>e.episodeNumber === t);
5649
5715
  return e ? [
5650
5716
  e
5651
5717
  ] : [];
5652
5718
  }
5653
- return s;
5719
+ return a;
5654
5720
  }
5655
5721
  async getSegments(e) {
5722
+ var t;
5723
+ let { vid: n } = null != (t = this.parseIdString(e)) ? t : {};
5724
+ if (!n) return [];
5656
5725
  try {
5657
5726
  await this.ensureTokenCookie();
5658
- let t = (await this.fetch.get("https://openapi.youku.com/v2/videos/show_basic.json", {
5727
+ let e = (await this.fetch.get("https://openapi.youku.com/v2/videos/show_basic.json", {
5659
5728
  params: {
5660
5729
  client_id: "53e6cc67237fc59a",
5661
5730
  package: "com.huawei.hwvplayer.youku",
5662
- video_id: e
5731
+ video_id: n
5663
5732
  },
5664
5733
  schema: youkuEpisodeInfoSchema,
5665
5734
  cache: {
5666
- cacheKey: `youku:segments:${e}`
5735
+ cacheKey: `youku:segments:${n}`
5667
5736
  }
5668
5737
  })).data;
5669
- if (!t) return console.warn(`Youku: Failed to get episode info for vid ${e}`), [];
5670
- let n = t.totalMat;
5671
- if (0 === n) return console.warn(`Youku: Video ${e} has duration 0, no danmaku to fetch.`), [];
5738
+ if (!e) return console.warn(`Youku: Failed to get episode info for vid ${n}`), [];
5739
+ let t = e.totalMat;
5740
+ if (0 === t) return console.warn(`Youku: Video ${n} has duration 0, no danmaku to fetch.`), [];
5672
5741
  return Array.from({
5673
- length: n
5742
+ length: t
5674
5743
  }, (e, t)=>({
5675
5744
  provider: this.providerName,
5676
5745
  startTime: 60 * t,
5677
5746
  segmentId: t.toString()
5678
5747
  }));
5679
- } catch (t) {
5680
- return console.error(`Youku: Failed to get segments for vid ${e}:`, t), [];
5748
+ } catch (e) {
5749
+ return console.error(`Youku: Failed to get segments for vid ${n}:`, e), [];
5681
5750
  }
5682
5751
  }
5683
5752
  async getComments(e, t) {
5753
+ var n;
5754
+ let { vid: r } = null != (n = this.parseIdString(e)) ? n : {};
5755
+ if (!r) return [];
5684
5756
  try {
5685
- return await this.ensureTokenCookie(), this.getDanmuContentByMat(e, parseInt(t, 10));
5686
- } catch (t) {
5687
- return console.error(`Youku: Failed to get danmaku for vid ${e}:`, t), [];
5757
+ return await this.ensureTokenCookie(), this.getDanmuContentByMat(r, parseInt(t, 10));
5758
+ } catch (e) {
5759
+ return console.error(`Youku: Failed to get danmaku for vid ${r}:`, e), [];
5688
5760
  }
5689
5761
  }
5690
5762
  async getEpisodesPage(e, t, n) {
@@ -5794,7 +5866,7 @@ class YoukuScraper extends BaseScraper {
5794
5866
  this.cna && this.token || console.warn(`Youku: \u{672A}\u{80FD}\u{83B7}\u{53D6}\u{5230}\u{5F39}\u{5E55}\u{7B7E}\u{540D}\u{6240}\u{9700}\u{7684}\u{5168}\u{90E8} cookie\u{3002} cna: '${this.cna}', token: '${this.token}'`);
5795
5867
  }
5796
5868
  constructor(...e){
5797
- super(...e), youku_define_property(this, "providerName", "youku"), youku_define_property(this, "EPISODE_BLACKLIST_KEYWORDS", [
5869
+ super(...e), youku_define_property(this, "providerName", "youku"), youku_define_property(this, "idSchema", youkuIdSchema), youku_define_property(this, "EPISODE_BLACKLIST_KEYWORDS", [
5798
5870
  "\u5F69\u86CB",
5799
5871
  "\u52A0\u66F4",
5800
5872
  "\u8D70\u5FC3",
@@ -5811,6 +5883,12 @@ function scrapers_define_property(e, t, n) {
5811
5883
  writable: !0
5812
5884
  }) : e[t] = n, e;
5813
5885
  }
5886
+ const scrapers = [
5887
+ TencentScraper,
5888
+ YoukuScraper,
5889
+ IqiyiScraper,
5890
+ BilibiliScraper
5891
+ ];
5814
5892
  class scrapers_Scraper {
5815
5893
  get scraperMap() {
5816
5894
  return keyBy(this.scrapers, (e)=>e.providerName);
@@ -5838,7 +5916,7 @@ class scrapers_Scraper {
5838
5916
  let e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
5839
5917
  for(var t = arguments.length, n = Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)n[r - 1] = arguments[r];
5840
5918
  let i = [];
5841
- for (let { provider: t, videoId: r } of n)i.push((async ()=>{
5919
+ for (let { provider: t, idString: r } of n)i.push((async ()=>{
5842
5920
  var n;
5843
5921
  let i = await this.getSegmentsByProvider(t, r);
5844
5922
  if (!i.length) return [];
@@ -5852,16 +5930,19 @@ class scrapers_Scraper {
5852
5930
  let [t, n] = e.split(":");
5853
5931
  return {
5854
5932
  provider: t,
5855
- videoId: n
5933
+ idString: n
5856
5934
  };
5857
5935
  });
5858
5936
  return this.getSegmentWithTime(t, ...n);
5859
5937
  }
5860
5938
  async getEpisodes() {
5861
- for(var e, t = arguments.length, n = Array(t), r = 0; r < t; r++)n[r] = arguments[r];
5862
- let i = [];
5863
- for (let { provider: t, mediaId: r } of n)i.push(null == (e = this.scraperMap[t]) ? void 0 : e.getEpisodes(r).catch((e)=>(console.error(e), [])));
5864
- return (await Promise.all(i).catch((e)=>(console.error(e), []))).flat().map((e)=>({
5939
+ for(var e = arguments.length, t = Array(e), n = 0; n < e; n++)t[n] = arguments[n];
5940
+ let r = [];
5941
+ for (let { provider: e, idString: n } of t){
5942
+ let t = this.scraperMap[e];
5943
+ t && r.push(t.getEpisodes(n).catch((e)=>(console.error(e), [])));
5944
+ }
5945
+ return (await Promise.all(r).catch((e)=>(console.error(e), []))).flat().map((e)=>({
5865
5946
  ...e,
5866
5947
  episodeId: `${e.provider}:${e.episodeId}`
5867
5948
  }));
@@ -5873,29 +5954,27 @@ class scrapers_Scraper {
5873
5954
  async getDetailWithAnimeId(e, t, n) {
5874
5955
  let [r, i] = e.split(":"), o = await this.getEpisodes({
5875
5956
  provider: r,
5876
- mediaId: i
5957
+ idString: i
5877
5958
  });
5878
5959
  return this.formatEpisodeResult(o, t, n);
5879
5960
  }
5880
5961
  async getDetailWithDoubanId(e, t, n) {
5881
5962
  let r = await getVideoPlatformInfoByDoubanId(e.toString()), i = [];
5882
5963
  Object.entries(r.providers).forEach((e)=>{
5883
- let [t, { id: n }] = e;
5964
+ var t, n;
5965
+ let [r, o] = e;
5884
5966
  i.push({
5885
- provider: t,
5886
- mediaId: n
5967
+ provider: r,
5968
+ idString: null != (n = null == (t = this.scraperMap[r]) ? void 0 : t.generateIdString(o)) ? n : ""
5887
5969
  });
5888
5970
  });
5889
5971
  let o = await this.getEpisodes(...i);
5890
5972
  return this.formatEpisodeResult(o, t, n);
5891
5973
  }
5892
5974
  constructor(){
5893
- scrapers_define_property(this, "scrapers", []), this.scrapers.push(...[
5894
- TencentScraper,
5895
- YoukuScraper,
5896
- IqiyiScraper,
5897
- BilibiliScraper
5898
- ].map((e)=>new e()));
5975
+ scrapers_define_property(this, "scrapers", []), scrapers.forEach((e)=>{
5976
+ this.scrapers.push(new e());
5977
+ });
5899
5978
  }
5900
5979
  }
5901
5980
  WidgetMetadata = {
@@ -5903,7 +5982,7 @@ WidgetMetadata = {
5903
5982
  title: "\u901A\u7528\u5F39\u5E55",
5904
5983
  description: "\u901A\u7528\u5F39\u5E55\u63D2\u4EF6\uFF0C\u652F\u6301\u817E\u8BAF\u3001\u4F18\u9177\u3001\u7231\u5947\u827A\u3001\u54D4\u54E9\u54D4\u54E9\u7B49\u5E73\u53F0",
5905
5984
  author: "Baran",
5906
- version: "0.0.2",
5985
+ version: "0.0.4",
5907
5986
  site: "https://github.com/baranwang/forward-widgets/tree/main/packages/danmu-universe",
5908
5987
  requiredVersion: "0.0.2",
5909
5988
  modules: [
@@ -5949,7 +6028,6 @@ searchDanmu = async (e)=>{
5949
6028
  let t = `[${PROVIDER_NAMES[e.provider]}] `;
5950
6029
  return e.episodeTitle && (t += e.episodeTitle), {
5951
6030
  animeId: e.episodeId,
5952
- bangumiId: e.episodeId,
5953
6031
  animeTitle: t
5954
6032
  };
5955
6033
  })