@forward-widget/danmu-universe 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/danmu-universe.js +207 -157
- package/package.json +9 -1
package/dist/danmu-universe.js
CHANGED
|
@@ -267,7 +267,7 @@ var __webpack_modules__ = {
|
|
|
267
267
|
e = this.words = e || [], t != n ? this.sigBytes = n : this.sigBytes = 4 * e.length;
|
|
268
268
|
},
|
|
269
269
|
toString: function(e) {
|
|
270
|
-
return (e ||
|
|
270
|
+
return (e || d).stringify(this);
|
|
271
271
|
},
|
|
272
272
|
concat: function(e) {
|
|
273
273
|
var t = this.words, n = e.words, r = this.sigBytes, i = e.sigBytes;
|
|
@@ -290,7 +290,7 @@ var __webpack_modules__ = {
|
|
|
290
290
|
for(var t = [], n = 0; n < e; n += 4)t.push(i());
|
|
291
291
|
return new l.init(t, e);
|
|
292
292
|
}
|
|
293
|
-
}), c = s.enc = {},
|
|
293
|
+
}), c = s.enc = {}, d = c.Hex = {
|
|
294
294
|
stringify: function(e) {
|
|
295
295
|
for(var t = e.words, n = e.sigBytes, r = [], i = 0; i < n; i++){
|
|
296
296
|
var o = t[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
|
|
@@ -302,7 +302,7 @@ var __webpack_modules__ = {
|
|
|
302
302
|
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
303
|
return new l.init(n, t / 2);
|
|
304
304
|
}
|
|
305
|
-
},
|
|
305
|
+
}, p = c.Latin1 = {
|
|
306
306
|
stringify: function(e) {
|
|
307
307
|
for(var t = e.words, n = e.sigBytes, r = [], i = 0; i < n; i++){
|
|
308
308
|
var o = t[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;
|
|
@@ -317,13 +317,13 @@ var __webpack_modules__ = {
|
|
|
317
317
|
}, f = c.Utf8 = {
|
|
318
318
|
stringify: function(e) {
|
|
319
319
|
try {
|
|
320
|
-
return decodeURIComponent(escape(
|
|
320
|
+
return decodeURIComponent(escape(p.stringify(e)));
|
|
321
321
|
} catch (e) {
|
|
322
322
|
throw Error('Malformed UTF-8 data');
|
|
323
323
|
}
|
|
324
324
|
},
|
|
325
325
|
parse: function(e) {
|
|
326
|
-
return
|
|
326
|
+
return p.parse(unescape(encodeURIComponent(e)));
|
|
327
327
|
}
|
|
328
328
|
}, h = a.BufferedBlockAlgorithm = u.extend({
|
|
329
329
|
reset: function() {
|
|
@@ -335,7 +335,7 @@ var __webpack_modules__ = {
|
|
|
335
335
|
_process: function(t) {
|
|
336
336
|
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
337
|
if (u) {
|
|
338
|
-
for(var
|
|
338
|
+
for(var d = 0; d < u; d += s)this._doProcessBlock(i, d);
|
|
339
339
|
n = i.splice(0, u), r.sigBytes -= c;
|
|
340
340
|
}
|
|
341
341
|
return new l.init(n, c);
|
|
@@ -448,8 +448,8 @@ var __webpack_modules__ = {
|
|
|
448
448
|
var r = t + n, i = e[r];
|
|
449
449
|
e[r] = (i << 8 | i >>> 24) & 0x00ff00ff | (i << 24 | i >>> 8) & 0xff00ff00;
|
|
450
450
|
}
|
|
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],
|
|
452
|
-
|
|
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], S = e[t + 15], z = o[0], O = o[1], I = o[2], $ = o[3];
|
|
452
|
+
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, y, 17, a[6]), O = l(O, I, $, z, v, 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, k, 22, a[11]), z = l(z, O, I, $, x, 7, a[12]), $ = l($, z, O, I, j, 12, a[13]), I = l(I, $, z, O, E, 17, a[14]), O = l(O, I, $, z, S, 22, a[15]), z = c(z, O, I, $, u, 5, a[16]), $ = c($, z, O, I, y, 9, a[17]), I = c(I, $, z, O, k, 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, S, 14, a[22]), O = c(O, I, $, z, m, 20, a[23]), z = c(z, O, I, $, _, 5, a[24]), $ = c($, z, O, I, E, 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, v, 14, a[30]), O = c(O, I, $, z, x, 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, k, 16, a[34]), O = d(O, I, $, z, E, 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, v, 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, y, 23, a[43]), z = d(z, O, I, $, _, 4, a[44]), $ = d($, z, O, I, x, 11, a[45]), I = d(I, $, z, O, S, 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, v, 10, a[49]), I = p(I, $, z, O, E, 15, a[50]), O = p(O, I, $, z, g, 21, a[51]), z = p(z, O, I, $, x, 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, S, 10, a[57]), I = p(I, $, z, O, y, 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, k, 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
453
|
},
|
|
454
454
|
_doFinalize: function() {
|
|
455
455
|
var e = this._data, n = e.words, r = 8 * this._nDataBytes, i = 8 * e.sigBytes;
|
|
@@ -475,11 +475,11 @@ var __webpack_modules__ = {
|
|
|
475
475
|
var a = e + (t & r | n & ~r) + i + s;
|
|
476
476
|
return (a << o | a >>> 32 - o) + t;
|
|
477
477
|
}
|
|
478
|
-
function
|
|
478
|
+
function d(e, t, n, r, i, o, s) {
|
|
479
479
|
var a = e + (t ^ n ^ r) + i + s;
|
|
480
480
|
return (a << o | a >>> 32 - o) + t;
|
|
481
481
|
}
|
|
482
|
-
function
|
|
482
|
+
function p(e, t, n, r, i, o, s) {
|
|
483
483
|
var a = e + (n ^ (t | ~r)) + i + s;
|
|
484
484
|
return (a << o | a >>> 32 - o) + t;
|
|
485
485
|
}
|
|
@@ -519,7 +519,7 @@ var __webpack_modules__ = {
|
|
|
519
519
|
})(e);
|
|
520
520
|
} : l;
|
|
521
521
|
};
|
|
522
|
-
function
|
|
522
|
+
function d() {
|
|
523
523
|
var e = new o(0, 0), t = 0;
|
|
524
524
|
if (this.len - this.pos > 4) {
|
|
525
525
|
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 +540,12 @@ var __webpack_modules__ = {
|
|
|
540
540
|
}
|
|
541
541
|
throw Error("invalid varint encoding");
|
|
542
542
|
}
|
|
543
|
-
function
|
|
543
|
+
function p(e, t) {
|
|
544
544
|
return (e[t - 4] | e[t - 3] << 8 | e[t - 2] << 16 | e[t - 1] << 24) >>> 0;
|
|
545
545
|
}
|
|
546
546
|
function f() {
|
|
547
547
|
if (this.pos + 8 > this.len) throw a(this, 8);
|
|
548
|
-
return new o(
|
|
548
|
+
return new o(p(this.buf, this.pos += 4), p(this.buf, this.pos += 4));
|
|
549
549
|
}
|
|
550
550
|
u.create = c(), u.prototype._slice = i.Array.prototype.subarray || i.Array.prototype.slice, u.prototype.uint32 = function() {
|
|
551
551
|
var e = 4294967295;
|
|
@@ -563,10 +563,10 @@ var __webpack_modules__ = {
|
|
|
563
563
|
return 0 !== this.uint32();
|
|
564
564
|
}, u.prototype.fixed32 = function() {
|
|
565
565
|
if (this.pos + 4 > this.len) throw a(this, 4);
|
|
566
|
-
return
|
|
566
|
+
return p(this.buf, this.pos += 4);
|
|
567
567
|
}, u.prototype.sfixed32 = function() {
|
|
568
568
|
if (this.pos + 4 > this.len) throw a(this, 4);
|
|
569
|
-
return 0 |
|
|
569
|
+
return 0 | p(this.buf, this.pos += 4);
|
|
570
570
|
}, u.prototype.float = function() {
|
|
571
571
|
if (this.pos + 4 > this.len) throw a(this, 4);
|
|
572
572
|
var e = i.float.readFloatLE(this.buf, this.pos);
|
|
@@ -620,13 +620,13 @@ var __webpack_modules__ = {
|
|
|
620
620
|
var t = i.Long ? "toLong" : "toNumber";
|
|
621
621
|
i.merge(u.prototype, {
|
|
622
622
|
int64: function() {
|
|
623
|
-
return
|
|
623
|
+
return d.call(this)[t](!1);
|
|
624
624
|
},
|
|
625
625
|
uint64: function() {
|
|
626
|
-
return
|
|
626
|
+
return d.call(this)[t](!0);
|
|
627
627
|
},
|
|
628
628
|
sint64: function() {
|
|
629
|
-
return
|
|
629
|
+
return d.call(this).zzDecode()[t](!1);
|
|
630
630
|
},
|
|
631
631
|
fixed64: function() {
|
|
632
632
|
return f.call(this)[t](!0);
|
|
@@ -843,7 +843,7 @@ var __webpack_modules__ = {
|
|
|
843
843
|
};
|
|
844
844
|
},
|
|
845
845
|
"../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/writer.js": function(e, t, n) {
|
|
846
|
-
e.exports =
|
|
846
|
+
e.exports = d;
|
|
847
847
|
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
848
|
function u(e, t, n) {
|
|
849
849
|
this.fn = e, this.len = t, this.next = void 0, this.val = n;
|
|
@@ -852,16 +852,16 @@ var __webpack_modules__ = {
|
|
|
852
852
|
function c(e) {
|
|
853
853
|
this.head = e.head, this.tail = e.tail, this.len = e.len, this.next = e.states;
|
|
854
854
|
}
|
|
855
|
-
function
|
|
855
|
+
function d() {
|
|
856
856
|
this.len = 0, this.head = new u(l, 0, 0), this.tail = this.head, this.states = null;
|
|
857
857
|
}
|
|
858
|
-
var
|
|
858
|
+
var p = function() {
|
|
859
859
|
return i.Buffer ? function() {
|
|
860
|
-
return (
|
|
860
|
+
return (d.create = function() {
|
|
861
861
|
return new r();
|
|
862
862
|
})();
|
|
863
863
|
} : function() {
|
|
864
|
-
return new
|
|
864
|
+
return new d();
|
|
865
865
|
};
|
|
866
866
|
};
|
|
867
867
|
function f(e, t, n) {
|
|
@@ -882,32 +882,32 @@ var __webpack_modules__ = {
|
|
|
882
882
|
function y(e, t, n) {
|
|
883
883
|
t[n] = 255 & e, t[n + 1] = e >>> 8 & 255, t[n + 2] = e >>> 16 & 255, t[n + 3] = e >>> 24;
|
|
884
884
|
}
|
|
885
|
-
|
|
885
|
+
d.create = p(), d.alloc = function(e) {
|
|
886
886
|
return new i.Array(e);
|
|
887
|
-
}, i.Array !== Array && (
|
|
887
|
+
}, i.Array !== Array && (d.alloc = i.pool(d.alloc, i.Array.prototype.subarray)), d.prototype._push = function(e, t, n) {
|
|
888
888
|
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,
|
|
889
|
+
}, m.prototype = Object.create(u.prototype), m.prototype.fn = h, d.prototype.uint32 = function(e) {
|
|
890
890
|
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
|
-
},
|
|
891
|
+
}, d.prototype.int32 = function(e) {
|
|
892
892
|
return e < 0 ? this._push(g, 10, o.fromNumber(e)) : this.uint32(e);
|
|
893
|
-
},
|
|
893
|
+
}, d.prototype.sint32 = function(e) {
|
|
894
894
|
return this.uint32((e << 1 ^ e >> 31) >>> 0);
|
|
895
|
-
},
|
|
895
|
+
}, d.prototype.uint64 = function(e) {
|
|
896
896
|
var t = o.from(e);
|
|
897
897
|
return this._push(g, t.length(), t);
|
|
898
|
-
},
|
|
898
|
+
}, d.prototype.int64 = d.prototype.uint64, d.prototype.sint64 = function(e) {
|
|
899
899
|
var t = o.from(e).zzEncode();
|
|
900
900
|
return this._push(g, t.length(), t);
|
|
901
|
-
},
|
|
901
|
+
}, d.prototype.bool = function(e) {
|
|
902
902
|
return this._push(f, 1, +!!e);
|
|
903
|
-
},
|
|
903
|
+
}, d.prototype.fixed32 = function(e) {
|
|
904
904
|
return this._push(y, 4, e >>> 0);
|
|
905
|
-
},
|
|
905
|
+
}, d.prototype.sfixed32 = d.prototype.fixed32, d.prototype.fixed64 = function(e) {
|
|
906
906
|
var t = o.from(e);
|
|
907
907
|
return this._push(y, 4, t.lo)._push(y, 4, t.hi);
|
|
908
|
-
},
|
|
908
|
+
}, d.prototype.sfixed64 = d.prototype.fixed64, d.prototype.float = function(e) {
|
|
909
909
|
return this._push(i.float.writeFloatLE, 4, e);
|
|
910
|
-
},
|
|
910
|
+
}, d.prototype.double = function(e) {
|
|
911
911
|
return this._push(i.float.writeDoubleLE, 8, e);
|
|
912
912
|
};
|
|
913
913
|
var v = i.Array.prototype.set ? function(e, t, n) {
|
|
@@ -915,29 +915,29 @@ var __webpack_modules__ = {
|
|
|
915
915
|
} : function(e, t, n) {
|
|
916
916
|
for(var r = 0; r < e.length; ++r)t[n + r] = e[r];
|
|
917
917
|
};
|
|
918
|
-
|
|
918
|
+
d.prototype.bytes = function(e) {
|
|
919
919
|
var t = e.length >>> 0;
|
|
920
920
|
if (!t) return this._push(f, 1, 0);
|
|
921
921
|
if (i.isString(e)) {
|
|
922
|
-
var n =
|
|
922
|
+
var n = d.alloc(t = s.length(e));
|
|
923
923
|
s.decode(e, n, 0), e = n;
|
|
924
924
|
}
|
|
925
925
|
return this.uint32(t)._push(v, t, e);
|
|
926
|
-
},
|
|
926
|
+
}, d.prototype.string = function(e) {
|
|
927
927
|
var t = a.length(e);
|
|
928
928
|
return t ? this.uint32(t)._push(a.write, t, e) : this._push(f, 1, 0);
|
|
929
|
-
},
|
|
929
|
+
}, d.prototype.fork = function() {
|
|
930
930
|
return this.states = new c(this), this.head = this.tail = new u(l, 0, 0), this.len = 0, this;
|
|
931
|
-
},
|
|
931
|
+
}, d.prototype.reset = function() {
|
|
932
932
|
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
|
-
},
|
|
933
|
+
}, d.prototype.ldelim = function() {
|
|
934
934
|
var e = this.head, t = this.tail, n = this.len;
|
|
935
935
|
return this.reset().uint32(n), n && (this.tail.next = e.next, this.tail = t, this.len += n), this;
|
|
936
|
-
},
|
|
936
|
+
}, d.prototype.finish = function() {
|
|
937
937
|
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
938
|
return t;
|
|
939
|
-
},
|
|
940
|
-
r = e,
|
|
939
|
+
}, d._configure = function(e) {
|
|
940
|
+
r = e, d.create = p(), r._configure();
|
|
941
941
|
};
|
|
942
942
|
},
|
|
943
943
|
"../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/src/writer_buffer.js": function(e, t, n) {
|
|
@@ -1021,10 +1021,10 @@ var __webpack_modules__ = {
|
|
|
1021
1021
|
},
|
|
1022
1022
|
"../../node_modules/.pnpm/url-parse@1.5.10/node_modules/url-parse/index.js": function(e, t, n) {
|
|
1023
1023
|
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
|
|
1024
|
+
function d(e) {
|
|
1025
1025
|
return (e || '').toString().replace(o, '');
|
|
1026
1026
|
}
|
|
1027
|
-
var
|
|
1027
|
+
var p = [
|
|
1028
1028
|
[
|
|
1029
1029
|
'#',
|
|
1030
1030
|
'hash'
|
|
@@ -1083,7 +1083,7 @@ var __webpack_modules__ = {
|
|
|
1083
1083
|
return 'file:' === e || 'ftp:' === e || 'http:' === e || 'https:' === e || 'ws:' === e || 'wss:' === e;
|
|
1084
1084
|
}
|
|
1085
1085
|
function g(e, t) {
|
|
1086
|
-
e = (e =
|
|
1086
|
+
e = (e = d(e)).replace(s, ''), t = t || {};
|
|
1087
1087
|
var n, r = l.exec(e), i = r[1] ? r[1].toLowerCase() : '', o = !!r[2], a = !!r[3], u = 0;
|
|
1088
1088
|
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
1089
|
protocol: i,
|
|
@@ -1098,8 +1098,8 @@ var __webpack_modules__ = {
|
|
|
1098
1098
|
return o && n.unshift(''), ('.' === i || '..' === i) && n.push(''), n.join('/');
|
|
1099
1099
|
}
|
|
1100
1100
|
function v(e, t, n) {
|
|
1101
|
-
if (e = (e =
|
|
1102
|
-
var o, a, u, l, f, b, _ =
|
|
1101
|
+
if (e = (e = d(e)).replace(s, ''), !(this instanceof v)) return new v(e, t, n);
|
|
1102
|
+
var o, a, u, l, f, b, _ = p.slice(), w = typeof t, k = this, x = 0;
|
|
1103
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] = [
|
|
1104
1104
|
/(.*)/,
|
|
1105
1105
|
'pathname'
|
|
@@ -1146,8 +1146,8 @@ var __webpack_modules__ = {
|
|
|
1146
1146
|
var a = t.indexOf(':');
|
|
1147
1147
|
~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
1148
|
}
|
|
1149
|
-
for(var l = 0; l <
|
|
1150
|
-
var c =
|
|
1149
|
+
for(var l = 0; l < p.length; l++){
|
|
1150
|
+
var c = p[l];
|
|
1151
1151
|
c[4] && (o[c[1]] = o[c[1]].toLowerCase());
|
|
1152
1152
|
}
|
|
1153
1153
|
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 +1159,7 @@ var __webpack_modules__ = {
|
|
|
1159
1159
|
var s = o + (n.protocol && n.slashes || m(n.protocol) ? '//' : '');
|
|
1160
1160
|
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
1161
|
}
|
|
1162
|
-
}, v.extractProtocol = g, v.location = h, v.trimLeft =
|
|
1162
|
+
}, v.extractProtocol = g, v.location = h, v.trimLeft = d, v.qs = i, e.exports = v;
|
|
1163
1163
|
},
|
|
1164
1164
|
"?370f": function() {}
|
|
1165
1165
|
}, __webpack_module_cache__ = {};
|
|
@@ -2368,46 +2368,46 @@ const $ZodObject = $constructor("$ZodObject", (e, t)=>{
|
|
|
2368
2368
|
let a = t.compile();
|
|
2369
2369
|
return (t, n)=>a(e, t, n);
|
|
2370
2370
|
}, s = util_isObject, a = !globalConfig.jitless, u = util_allowsEval, l = a && u.value, c = t.catchall;
|
|
2371
|
-
e._zod.parse = (u,
|
|
2371
|
+
e._zod.parse = (u, d)=>{
|
|
2372
2372
|
r ?? (r = i.value);
|
|
2373
|
-
let
|
|
2374
|
-
if (!s(
|
|
2373
|
+
let p = u.value;
|
|
2374
|
+
if (!s(p)) return u.issues.push({
|
|
2375
2375
|
expected: "object",
|
|
2376
2376
|
code: "invalid_type",
|
|
2377
|
-
input:
|
|
2377
|
+
input: p,
|
|
2378
2378
|
inst: e
|
|
2379
2379
|
}), u;
|
|
2380
2380
|
let f = [];
|
|
2381
|
-
if (a && l &&
|
|
2381
|
+
if (a && l && d?.async === !1 && !0 !== d.jitless) n || (n = o(t.shape)), u = n(u, d);
|
|
2382
2382
|
else {
|
|
2383
2383
|
u.value = {};
|
|
2384
2384
|
let e = r.shape;
|
|
2385
2385
|
for (let t of r.keys){
|
|
2386
2386
|
let n = e[t]._zod.run({
|
|
2387
|
-
value:
|
|
2387
|
+
value: p[t],
|
|
2388
2388
|
issues: []
|
|
2389
|
-
},
|
|
2390
|
-
n instanceof Promise ? f.push(n.then((e)=>handlePropertyResult(e, u, t,
|
|
2389
|
+
}, d);
|
|
2390
|
+
n instanceof Promise ? f.push(n.then((e)=>handlePropertyResult(e, u, t, p))) : handlePropertyResult(n, u, t, p);
|
|
2391
2391
|
}
|
|
2392
2392
|
}
|
|
2393
2393
|
if (!c) return f.length ? Promise.all(f).then(()=>u) : u;
|
|
2394
2394
|
let h = [], m = r.keySet, g = c._zod, y = g.def.type;
|
|
2395
|
-
for (let e of Object.keys(
|
|
2395
|
+
for (let e of Object.keys(p)){
|
|
2396
2396
|
if (m.has(e)) continue;
|
|
2397
2397
|
if ("never" === y) {
|
|
2398
2398
|
h.push(e);
|
|
2399
2399
|
continue;
|
|
2400
2400
|
}
|
|
2401
2401
|
let t = g.run({
|
|
2402
|
-
value:
|
|
2402
|
+
value: p[e],
|
|
2403
2403
|
issues: []
|
|
2404
|
-
},
|
|
2405
|
-
t instanceof Promise ? f.push(t.then((t)=>handlePropertyResult(t, u, e,
|
|
2404
|
+
}, d);
|
|
2405
|
+
t instanceof Promise ? f.push(t.then((t)=>handlePropertyResult(t, u, e, p))) : handlePropertyResult(t, u, e, p);
|
|
2406
2406
|
}
|
|
2407
2407
|
return (h.length && u.issues.push({
|
|
2408
2408
|
code: "unrecognized_keys",
|
|
2409
2409
|
keys: h,
|
|
2410
|
-
input:
|
|
2410
|
+
input: p,
|
|
2411
2411
|
inst: e
|
|
2412
2412
|
}), f.length) ? Promise.all(f).then(()=>u) : u;
|
|
2413
2413
|
};
|
|
@@ -3676,7 +3676,7 @@ class Storage {
|
|
|
3676
3676
|
let t = Widget.storage.get(e);
|
|
3677
3677
|
if (!t) return null;
|
|
3678
3678
|
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
|
|
3679
|
+
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
3680
|
}
|
|
3681
3681
|
set(e, t, n) {
|
|
3682
3682
|
var r;
|
|
@@ -3798,11 +3798,11 @@ class Fetch {
|
|
|
3798
3798
|
}
|
|
3799
3799
|
let a = o ? void 0 : n, { timeout: u, schema: l, ...c } = s;
|
|
3800
3800
|
console.debug("fetch", t, a, c);
|
|
3801
|
-
let
|
|
3801
|
+
let d = o ? Widget.http.get(t, c) : Widget.http.post(t, a, c);
|
|
3802
3802
|
return u && u > 0 ? Promise.race([
|
|
3803
|
-
|
|
3803
|
+
d,
|
|
3804
3804
|
this.createTimeoutPromise(u)
|
|
3805
|
-
]) :
|
|
3805
|
+
]) : d;
|
|
3806
3806
|
}
|
|
3807
3807
|
getCacheKey(e, t) {
|
|
3808
3808
|
var n;
|
|
@@ -3916,10 +3916,15 @@ const getExternalIdsByTmdbId = async (e, t)=>{
|
|
|
3916
3916
|
switch(e.id){
|
|
3917
3917
|
case "qq":
|
|
3918
3918
|
{
|
|
3919
|
-
let { cid: e } = t.query;
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3919
|
+
let { cid: e, vid: n } = t.query;
|
|
3920
|
+
if (e) {
|
|
3921
|
+
let t = {
|
|
3922
|
+
cid: e
|
|
3923
|
+
};
|
|
3924
|
+
"movie" === o.mediaType && (t.vid = n), o.providers.tencent = {
|
|
3925
|
+
id: encodeURIComponent(JSON.stringify(t))
|
|
3926
|
+
};
|
|
3927
|
+
}
|
|
3923
3928
|
break;
|
|
3924
3929
|
}
|
|
3925
3930
|
case "iqiyi":
|
|
@@ -3942,7 +3947,9 @@ const getExternalIdsByTmdbId = async (e, t)=>{
|
|
|
3942
3947
|
{
|
|
3943
3948
|
let e = t.pathname.split("/").pop();
|
|
3944
3949
|
e && /\d+/.test(e) && (o.providers.bilibili = {
|
|
3945
|
-
id:
|
|
3950
|
+
id: encodeURIComponent(JSON.stringify({
|
|
3951
|
+
seasonId: e
|
|
3952
|
+
}))
|
|
3946
3953
|
});
|
|
3947
3954
|
}
|
|
3948
3955
|
}
|
|
@@ -3992,31 +3999,39 @@ function base_define_property(e, t, n) {
|
|
|
3992
3999
|
}) : e[t] = n, e;
|
|
3993
4000
|
}
|
|
3994
4001
|
class BaseScraper {
|
|
4002
|
+
parseIdString(e) {
|
|
4003
|
+
var t, n;
|
|
4004
|
+
let r = safeJsonParse(decodeURIComponent(e)), i = null == (t = this.idSchema) ? void 0 : t.safeParse(r);
|
|
4005
|
+
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);
|
|
4006
|
+
}
|
|
4007
|
+
generateIdString(e) {
|
|
4008
|
+
return encodeURIComponent(JSON.stringify(e));
|
|
4009
|
+
}
|
|
3995
4010
|
sleep(e) {
|
|
3996
4011
|
return new Promise((t)=>setTimeout(t, e));
|
|
3997
4012
|
}
|
|
3998
4013
|
formatComments(e, t) {
|
|
3999
|
-
let n = new Set(), r = new Map()
|
|
4000
|
-
for (let
|
|
4001
|
-
if (!
|
|
4002
|
-
let
|
|
4003
|
-
if (!
|
|
4004
|
-
n.add(
|
|
4005
|
-
let
|
|
4006
|
-
|
|
4007
|
-
item:
|
|
4014
|
+
let n = new Set(), r = new Map();
|
|
4015
|
+
for (let i of e){
|
|
4016
|
+
if (!i) continue;
|
|
4017
|
+
let e = t(i);
|
|
4018
|
+
if (!e || n.has(e.id)) continue;
|
|
4019
|
+
n.add(e.id);
|
|
4020
|
+
let o = e.content, s = r.get(o);
|
|
4021
|
+
s ? (e.timestamp < s.item.timestamp && (s.item = e), s.count += 1) : r.set(o, {
|
|
4022
|
+
item: e,
|
|
4008
4023
|
count: 1
|
|
4009
4024
|
});
|
|
4010
4025
|
}
|
|
4011
|
-
let
|
|
4026
|
+
let i = [];
|
|
4012
4027
|
return r.forEach((e)=>{
|
|
4013
4028
|
let { item: t, count: n } = e, r = n > 1 ? `${t.content} \xd7 ${n}` : t.content;
|
|
4014
|
-
|
|
4029
|
+
i.push({
|
|
4015
4030
|
cid: t.id,
|
|
4016
4031
|
p: `${t.timestamp.toFixed(2)},${t.mode},${t.color},[${this.providerName}]`,
|
|
4017
4032
|
m: r
|
|
4018
4033
|
});
|
|
4019
|
-
}),
|
|
4034
|
+
}), i;
|
|
4020
4035
|
}
|
|
4021
4036
|
getEpisodeIndexFromTitle(e) {
|
|
4022
4037
|
if (!e) return null;
|
|
@@ -4038,7 +4053,7 @@ class BaseScraper {
|
|
|
4038
4053
|
return null;
|
|
4039
4054
|
}
|
|
4040
4055
|
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", "");
|
|
4056
|
+
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
4057
|
}
|
|
4043
4058
|
}
|
|
4044
4059
|
var minimal = __webpack_require__("../../node_modules/.pnpm/protobufjs@7.5.4/node_modules/protobufjs/minimal.js");
|
|
@@ -4290,7 +4305,11 @@ function bilibili_define_property(e, t, n) {
|
|
|
4290
4305
|
writable: !0
|
|
4291
4306
|
}) : e[t] = n, e;
|
|
4292
4307
|
}
|
|
4293
|
-
const
|
|
4308
|
+
const bilibiliIdSchema = schemas_object({
|
|
4309
|
+
seasonId: schemas_string(),
|
|
4310
|
+
aid: schemas_string().optional(),
|
|
4311
|
+
cid: schemas_string().optional()
|
|
4312
|
+
}), pgcEpisodeSchema = schemas_object({
|
|
4294
4313
|
aid: schemas_int(),
|
|
4295
4314
|
cid: schemas_int(),
|
|
4296
4315
|
badge: schemas_string(),
|
|
@@ -4306,23 +4325,28 @@ const pgcEpisodeSchema = schemas_object({
|
|
|
4306
4325
|
});
|
|
4307
4326
|
class BilibiliScraper extends BaseScraper {
|
|
4308
4327
|
async getEpisodes(e, t) {
|
|
4309
|
-
let
|
|
4328
|
+
let n = this.parseIdString(e);
|
|
4329
|
+
if (!n) return [];
|
|
4330
|
+
let r = [], i = await this.getPgcEpisodes(n.seasonId), o = this.getEpisodeBlacklistPattern(), s = 1;
|
|
4310
4331
|
for (let e of null != i ? i : [])"\u9884\u544A" !== e.badge && (null != o && o.test(e.title) || (r.push({
|
|
4311
4332
|
provider: this.providerName,
|
|
4312
|
-
episodeId:
|
|
4313
|
-
n,
|
|
4314
|
-
e.aid,
|
|
4315
|
-
e.cid
|
|
4316
|
-
|
|
4333
|
+
episodeId: this.generateIdString({
|
|
4334
|
+
seasonId: n.seasonId,
|
|
4335
|
+
aid: e.aid.toString(),
|
|
4336
|
+
cid: e.cid.toString()
|
|
4337
|
+
}),
|
|
4317
4338
|
episodeTitle: e.show_title || e.title,
|
|
4318
4339
|
episodeNumber: s
|
|
4319
4340
|
}), s += 1));
|
|
4320
4341
|
return t ? r.filter((e)=>e.episodeNumber === t) : r;
|
|
4321
4342
|
}
|
|
4322
4343
|
async getSegments(e) {
|
|
4323
|
-
|
|
4324
|
-
|
|
4325
|
-
|
|
4344
|
+
var t;
|
|
4345
|
+
let { aid: n, cid: r, seasonId: i } = null != (t = this.parseIdString(e)) ? t : {};
|
|
4346
|
+
if (!n || !r || !i) return [];
|
|
4347
|
+
let o = await this.getPgcEpisodes(i), s = null == o ? void 0 : o.find((e)=>e.aid === parseInt(n) && e.cid === parseInt(r));
|
|
4348
|
+
return s ? Array.from({
|
|
4349
|
+
length: Math.floor(s.duration / 1000 / 360) + 1
|
|
4326
4350
|
}, (e, t)=>({
|
|
4327
4351
|
provider: this.providerName,
|
|
4328
4352
|
startTime: 360 * t,
|
|
@@ -4330,10 +4354,13 @@ class BilibiliScraper extends BaseScraper {
|
|
|
4330
4354
|
})) : [];
|
|
4331
4355
|
}
|
|
4332
4356
|
async getComments(e, t) {
|
|
4333
|
-
|
|
4334
|
-
|
|
4335
|
-
|
|
4336
|
-
|
|
4357
|
+
var n;
|
|
4358
|
+
let { aid: r, cid: i, seasonId: o } = null != (n = this.parseIdString(e)) ? n : {};
|
|
4359
|
+
if (!r || !i || !o) return [];
|
|
4360
|
+
let s = await this.getPgcEpisodes(o);
|
|
4361
|
+
if (!(null == s ? void 0 : s.find((e)=>e.aid === parseInt(r) && e.cid === parseInt(i)))) return [];
|
|
4362
|
+
let a = await this.fetchCommentsForCid(r, i, t);
|
|
4363
|
+
return this.formatComments(a, (e)=>{
|
|
4337
4364
|
var t, n, r;
|
|
4338
4365
|
if (!e.progress) return null;
|
|
4339
4366
|
let i = (null == (t = e.content) ? void 0 : t.replace(/\0/g, "")) || "";
|
|
@@ -4373,7 +4400,7 @@ class BilibiliScraper extends BaseScraper {
|
|
|
4373
4400
|
return r;
|
|
4374
4401
|
}
|
|
4375
4402
|
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({
|
|
4403
|
+
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
4404
|
Referer: "https://www.bilibili.com/"
|
|
4378
4405
|
});
|
|
4379
4406
|
}
|
|
@@ -4785,17 +4812,17 @@ const parseXml = function(e) {
|
|
|
4785
4812
|
}
|
|
4786
4813
|
]) : n.add(this.options.textNodeName, a), o = t + 2;
|
|
4787
4814
|
} else {
|
|
4788
|
-
let s = readTagExp(e, o, this.options.removeNSPrefix), a = s.tagName, u = s.rawTagName, l = s.tagExp, c = s.attrExpPresent,
|
|
4815
|
+
let s = readTagExp(e, o, this.options.removeNSPrefix), a = s.tagName, u = s.rawTagName, l = s.tagExp, c = s.attrExpPresent, d = s.closeIndex;
|
|
4789
4816
|
this.options.transformTagName && (a = this.options.transformTagName(a)), n && r && '!xml' !== n.tagname && (r = this.saveTextToParentTag(r, n, i, !1));
|
|
4790
|
-
let
|
|
4791
|
-
|
|
4817
|
+
let p = n;
|
|
4818
|
+
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
4819
|
let f = o;
|
|
4793
4820
|
if (this.isItStopNode(this.options.stopNodes, i, a)) {
|
|
4794
4821
|
let t = "";
|
|
4795
4822
|
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
4823
|
else if (-1 !== this.options.unpairedTags.indexOf(a)) o = s.closeIndex;
|
|
4797
4824
|
else {
|
|
4798
|
-
let n = this.readStopNodeData(e, u,
|
|
4825
|
+
let n = this.readStopNodeData(e, u, d + 1);
|
|
4799
4826
|
if (!n) throw Error(`Unexpected end of ${u}`);
|
|
4800
4827
|
o = n.i, t = n.tagContent;
|
|
4801
4828
|
}
|
|
@@ -4810,7 +4837,7 @@ const parseXml = function(e) {
|
|
|
4810
4837
|
let e = new XmlNode(a);
|
|
4811
4838
|
this.tagsNodeStack.push(n), a !== l && c && (e[":@"] = this.buildAttributesMap(l, i, a)), this.addChild(n, e, i, f), n = e;
|
|
4812
4839
|
}
|
|
4813
|
-
r = "", o =
|
|
4840
|
+
r = "", o = d;
|
|
4814
4841
|
}
|
|
4815
4842
|
}
|
|
4816
4843
|
else r += e[o];
|
|
@@ -5280,7 +5307,7 @@ class IqiyiScraper extends BaseScraper {
|
|
|
5280
5307
|
console.debug(`URL\u{6784}\u{5EFA}: s1=${i}, s2=${o}, \u{5B8C}\u{6574}URL=${s}`);
|
|
5281
5308
|
let a = await this.fetch.get(s, {
|
|
5282
5309
|
zlibMode: !0
|
|
5283
|
-
}), u = this.xmlParser.parse(a.data), { success: l, data: c, error:
|
|
5310
|
+
}), u = this.xmlParser.parse(a.data), { success: l, data: c, error: d } = iqiyiCommentsResponseSchema.safeParse(u);
|
|
5284
5311
|
return l ? this.formatComments(c, (e)=>{
|
|
5285
5312
|
let t = 16777215;
|
|
5286
5313
|
try {
|
|
@@ -5293,7 +5320,7 @@ class IqiyiScraper extends BaseScraper {
|
|
|
5293
5320
|
color: t,
|
|
5294
5321
|
content: e.content
|
|
5295
5322
|
};
|
|
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(
|
|
5323
|
+
}) : (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
5324
|
}
|
|
5298
5325
|
async getEpisodesV3(e) {
|
|
5299
5326
|
let t = {
|
|
@@ -5316,7 +5343,7 @@ class IqiyiScraper extends BaseScraper {
|
|
|
5316
5343
|
};
|
|
5317
5344
|
t.sign = this.createSign(t);
|
|
5318
5345
|
try {
|
|
5319
|
-
var n, r, i, o, s, a, u, l, c,
|
|
5346
|
+
var n, r, i, o, s, a, u, l, c, d, p;
|
|
5320
5347
|
let e = (await this.fetch.get("https://www.iqiyi.com/prelw/tvg/v2/lw/base_info", {
|
|
5321
5348
|
params: t,
|
|
5322
5349
|
schema: iqiyiV3ApiResponseSchema
|
|
@@ -5328,7 +5355,7 @@ class IqiyiScraper extends BaseScraper {
|
|
|
5328
5355
|
url: e.play_url
|
|
5329
5356
|
}))) ? o : [];
|
|
5330
5357
|
if (!f.length) {
|
|
5331
|
-
let t = null == e || null == (
|
|
5358
|
+
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
5359
|
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
5360
|
let o = this.getEpisodeBlacklistPattern(), h = 1;
|
|
5334
5361
|
for (let e of r.data){
|
|
@@ -5338,7 +5365,7 @@ class IqiyiScraper extends BaseScraper {
|
|
|
5338
5365
|
provider: this.providerName,
|
|
5339
5366
|
episodeId: t,
|
|
5340
5367
|
episodeTitle: e.title,
|
|
5341
|
-
episodeNumber: null != (
|
|
5368
|
+
episodeNumber: null != (p = this.getEpisodeIndexFromTitle(e.short_display_name)) ? p : h,
|
|
5342
5369
|
url: e.page_url
|
|
5343
5370
|
}), h += 1));
|
|
5344
5371
|
}
|
|
@@ -5400,7 +5427,10 @@ function tencent_define_property(e, t, n) {
|
|
|
5400
5427
|
writable: !0
|
|
5401
5428
|
}) : e[t] = n, e;
|
|
5402
5429
|
}
|
|
5403
|
-
const
|
|
5430
|
+
const tencentIdSchema = schemas_object({
|
|
5431
|
+
cid: schemas_string(),
|
|
5432
|
+
vid: schemas_string().optional()
|
|
5433
|
+
}), tencentEpisodeSchema = schemas_object({
|
|
5404
5434
|
vid: schemas_string().refine((e)=>!!e),
|
|
5405
5435
|
is_trailer: schemas_string().refine((e)=>"1" !== e),
|
|
5406
5436
|
title: schemas_string().refine((e)=>{
|
|
@@ -5430,6 +5460,9 @@ const tencentEpisodeSchema = schemas_object({
|
|
|
5430
5460
|
}))
|
|
5431
5461
|
}))
|
|
5432
5462
|
})
|
|
5463
|
+
}).transform((e)=>{
|
|
5464
|
+
var t, n, r, i, o, s;
|
|
5465
|
+
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
5466
|
}), tencentSegmentIndexSchema = schemas_object({
|
|
5434
5467
|
segment_index: record(schemas_string(), schemas_object({
|
|
5435
5468
|
segment_name: schemas_string()
|
|
@@ -5444,60 +5477,69 @@ const tencentEpisodeSchema = schemas_object({
|
|
|
5444
5477
|
content_style: schemas_string().optional().transform((e)=>safeJsonParseWithZod(null != e ? e : "", tencentContentStyleSchema))
|
|
5445
5478
|
}), tencentSegmentSchema = schemas_object({
|
|
5446
5479
|
barrage_list: schemas_array(unknown().transform((e)=>{
|
|
5447
|
-
|
|
5448
|
-
return t ?
|
|
5480
|
+
var t;
|
|
5481
|
+
return null != (t = tencentCommentItemSchema.safeParse(e).data) ? t : null;
|
|
5449
5482
|
})).transform((e)=>e.filter((e)=>null !== e))
|
|
5450
5483
|
}), tencent_pageSize = 100;
|
|
5451
5484
|
class TencentScraper extends BaseScraper {
|
|
5452
5485
|
async getEpisodes(e, t) {
|
|
5453
|
-
let n =
|
|
5454
|
-
|
|
5455
|
-
|
|
5486
|
+
let n = this.parseIdString(e);
|
|
5487
|
+
if (!n) return [];
|
|
5488
|
+
let r = (await this.internalGetEpisodes(n.cid)).map((e, t)=>{
|
|
5489
|
+
let r = this.getEpisodeIndexFromTitle(e.title);
|
|
5490
|
+
return r || (r = t + 1), {
|
|
5456
5491
|
provider: this.providerName,
|
|
5457
|
-
episodeId:
|
|
5458
|
-
|
|
5492
|
+
episodeId: this.generateIdString({
|
|
5493
|
+
cid: n.cid,
|
|
5494
|
+
vid: e.vid
|
|
5495
|
+
}),
|
|
5496
|
+
episodeTitle: e.union_title && e.union_title !== e.title ? e.union_title : e.title,
|
|
5459
5497
|
episodeNumber: r,
|
|
5460
|
-
url: `https://v.qq.com/x/cover/${
|
|
5498
|
+
url: `https://v.qq.com/x/cover/${n.cid}/${e.vid}.html`
|
|
5461
5499
|
};
|
|
5462
5500
|
});
|
|
5463
5501
|
if (void 0 !== t) {
|
|
5464
|
-
let e =
|
|
5502
|
+
let e = r.find((e)=>e.episodeNumber === t);
|
|
5465
5503
|
return e ? [
|
|
5466
5504
|
e
|
|
5467
5505
|
] : [];
|
|
5468
5506
|
}
|
|
5469
|
-
return
|
|
5507
|
+
return r;
|
|
5470
5508
|
}
|
|
5471
5509
|
async getSegments(e) {
|
|
5472
|
-
let t =
|
|
5510
|
+
let t = this.parseIdString(e);
|
|
5511
|
+
if (!t) return [];
|
|
5512
|
+
let n = {};
|
|
5473
5513
|
try {
|
|
5474
|
-
var
|
|
5475
|
-
let
|
|
5514
|
+
var r;
|
|
5515
|
+
let e = await this.fetch.get(`https://dm.video.qq.com/barrage/base/${t.vid}`, {
|
|
5476
5516
|
schema: tencentSegmentIndexSchema,
|
|
5477
5517
|
cache: {
|
|
5478
|
-
cacheKey: `tencent:segment:${
|
|
5518
|
+
cacheKey: `tencent:segment:${t.vid}`,
|
|
5479
5519
|
ttl: TTL_2_HOURS
|
|
5480
5520
|
}
|
|
5481
5521
|
});
|
|
5482
|
-
if (!
|
|
5483
|
-
if (!(null == (
|
|
5484
|
-
|
|
5485
|
-
} catch (
|
|
5486
|
-
return console.error(`\u{83B7}\u{53D6}\u{5F39}\u{5E55}\u{7D22}\u{5F15}\u{5931}\u{8D25} (vid=${
|
|
5522
|
+
if (!e.data) return [];
|
|
5523
|
+
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}`), [];
|
|
5524
|
+
n = e.data.segment_index;
|
|
5525
|
+
} catch (e) {
|
|
5526
|
+
return console.error(`\u{83B7}\u{53D6}\u{5F39}\u{5E55}\u{7D22}\u{5F15}\u{5931}\u{8D25} (vid=${t.vid})`, e), [];
|
|
5487
5527
|
}
|
|
5488
|
-
let
|
|
5489
|
-
return console.debug(`\u{4E3A} vid='${
|
|
5490
|
-
var
|
|
5528
|
+
let i = Object.keys(n).sort((e, t)=>parseInt(e, 10) - parseInt(t, 10));
|
|
5529
|
+
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)=>{
|
|
5530
|
+
var t;
|
|
5491
5531
|
return {
|
|
5492
5532
|
provider: this.providerName,
|
|
5493
5533
|
startTime: parseInt(e, 10) / 1000.0,
|
|
5494
|
-
segmentId: null == (
|
|
5534
|
+
segmentId: null == (t = n[e]) ? void 0 : t.segment_name
|
|
5495
5535
|
};
|
|
5496
5536
|
});
|
|
5497
5537
|
}
|
|
5498
5538
|
async getComments(e, t) {
|
|
5499
|
-
let n =
|
|
5500
|
-
|
|
5539
|
+
let n = this.parseIdString(e);
|
|
5540
|
+
if (!(null == n ? void 0 : n.vid)) return [];
|
|
5541
|
+
let r = await this.internalGetComments(n.vid, t);
|
|
5542
|
+
return r && 0 !== r.length ? this.formatComments(r, (e)=>{
|
|
5501
5543
|
let t = 1, n = 16777215;
|
|
5502
5544
|
if (e.content_style && (2 === e.content_style.position ? t = 5 : 3 === e.content_style.position && (t = 4), e.content_style.color)) try {
|
|
5503
5545
|
n = parseInt(e.content_style.color, 10);
|
|
@@ -5515,9 +5557,9 @@ class TencentScraper extends BaseScraper {
|
|
|
5515
5557
|
let t = [], n = 0, r = "";
|
|
5516
5558
|
for(this.fetch.setHeaders({
|
|
5517
5559
|
Referer: `https://v.qq.com/x/cover/${e}.html`
|
|
5518
|
-
});;){
|
|
5519
|
-
var i
|
|
5520
|
-
let
|
|
5560
|
+
});;)try {
|
|
5561
|
+
var i;
|
|
5562
|
+
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
5563
|
page_params: {
|
|
5522
5564
|
cid: e,
|
|
5523
5565
|
page_type: "detail_operation",
|
|
@@ -5537,16 +5579,19 @@ class TencentScraper extends BaseScraper {
|
|
|
5537
5579
|
cache: {
|
|
5538
5580
|
cacheKey: `tencent:episodes:${e}:${n}`
|
|
5539
5581
|
}
|
|
5540
|
-
})).data)
|
|
5541
|
-
for (let e of (
|
|
5582
|
+
})).data) ? i : [];
|
|
5583
|
+
for (let e of (o.length >= tencent_pageSize ? (n += 1, r = url_parse.qs.stringify({
|
|
5542
5584
|
episode_begin: n * tencent_pageSize,
|
|
5543
5585
|
episode_end: (n + 1) * tencent_pageSize,
|
|
5544
5586
|
episode_step: tencent_pageSize
|
|
5545
|
-
})) : r = "",
|
|
5587
|
+
})) : r = "", o)){
|
|
5546
5588
|
let { success: n, data: r } = tencentEpisodeSchema.safeParse(e.item_params);
|
|
5547
5589
|
n && t.push(r);
|
|
5548
5590
|
}
|
|
5549
5591
|
if (!r) break;
|
|
5592
|
+
} catch (t) {
|
|
5593
|
+
console.error(`\u{83B7}\u{53D6}\u{5206}\u{96C6}\u{5217}\u{8868}\u{5931}\u{8D25} (cid=${e})`, t);
|
|
5594
|
+
break;
|
|
5550
5595
|
}
|
|
5551
5596
|
return t;
|
|
5552
5597
|
}
|
|
@@ -5561,7 +5606,7 @@ class TencentScraper extends BaseScraper {
|
|
|
5561
5606
|
}
|
|
5562
5607
|
}
|
|
5563
5608
|
constructor(){
|
|
5564
|
-
super(), tencent_define_property(this, "providerName", "tencent"), this.fetch.setCookie({
|
|
5609
|
+
super(), tencent_define_property(this, "providerName", "tencent"), tencent_define_property(this, "idSchema", tencentIdSchema), this.fetch.setCookie({
|
|
5565
5610
|
pgv_pvid: "40b67e3b06027f3d",
|
|
5566
5611
|
video_platform: "2",
|
|
5567
5612
|
vversion_name: "8.2.95",
|
|
@@ -5811,6 +5856,12 @@ function scrapers_define_property(e, t, n) {
|
|
|
5811
5856
|
writable: !0
|
|
5812
5857
|
}) : e[t] = n, e;
|
|
5813
5858
|
}
|
|
5859
|
+
const scrapers = [
|
|
5860
|
+
TencentScraper,
|
|
5861
|
+
YoukuScraper,
|
|
5862
|
+
IqiyiScraper,
|
|
5863
|
+
BilibiliScraper
|
|
5864
|
+
];
|
|
5814
5865
|
class scrapers_Scraper {
|
|
5815
5866
|
get scraperMap() {
|
|
5816
5867
|
return keyBy(this.scrapers, (e)=>e.providerName);
|
|
@@ -5858,10 +5909,13 @@ class scrapers_Scraper {
|
|
|
5858
5909
|
return this.getSegmentWithTime(t, ...n);
|
|
5859
5910
|
}
|
|
5860
5911
|
async getEpisodes() {
|
|
5861
|
-
for(var e
|
|
5862
|
-
let
|
|
5863
|
-
for (let { provider:
|
|
5864
|
-
|
|
5912
|
+
for(var e = arguments.length, t = Array(e), n = 0; n < e; n++)t[n] = arguments[n];
|
|
5913
|
+
let r = [];
|
|
5914
|
+
for (let { provider: e, mediaId: n } of t){
|
|
5915
|
+
let t = this.scraperMap[e];
|
|
5916
|
+
t && r.push(t.getEpisodes(n).catch((e)=>(console.error(e), [])));
|
|
5917
|
+
}
|
|
5918
|
+
return (await Promise.all(r).catch((e)=>(console.error(e), []))).flat().map((e)=>({
|
|
5865
5919
|
...e,
|
|
5866
5920
|
episodeId: `${e.provider}:${e.episodeId}`
|
|
5867
5921
|
}));
|
|
@@ -5890,12 +5944,9 @@ class scrapers_Scraper {
|
|
|
5890
5944
|
return this.formatEpisodeResult(o, t, n);
|
|
5891
5945
|
}
|
|
5892
5946
|
constructor(){
|
|
5893
|
-
scrapers_define_property(this, "scrapers", []),
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
IqiyiScraper,
|
|
5897
|
-
BilibiliScraper
|
|
5898
|
-
].map((e)=>new e()));
|
|
5947
|
+
scrapers_define_property(this, "scrapers", []), scrapers.forEach((e)=>{
|
|
5948
|
+
this.scrapers.push(new e());
|
|
5949
|
+
});
|
|
5899
5950
|
}
|
|
5900
5951
|
}
|
|
5901
5952
|
WidgetMetadata = {
|
|
@@ -5903,7 +5954,7 @@ WidgetMetadata = {
|
|
|
5903
5954
|
title: "\u901A\u7528\u5F39\u5E55",
|
|
5904
5955
|
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
5956
|
author: "Baran",
|
|
5906
|
-
version: "0.0.
|
|
5957
|
+
version: "0.0.3",
|
|
5907
5958
|
site: "https://github.com/baranwang/forward-widgets/tree/main/packages/danmu-universe",
|
|
5908
5959
|
requiredVersion: "0.0.2",
|
|
5909
5960
|
modules: [
|
|
@@ -5949,7 +6000,6 @@ searchDanmu = async (e)=>{
|
|
|
5949
6000
|
let t = `[${PROVIDER_NAMES[e.provider]}] `;
|
|
5950
6001
|
return e.episodeTitle && (t += e.episodeTitle), {
|
|
5951
6002
|
animeId: e.episodeId,
|
|
5952
|
-
bangumiId: e.episodeId,
|
|
5953
6003
|
animeTitle: t
|
|
5954
6004
|
};
|
|
5955
6005
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forward-widget/danmu-universe",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/danmu-universe.js",
|
|
6
6
|
"exports": {
|
|
@@ -29,6 +29,14 @@
|
|
|
29
29
|
"protobufjs-cli": "^1.1.3",
|
|
30
30
|
"typescript": "^5.8.3"
|
|
31
31
|
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "https://github.com/baranwang/forward-widgets.git",
|
|
35
|
+
"directory": "packages/danmu-universe"
|
|
36
|
+
},
|
|
37
|
+
"publishConfig": {
|
|
38
|
+
"provenance": true
|
|
39
|
+
},
|
|
32
40
|
"license": "MIT",
|
|
33
41
|
"scripts": {
|
|
34
42
|
"build": "NODE_ENV=production rslib build",
|