@forward-widget/danmu-universe 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -7
- package/dist/danmu-universe.js +429 -392
- package/package.json +4 -3
package/dist/danmu-universe.js
CHANGED
|
@@ -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();
|
|
@@ -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],
|
|
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,
|
|
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;
|
|
@@ -879,7 +1126,7 @@ 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
|
|
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
1132
|
d.create = p(), d.alloc = function(e) {
|
|
@@ -901,16 +1148,16 @@ var __webpack_modules__ = {
|
|
|
901
1148
|
}, d.prototype.bool = function(e) {
|
|
902
1149
|
return this._push(f, 1, +!!e);
|
|
903
1150
|
}, d.prototype.fixed32 = function(e) {
|
|
904
|
-
return this._push(
|
|
1151
|
+
return this._push(v, 4, e >>> 0);
|
|
905
1152
|
}, d.prototype.sfixed32 = d.prototype.fixed32, d.prototype.fixed64 = function(e) {
|
|
906
1153
|
var t = o.from(e);
|
|
907
|
-
return this._push(
|
|
1154
|
+
return this._push(v, 4, t.lo)._push(v, 4, t.hi);
|
|
908
1155
|
}, d.prototype.sfixed64 = d.prototype.fixed64, d.prototype.float = function(e) {
|
|
909
1156
|
return this._push(i.float.writeFloatLE, 4, e);
|
|
910
1157
|
}, d.prototype.double = function(e) {
|
|
911
1158
|
return this._push(i.float.writeDoubleLE, 8, e);
|
|
912
1159
|
};
|
|
913
|
-
var
|
|
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];
|
|
@@ -922,7 +1169,7 @@ var __webpack_modules__ = {
|
|
|
922
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(
|
|
1172
|
+
return this.uint32(t)._push(y, t, e);
|
|
926
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);
|
|
@@ -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
|
|
1075
|
-
else if ('string' === s) for(r in o = new
|
|
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));
|
|
@@ -1092,27 +1339,27 @@ var __webpack_modules__ = {
|
|
|
1092
1339
|
rest: n
|
|
1093
1340
|
};
|
|
1094
1341
|
}
|
|
1095
|
-
function
|
|
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
|
|
1101
|
-
if (e = (e = d(e)).replace(s, ''), !(this instanceof
|
|
1102
|
-
var o, a, u, l, f, b, _ = p.slice(), w = typeof t,
|
|
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,
|
|
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
|
-
]);
|
|
1107
|
-
if ('function' == typeof (l = _[
|
|
1108
|
-
e = l(e,
|
|
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 ?
|
|
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 && (
|
|
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
|
-
|
|
1362
|
+
y.prototype = {
|
|
1116
1363
|
set: function(e, t, n) {
|
|
1117
1364
|
var o = this;
|
|
1118
1365
|
switch(e){
|
|
@@ -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
|
-
},
|
|
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",
|
|
@@ -2391,10 +2642,10 @@ const $ZodObject = $constructor("$ZodObject", (e, t)=>{
|
|
|
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,
|
|
2645
|
+
let h = [], m = r.keySet, g = c._zod, v = g.def.type;
|
|
2395
2646
|
for (let e of Object.keys(p)){
|
|
2396
2647
|
if (m.has(e)) continue;
|
|
2397
|
-
if ("never" ===
|
|
2648
|
+
if ("never" === v) {
|
|
2398
2649
|
h.push(e);
|
|
2399
2650
|
continue;
|
|
2400
2651
|
}
|
|
@@ -3796,13 +4047,16 @@ class Fetch {
|
|
|
3796
4047
|
}, s), r = storage.getJson(n);
|
|
3797
4048
|
if (r) return console.debug("fetch cache hit", n), Promise.resolve(r);
|
|
3798
4049
|
}
|
|
3799
|
-
let a = o ? void 0 : n, { timeout: u, schema: l,
|
|
3800
|
-
console.debug("fetch", t, a,
|
|
3801
|
-
|
|
4050
|
+
let a = o ? void 0 : n, { timeout: u, schema: l, params: c, ...d } = s, p = t;
|
|
4051
|
+
c && (p = `${t}?${url_parse.qs.stringify(c)}`), console.debug("\u2B06\uFE0F fetch", t, null != a ? a : "", {
|
|
4052
|
+
...d,
|
|
4053
|
+
params: c
|
|
4054
|
+
});
|
|
4055
|
+
let f = o ? Widget.http.get(p, d) : Widget.http.post(p, a, d);
|
|
3802
4056
|
return u && u > 0 ? Promise.race([
|
|
3803
|
-
|
|
4057
|
+
f,
|
|
3804
4058
|
this.createTimeoutPromise(u)
|
|
3805
|
-
]) :
|
|
4059
|
+
]) : f;
|
|
3806
4060
|
}
|
|
3807
4061
|
getCacheKey(e, t) {
|
|
3808
4062
|
var n;
|
|
@@ -3917,21 +4171,17 @@ const getExternalIdsByTmdbId = async (e, t)=>{
|
|
|
3917
4171
|
case "qq":
|
|
3918
4172
|
{
|
|
3919
4173
|
let { cid: e, vid: n } = t.query;
|
|
3920
|
-
|
|
3921
|
-
|
|
3922
|
-
|
|
3923
|
-
|
|
3924
|
-
"movie" === o.mediaType && (t.vid = n), o.providers.tencent = {
|
|
3925
|
-
id: encodeURIComponent(JSON.stringify(t))
|
|
3926
|
-
};
|
|
3927
|
-
}
|
|
4174
|
+
e && (o.providers.tencent = {
|
|
4175
|
+
cid: e,
|
|
4176
|
+
vid: n
|
|
4177
|
+
});
|
|
3928
4178
|
break;
|
|
3929
4179
|
}
|
|
3930
4180
|
case "iqiyi":
|
|
3931
4181
|
{
|
|
3932
4182
|
let { tvid: e } = t.query;
|
|
3933
4183
|
e && (o.providers.iqiyi = {
|
|
3934
|
-
|
|
4184
|
+
entityId: e
|
|
3935
4185
|
});
|
|
3936
4186
|
break;
|
|
3937
4187
|
}
|
|
@@ -3939,7 +4189,7 @@ const getExternalIdsByTmdbId = async (e, t)=>{
|
|
|
3939
4189
|
{
|
|
3940
4190
|
let { showid: e } = t.query;
|
|
3941
4191
|
e && (o.providers.youku = {
|
|
3942
|
-
|
|
4192
|
+
showId: e
|
|
3943
4193
|
});
|
|
3944
4194
|
break;
|
|
3945
4195
|
}
|
|
@@ -3947,9 +4197,7 @@ const getExternalIdsByTmdbId = async (e, t)=>{
|
|
|
3947
4197
|
{
|
|
3948
4198
|
let e = t.pathname.split("/").pop();
|
|
3949
4199
|
e && /\d+/.test(e) && (o.providers.bilibili = {
|
|
3950
|
-
|
|
3951
|
-
seasonId: e
|
|
3952
|
-
}))
|
|
4200
|
+
seasonId: e
|
|
3953
4201
|
});
|
|
3954
4202
|
}
|
|
3955
4203
|
}
|
|
@@ -4010,29 +4258,6 @@ class BaseScraper {
|
|
|
4010
4258
|
sleep(e) {
|
|
4011
4259
|
return new Promise((t)=>setTimeout(t, e));
|
|
4012
4260
|
}
|
|
4013
|
-
formatComments(e, t) {
|
|
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,
|
|
4023
|
-
count: 1
|
|
4024
|
-
});
|
|
4025
|
-
}
|
|
4026
|
-
let i = [];
|
|
4027
|
-
return r.forEach((e)=>{
|
|
4028
|
-
let { item: t, count: n } = e, r = n > 1 ? `${t.content} \xd7 ${n}` : t.content;
|
|
4029
|
-
i.push({
|
|
4030
|
-
cid: t.id,
|
|
4031
|
-
p: `${t.timestamp.toFixed(2)},${t.mode},${t.color},[${this.providerName}]`,
|
|
4032
|
-
m: r
|
|
4033
|
-
});
|
|
4034
|
-
}), i;
|
|
4035
|
-
}
|
|
4036
4261
|
getEpisodeIndexFromTitle(e) {
|
|
4037
4262
|
if (!e) return null;
|
|
4038
4263
|
let t = /(?:第)?(\d+)(?:集|话)?$/.exec(e.trim());
|
|
@@ -4056,247 +4281,7 @@ class BaseScraper {
|
|
|
4056
4281
|
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", "");
|
|
4057
4282
|
}
|
|
4058
4283
|
}
|
|
4059
|
-
var
|
|
4060
|
-
const $Reader = minimal.Reader, $Writer = minimal.Writer, $util = minimal.util, $root = minimal.roots.default || (minimal.roots.default = {}), dm_proto_biliproto = $root.biliproto = (()=>{
|
|
4061
|
-
let e = {};
|
|
4062
|
-
return e.community = function() {
|
|
4063
|
-
let e = {};
|
|
4064
|
-
return e.service = function() {
|
|
4065
|
-
let e = {};
|
|
4066
|
-
return e.dm = function() {
|
|
4067
|
-
let e = {};
|
|
4068
|
-
return e.v1 = function() {
|
|
4069
|
-
let e = {};
|
|
4070
|
-
return e.DanmakuElem = function() {
|
|
4071
|
-
function e(e) {
|
|
4072
|
-
if (e) for(let t = Object.keys(e), n = 0; n < t.length; ++n)null != e[t[n]] && (this[t[n]] = e[t[n]]);
|
|
4073
|
-
}
|
|
4074
|
-
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) {
|
|
4075
|
-
return new e(t);
|
|
4076
|
-
}, e.encode = function(e, t) {
|
|
4077
|
-
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;
|
|
4078
|
-
}, e.encodeDelimited = function(e, t) {
|
|
4079
|
-
return this.encode(e, t).ldelim();
|
|
4080
|
-
}, e.decode = function(e, t, n) {
|
|
4081
|
-
e instanceof $Reader || (e = $Reader.create(e));
|
|
4082
|
-
let r = void 0 === t ? e.len : e.pos + t, i = new $root.biliproto.community.service.dm.v1.DanmakuElem();
|
|
4083
|
-
for(; e.pos < r;){
|
|
4084
|
-
let t = e.uint32();
|
|
4085
|
-
if (t === n) break;
|
|
4086
|
-
switch(t >>> 3){
|
|
4087
|
-
case 1:
|
|
4088
|
-
i.id = e.int64();
|
|
4089
|
-
break;
|
|
4090
|
-
case 2:
|
|
4091
|
-
i.progress = e.int32();
|
|
4092
|
-
break;
|
|
4093
|
-
case 3:
|
|
4094
|
-
i.mode = e.int32();
|
|
4095
|
-
break;
|
|
4096
|
-
case 4:
|
|
4097
|
-
i.fontsize = e.int32();
|
|
4098
|
-
break;
|
|
4099
|
-
case 5:
|
|
4100
|
-
i.color = e.uint32();
|
|
4101
|
-
break;
|
|
4102
|
-
case 6:
|
|
4103
|
-
i.midHash = e.string();
|
|
4104
|
-
break;
|
|
4105
|
-
case 7:
|
|
4106
|
-
i.content = e.string();
|
|
4107
|
-
break;
|
|
4108
|
-
case 8:
|
|
4109
|
-
i.ctime = e.int64();
|
|
4110
|
-
break;
|
|
4111
|
-
case 9:
|
|
4112
|
-
i.weight = e.int32();
|
|
4113
|
-
break;
|
|
4114
|
-
case 10:
|
|
4115
|
-
i.action = e.string();
|
|
4116
|
-
break;
|
|
4117
|
-
case 11:
|
|
4118
|
-
i.pool = e.int32();
|
|
4119
|
-
break;
|
|
4120
|
-
case 12:
|
|
4121
|
-
i.idStr = e.string();
|
|
4122
|
-
break;
|
|
4123
|
-
case 13:
|
|
4124
|
-
i.attr = e.int32();
|
|
4125
|
-
break;
|
|
4126
|
-
case 14:
|
|
4127
|
-
i.animation = e.string();
|
|
4128
|
-
break;
|
|
4129
|
-
case 15:
|
|
4130
|
-
i.likeNum = e.uint32();
|
|
4131
|
-
break;
|
|
4132
|
-
case 16:
|
|
4133
|
-
i.colorV2 = e.string();
|
|
4134
|
-
break;
|
|
4135
|
-
case 17:
|
|
4136
|
-
i.dmTypeV2 = e.uint32();
|
|
4137
|
-
break;
|
|
4138
|
-
default:
|
|
4139
|
-
e.skipType(7 & t);
|
|
4140
|
-
}
|
|
4141
|
-
}
|
|
4142
|
-
return i;
|
|
4143
|
-
}, e.decodeDelimited = function(e) {
|
|
4144
|
-
return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
|
|
4145
|
-
}, e.verify = function(e) {
|
|
4146
|
-
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;
|
|
4147
|
-
}, e.fromObject = function(e) {
|
|
4148
|
-
if (e instanceof $root.biliproto.community.service.dm.v1.DanmakuElem) return e;
|
|
4149
|
-
let t = new $root.biliproto.community.service.dm.v1.DanmakuElem();
|
|
4150
|
-
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;
|
|
4151
|
-
}, e.toObject = function(e, t) {
|
|
4152
|
-
t || (t = {});
|
|
4153
|
-
let n = {};
|
|
4154
|
-
if (t.defaults) {
|
|
4155
|
-
if ($util.Long) {
|
|
4156
|
-
let e = new $util.Long(0, 0, !1);
|
|
4157
|
-
n.id = t.longs === String ? e.toString() : t.longs === Number ? e.toNumber() : e;
|
|
4158
|
-
} else n.id = t.longs === String ? "0" : 0;
|
|
4159
|
-
if (n.progress = 0, n.mode = 0, n.fontsize = 0, n.color = 0, n.midHash = "", n.content = "", $util.Long) {
|
|
4160
|
-
let e = new $util.Long(0, 0, !1);
|
|
4161
|
-
n.ctime = t.longs === String ? e.toString() : t.longs === Number ? e.toNumber() : e;
|
|
4162
|
-
} else n.ctime = t.longs === String ? "0" : 0;
|
|
4163
|
-
n.weight = 0, n.action = "", n.pool = 0, n.idStr = "", n.attr = 0, n.animation = "", n.likeNum = 0, n.colorV2 = "", n.dmTypeV2 = 0;
|
|
4164
|
-
}
|
|
4165
|
-
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;
|
|
4166
|
-
}, e.prototype.toJSON = function() {
|
|
4167
|
-
return this.constructor.toObject(this, minimal.util.toJSONOptions);
|
|
4168
|
-
}, e.getTypeUrl = function(e) {
|
|
4169
|
-
return void 0 === e && (e = "type.googleapis.com"), e + "/biliproto.community.service.dm.v1.DanmakuElem";
|
|
4170
|
-
}, e;
|
|
4171
|
-
}(), e.Flag = function() {
|
|
4172
|
-
function e(e) {
|
|
4173
|
-
if (e) for(let t = Object.keys(e), n = 0; n < t.length; ++n)null != e[t[n]] && (this[t[n]] = e[t[n]]);
|
|
4174
|
-
}
|
|
4175
|
-
return e.prototype.value = 0, e.prototype.description = "", e.create = function(t) {
|
|
4176
|
-
return new e(t);
|
|
4177
|
-
}, e.encode = function(e, t) {
|
|
4178
|
-
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;
|
|
4179
|
-
}, e.encodeDelimited = function(e, t) {
|
|
4180
|
-
return this.encode(e, t).ldelim();
|
|
4181
|
-
}, e.decode = function(e, t, n) {
|
|
4182
|
-
e instanceof $Reader || (e = $Reader.create(e));
|
|
4183
|
-
let r = void 0 === t ? e.len : e.pos + t, i = new $root.biliproto.community.service.dm.v1.Flag();
|
|
4184
|
-
for(; e.pos < r;){
|
|
4185
|
-
let t = e.uint32();
|
|
4186
|
-
if (t === n) break;
|
|
4187
|
-
switch(t >>> 3){
|
|
4188
|
-
case 1:
|
|
4189
|
-
i.value = e.int32();
|
|
4190
|
-
break;
|
|
4191
|
-
case 2:
|
|
4192
|
-
i.description = e.string();
|
|
4193
|
-
break;
|
|
4194
|
-
default:
|
|
4195
|
-
e.skipType(7 & t);
|
|
4196
|
-
}
|
|
4197
|
-
}
|
|
4198
|
-
return i;
|
|
4199
|
-
}, e.decodeDelimited = function(e) {
|
|
4200
|
-
return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
|
|
4201
|
-
}, e.verify = function(e) {
|
|
4202
|
-
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;
|
|
4203
|
-
}, e.fromObject = function(e) {
|
|
4204
|
-
if (e instanceof $root.biliproto.community.service.dm.v1.Flag) return e;
|
|
4205
|
-
let t = new $root.biliproto.community.service.dm.v1.Flag();
|
|
4206
|
-
return null != e.value && (t.value = 0 | e.value), null != e.description && (t.description = String(e.description)), t;
|
|
4207
|
-
}, e.toObject = function(e, t) {
|
|
4208
|
-
t || (t = {});
|
|
4209
|
-
let n = {};
|
|
4210
|
-
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;
|
|
4211
|
-
}, e.prototype.toJSON = function() {
|
|
4212
|
-
return this.constructor.toObject(this, minimal.util.toJSONOptions);
|
|
4213
|
-
}, e.getTypeUrl = function(e) {
|
|
4214
|
-
return void 0 === e && (e = "type.googleapis.com"), e + "/biliproto.community.service.dm.v1.Flag";
|
|
4215
|
-
}, e;
|
|
4216
|
-
}(), e.DmSegMobileReply = function() {
|
|
4217
|
-
function e(e) {
|
|
4218
|
-
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]]);
|
|
4219
|
-
}
|
|
4220
|
-
return e.prototype.elems = $util.emptyArray, e.prototype.state = 0, e.prototype.aiFlagForSummary = null, e.create = function(t) {
|
|
4221
|
-
return new e(t);
|
|
4222
|
-
}, e.encode = function(e, t) {
|
|
4223
|
-
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();
|
|
4224
|
-
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;
|
|
4225
|
-
}, e.encodeDelimited = function(e, t) {
|
|
4226
|
-
return this.encode(e, t).ldelim();
|
|
4227
|
-
}, e.decode = function(e, t, n) {
|
|
4228
|
-
e instanceof $Reader || (e = $Reader.create(e));
|
|
4229
|
-
let r = void 0 === t ? e.len : e.pos + t, i = new $root.biliproto.community.service.dm.v1.DmSegMobileReply();
|
|
4230
|
-
for(; e.pos < r;){
|
|
4231
|
-
let t = e.uint32();
|
|
4232
|
-
if (t === n) break;
|
|
4233
|
-
switch(t >>> 3){
|
|
4234
|
-
case 1:
|
|
4235
|
-
i.elems && i.elems.length || (i.elems = []), i.elems.push($root.biliproto.community.service.dm.v1.DanmakuElem.decode(e, e.uint32()));
|
|
4236
|
-
break;
|
|
4237
|
-
case 2:
|
|
4238
|
-
i.state = e.int32();
|
|
4239
|
-
break;
|
|
4240
|
-
case 3:
|
|
4241
|
-
i.aiFlagForSummary = $root.biliproto.community.service.dm.v1.Flag.decode(e, e.uint32());
|
|
4242
|
-
break;
|
|
4243
|
-
default:
|
|
4244
|
-
e.skipType(7 & t);
|
|
4245
|
-
}
|
|
4246
|
-
}
|
|
4247
|
-
return i;
|
|
4248
|
-
}, e.decodeDelimited = function(e) {
|
|
4249
|
-
return e instanceof $Reader || (e = new $Reader(e)), this.decode(e, e.uint32());
|
|
4250
|
-
}, e.verify = function(e) {
|
|
4251
|
-
if ("object" != typeof e || null === e) return "object expected";
|
|
4252
|
-
if (null != e.elems && e.hasOwnProperty("elems")) {
|
|
4253
|
-
if (!Array.isArray(e.elems)) return "elems: array expected";
|
|
4254
|
-
for(let t = 0; t < e.elems.length; ++t){
|
|
4255
|
-
let n = $root.biliproto.community.service.dm.v1.DanmakuElem.verify(e.elems[t]);
|
|
4256
|
-
if (n) return "elems." + n;
|
|
4257
|
-
}
|
|
4258
|
-
}
|
|
4259
|
-
if (null != e.state && e.hasOwnProperty("state") && !$util.isInteger(e.state)) return "state: integer expected";
|
|
4260
|
-
if (null != e.aiFlagForSummary && e.hasOwnProperty("aiFlagForSummary")) {
|
|
4261
|
-
let t = $root.biliproto.community.service.dm.v1.Flag.verify(e.aiFlagForSummary);
|
|
4262
|
-
if (t) return "aiFlagForSummary." + t;
|
|
4263
|
-
}
|
|
4264
|
-
return null;
|
|
4265
|
-
}, e.fromObject = function(e) {
|
|
4266
|
-
if (e instanceof $root.biliproto.community.service.dm.v1.DmSegMobileReply) return e;
|
|
4267
|
-
let t = new $root.biliproto.community.service.dm.v1.DmSegMobileReply();
|
|
4268
|
-
if (e.elems) {
|
|
4269
|
-
if (!Array.isArray(e.elems)) throw TypeError(".biliproto.community.service.dm.v1.DmSegMobileReply.elems: array expected");
|
|
4270
|
-
t.elems = [];
|
|
4271
|
-
for(let n = 0; n < e.elems.length; ++n){
|
|
4272
|
-
if ("object" != typeof e.elems[n]) throw TypeError(".biliproto.community.service.dm.v1.DmSegMobileReply.elems: object expected");
|
|
4273
|
-
t.elems[n] = $root.biliproto.community.service.dm.v1.DanmakuElem.fromObject(e.elems[n]);
|
|
4274
|
-
}
|
|
4275
|
-
}
|
|
4276
|
-
if (null != e.state && (t.state = 0 | e.state), null != e.aiFlagForSummary) {
|
|
4277
|
-
if ("object" != typeof e.aiFlagForSummary) throw TypeError(".biliproto.community.service.dm.v1.DmSegMobileReply.aiFlagForSummary: object expected");
|
|
4278
|
-
t.aiFlagForSummary = $root.biliproto.community.service.dm.v1.Flag.fromObject(e.aiFlagForSummary);
|
|
4279
|
-
}
|
|
4280
|
-
return t;
|
|
4281
|
-
}, e.toObject = function(e, t) {
|
|
4282
|
-
t || (t = {});
|
|
4283
|
-
let n = {};
|
|
4284
|
-
if ((t.arrays || t.defaults) && (n.elems = []), t.defaults && (n.state = 0, n.aiFlagForSummary = null), e.elems && e.elems.length) {
|
|
4285
|
-
n.elems = [];
|
|
4286
|
-
for(let r = 0; r < e.elems.length; ++r)n.elems[r] = $root.biliproto.community.service.dm.v1.DanmakuElem.toObject(e.elems[r], t);
|
|
4287
|
-
}
|
|
4288
|
-
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;
|
|
4289
|
-
}, e.prototype.toJSON = function() {
|
|
4290
|
-
return this.constructor.toObject(this, minimal.util.toJSONOptions);
|
|
4291
|
-
}, e.getTypeUrl = function(e) {
|
|
4292
|
-
return void 0 === e && (e = "type.googleapis.com"), e + "/biliproto.community.service.dm.v1.DmSegMobileReply";
|
|
4293
|
-
}, e;
|
|
4294
|
-
}(), e;
|
|
4295
|
-
}(), e;
|
|
4296
|
-
}(), e;
|
|
4297
|
-
}(), e;
|
|
4298
|
-
}(), e;
|
|
4299
|
-
})();
|
|
4284
|
+
var dm_proto = __webpack_require__("./src/scrapers/bilibili/dm.proto");
|
|
4300
4285
|
function bilibili_define_property(e, t, n) {
|
|
4301
4286
|
return t in e ? Object.defineProperty(e, t, {
|
|
4302
4287
|
value: n,
|
|
@@ -4356,22 +4341,22 @@ class BilibiliScraper extends BaseScraper {
|
|
|
4356
4341
|
async getComments(e, t) {
|
|
4357
4342
|
var n;
|
|
4358
4343
|
let { aid: r, cid: i, seasonId: o } = null != (n = this.parseIdString(e)) ? n : {};
|
|
4359
|
-
if (!r || !i || !o) return
|
|
4344
|
+
if (!r || !i || !o) return null;
|
|
4360
4345
|
let s = await this.getPgcEpisodes(o);
|
|
4361
|
-
if (!(null == s ? void 0 : s.find((e)=>e.aid === parseInt(r) && e.cid === parseInt(i)))) return
|
|
4346
|
+
if (!(null == s ? void 0 : s.find((e)=>e.aid === parseInt(r) && e.cid === parseInt(i)))) return null;
|
|
4362
4347
|
let a = await this.fetchCommentsForCid(r, i, t);
|
|
4363
|
-
return
|
|
4348
|
+
return a ? a.map((e)=>{
|
|
4364
4349
|
var t, n, r;
|
|
4365
4350
|
if (!e.progress) return null;
|
|
4366
|
-
let i = (null == (t = e.content) ? void 0 : t.replace(/\0/g, "")) || "";
|
|
4351
|
+
let i = (null == (t = e.content) ? void 0 : t.toString().replace(/\0/g, "")) || "";
|
|
4367
4352
|
return i ? {
|
|
4368
|
-
id: e.id,
|
|
4353
|
+
id: e.id.toString(),
|
|
4369
4354
|
timestamp: e.progress / 1000.0,
|
|
4370
4355
|
mode: null != (n = e.mode) ? n : 1,
|
|
4371
4356
|
color: null != (r = e.color) ? r : 16777215,
|
|
4372
4357
|
content: i
|
|
4373
4358
|
} : null;
|
|
4374
|
-
});
|
|
4359
|
+
}) : null;
|
|
4375
4360
|
}
|
|
4376
4361
|
async getPgcEpisodes(e) {
|
|
4377
4362
|
var t;
|
|
@@ -4386,21 +4371,20 @@ class BilibiliScraper extends BaseScraper {
|
|
|
4386
4371
|
})).data) ? void 0 : t.result.episodes;
|
|
4387
4372
|
}
|
|
4388
4373
|
async fetchCommentsForCid(e, t, n) {
|
|
4389
|
-
let r = [];
|
|
4390
4374
|
try {
|
|
4391
|
-
let
|
|
4375
|
+
let r = await this.fetch.get(`https://api.bilibili.com/x/v2/dm/web/seg.so?type=1&oid=${t}&pid=${e}&segment_index=${n}`, {
|
|
4392
4376
|
base64Data: !0
|
|
4393
4377
|
});
|
|
4394
|
-
if (404 ===
|
|
4395
|
-
let
|
|
4396
|
-
|
|
4378
|
+
if (404 === r.statusCode || 304 === r.statusCode) return null;
|
|
4379
|
+
let i = this.DmSegMobileReply.decode(base64ToUint8Array(r.data));
|
|
4380
|
+
return console.log(i), i.elems;
|
|
4397
4381
|
} catch (r) {
|
|
4398
4382
|
console.error(`\u{83B7}\u{53D6}\u{5206}\u{6BB5} ${n} \u{5931}\u{8D25} (aid=${e}, cid=${t}): ${r}`);
|
|
4399
4383
|
}
|
|
4400
|
-
return
|
|
4384
|
+
return null;
|
|
4401
4385
|
}
|
|
4402
4386
|
constructor(){
|
|
4403
|
-
super(), bilibili_define_property(this, "providerName", "bilibili"), bilibili_define_property(this, "idSchema", bilibiliIdSchema), bilibili_define_property(this, "DmSegMobileReply",
|
|
4387
|
+
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({
|
|
4404
4388
|
Referer: "https://www.bilibili.com/"
|
|
4405
4389
|
});
|
|
4406
4390
|
}
|
|
@@ -5203,7 +5187,9 @@ function iqiyi_define_property(e, t, n) {
|
|
|
5203
5187
|
writable: !0
|
|
5204
5188
|
}) : e[t] = n, e;
|
|
5205
5189
|
}
|
|
5206
|
-
const
|
|
5190
|
+
const iqiyiIdSchema = schemas_object({
|
|
5191
|
+
entityId: schemas_string()
|
|
5192
|
+
}), iqiyiEpisodeTabDataVideoSchema = schemas_object({
|
|
5207
5193
|
page_url: schemas_string(),
|
|
5208
5194
|
short_display_name: schemas_string(),
|
|
5209
5195
|
title: schemas_string(),
|
|
@@ -5280,18 +5266,22 @@ const iqiyiEpisodeTabDataVideoSchema = schemas_object({
|
|
|
5280
5266
|
}).transform((e)=>e.danmu.data.entry);
|
|
5281
5267
|
class IqiyiScraper extends BaseScraper {
|
|
5282
5268
|
async getEpisodes(e, t) {
|
|
5283
|
-
let n =
|
|
5269
|
+
let n = this.parseIdString(e);
|
|
5270
|
+
if (!n) return [];
|
|
5271
|
+
let r = [];
|
|
5284
5272
|
try {
|
|
5285
|
-
|
|
5273
|
+
r = await this.getEpisodesV3(n.entityId);
|
|
5286
5274
|
} catch (e) {
|
|
5287
|
-
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),
|
|
5275
|
+
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 = [];
|
|
5288
5276
|
}
|
|
5289
|
-
return !
|
|
5277
|
+
return !r.length, this.filterAndFinalizeEpisodes(r, t);
|
|
5290
5278
|
}
|
|
5291
5279
|
async getSegments(e) {
|
|
5292
|
-
let t =
|
|
5293
|
-
|
|
5294
|
-
|
|
5280
|
+
let t = this.parseIdString(e);
|
|
5281
|
+
if (!t) return [];
|
|
5282
|
+
let n = await this.getVideoBaseInfo(t.entityId), r = null == n ? void 0 : n.durationSec;
|
|
5283
|
+
return r ? Array.from({
|
|
5284
|
+
length: Math.floor(r / 300) + 1
|
|
5295
5285
|
}, (e, t)=>({
|
|
5296
5286
|
provider: this.providerName,
|
|
5297
5287
|
startTime: 300 * t,
|
|
@@ -5299,22 +5289,22 @@ class IqiyiScraper extends BaseScraper {
|
|
|
5299
5289
|
})) : [];
|
|
5300
5290
|
}
|
|
5301
5291
|
async getComments(e, t) {
|
|
5302
|
-
let n =
|
|
5303
|
-
if (!n) return
|
|
5304
|
-
let r =
|
|
5292
|
+
let n = this.parseIdString(e);
|
|
5293
|
+
if (!n) return [];
|
|
5294
|
+
let r = n.entityId;
|
|
5305
5295
|
if (!r || r.length < 4) return [];
|
|
5306
5296
|
let i = r.slice(-4, -2), o = r.slice(-2), s = `http://cmts.iqiyi.com/bullet/${i}/${o}/${r}_300_${t}.z`;
|
|
5307
5297
|
console.debug(`URL\u{6784}\u{5EFA}: s1=${i}, s2=${o}, \u{5B8C}\u{6574}URL=${s}`);
|
|
5308
5298
|
let a = await this.fetch.get(s, {
|
|
5309
5299
|
zlibMode: !0
|
|
5310
5300
|
}), u = this.xmlParser.parse(a.data), { success: l, data: c, error: d } = iqiyiCommentsResponseSchema.safeParse(u);
|
|
5311
|
-
return l ?
|
|
5301
|
+
return l ? c.map((e)=>{
|
|
5312
5302
|
let t = 16777215;
|
|
5313
5303
|
try {
|
|
5314
5304
|
t = parseInt(e.color, 16);
|
|
5315
5305
|
} catch (e) {}
|
|
5316
5306
|
return {
|
|
5317
|
-
id: e.contentId,
|
|
5307
|
+
id: e.contentId.toString(),
|
|
5318
5308
|
timestamp: e.showTime,
|
|
5319
5309
|
mode: 1,
|
|
5320
5310
|
color: t,
|
|
@@ -5363,10 +5353,11 @@ class IqiyiScraper extends BaseScraper {
|
|
|
5363
5353
|
let t = this.videoIdToEntityId(e.videoId);
|
|
5364
5354
|
t && (null != o && o.test(e.title) || (f.push({
|
|
5365
5355
|
provider: this.providerName,
|
|
5366
|
-
episodeId:
|
|
5356
|
+
episodeId: this.generateIdString({
|
|
5357
|
+
entityId: t
|
|
5358
|
+
}),
|
|
5367
5359
|
episodeTitle: e.title,
|
|
5368
|
-
episodeNumber: null != (p = this.getEpisodeIndexFromTitle(e.short_display_name)) ? p : h
|
|
5369
|
-
url: e.page_url
|
|
5360
|
+
episodeNumber: null != (p = this.getEpisodeIndexFromTitle(e.short_display_name)) ? p : h
|
|
5370
5361
|
}), h += 1));
|
|
5371
5362
|
}
|
|
5372
5363
|
}
|
|
@@ -5408,7 +5399,7 @@ class IqiyiScraper extends BaseScraper {
|
|
|
5408
5399
|
})).data) ? void 0 : t.data;
|
|
5409
5400
|
}
|
|
5410
5401
|
constructor(){
|
|
5411
|
-
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({
|
|
5402
|
+
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({
|
|
5412
5403
|
pgv_pvid: "40b67e3b06027f3d",
|
|
5413
5404
|
video_platform: "2",
|
|
5414
5405
|
vversion_name: "8.2.95",
|
|
@@ -5494,8 +5485,7 @@ class TencentScraper extends BaseScraper {
|
|
|
5494
5485
|
vid: e.vid
|
|
5495
5486
|
}),
|
|
5496
5487
|
episodeTitle: e.union_title && e.union_title !== e.title ? e.union_title : e.title,
|
|
5497
|
-
episodeNumber: r
|
|
5498
|
-
url: `https://v.qq.com/x/cover/${n.cid}/${e.vid}.html`
|
|
5488
|
+
episodeNumber: r
|
|
5499
5489
|
};
|
|
5500
5490
|
});
|
|
5501
5491
|
if (void 0 !== t) {
|
|
@@ -5539,13 +5529,13 @@ class TencentScraper extends BaseScraper {
|
|
|
5539
5529
|
let n = this.parseIdString(e);
|
|
5540
5530
|
if (!(null == n ? void 0 : n.vid)) return [];
|
|
5541
5531
|
let r = await this.internalGetComments(n.vid, t);
|
|
5542
|
-
return r && 0 !== r.length ?
|
|
5532
|
+
return r && 0 !== r.length ? r.map((e)=>{
|
|
5543
5533
|
let t = 1, n = 16777215;
|
|
5544
5534
|
if (e.content_style && (2 === e.content_style.position ? t = 5 : 3 === e.content_style.position && (t = 4), e.content_style.color)) try {
|
|
5545
5535
|
n = parseInt(e.content_style.color, 10);
|
|
5546
5536
|
} catch (e) {}
|
|
5547
5537
|
return {
|
|
5548
|
-
id: e.id,
|
|
5538
|
+
id: e.id.toString(),
|
|
5549
5539
|
timestamp: parseInt(e.time_offset, 10) / 1000.0,
|
|
5550
5540
|
mode: t,
|
|
5551
5541
|
color: n,
|
|
@@ -5626,7 +5616,10 @@ function youku_define_property(e, t, n) {
|
|
|
5626
5616
|
writable: !0
|
|
5627
5617
|
}) : e[t] = n, e;
|
|
5628
5618
|
}
|
|
5629
|
-
const
|
|
5619
|
+
const youkuIdSchema = schemas_object({
|
|
5620
|
+
showId: schemas_string(),
|
|
5621
|
+
vid: schemas_string().optional()
|
|
5622
|
+
}), youkuEpisodeInfoSchema = schemas_object({
|
|
5630
5623
|
id: schemas_string(),
|
|
5631
5624
|
title: schemas_string(),
|
|
5632
5625
|
duration: schemas_string(),
|
|
@@ -5670,66 +5663,76 @@ class YoukuScraper extends BaseScraper {
|
|
|
5670
5663
|
return null != (e = this.fetch.getCookie("cna")) ? e : "";
|
|
5671
5664
|
}
|
|
5672
5665
|
async getEpisodes(e, t) {
|
|
5673
|
-
let n =
|
|
5666
|
+
let n = this.parseIdString(e);
|
|
5667
|
+
if (!n) return [];
|
|
5668
|
+
let r = [], i = 1, o = 20, s = 0;
|
|
5674
5669
|
for(;;)try {
|
|
5675
|
-
let
|
|
5676
|
-
if (!
|
|
5677
|
-
1 ===
|
|
5678
|
-
let a =
|
|
5679
|
-
if (
|
|
5680
|
-
|
|
5681
|
-
} catch (
|
|
5682
|
-
console.error(`Youku: Failed to get episodes page ${
|
|
5670
|
+
let e = await this.getEpisodesPage(n.showId, i, o);
|
|
5671
|
+
if (!e || !e.videos || 0 === e.videos.length) break;
|
|
5672
|
+
1 === i && e.total && (s = e.total);
|
|
5673
|
+
let a = e.videos.filter((e)=>!this.EPISODE_BLACKLIST_KEYWORDS.some((t)=>e.title.includes(t)));
|
|
5674
|
+
if (r.push(...a), r.length >= s || e.videos.length < o || t && r.length >= t) break;
|
|
5675
|
+
i++, await this.sleep(300);
|
|
5676
|
+
} catch (e) {
|
|
5677
|
+
console.error(`Youku: Failed to get episodes page ${i} for media_id ${n.showId}:`, e);
|
|
5683
5678
|
break;
|
|
5684
5679
|
}
|
|
5685
|
-
let
|
|
5680
|
+
let a = r.map((e, t)=>({
|
|
5686
5681
|
provider: this.providerName,
|
|
5687
|
-
episodeId:
|
|
5682
|
+
episodeId: this.generateIdString({
|
|
5683
|
+
showId: n.showId,
|
|
5684
|
+
vid: e.id
|
|
5685
|
+
}),
|
|
5688
5686
|
episodeTitle: e.title,
|
|
5689
|
-
episodeNumber: t + 1
|
|
5690
|
-
url: e.link
|
|
5687
|
+
episodeNumber: t + 1
|
|
5691
5688
|
}));
|
|
5692
5689
|
if (void 0 !== t) {
|
|
5693
|
-
let e =
|
|
5690
|
+
let e = a.find((e)=>e.episodeNumber === t);
|
|
5694
5691
|
return e ? [
|
|
5695
5692
|
e
|
|
5696
5693
|
] : [];
|
|
5697
5694
|
}
|
|
5698
|
-
return
|
|
5695
|
+
return a;
|
|
5699
5696
|
}
|
|
5700
5697
|
async getSegments(e) {
|
|
5698
|
+
var t;
|
|
5699
|
+
let { vid: n } = null != (t = this.parseIdString(e)) ? t : {};
|
|
5700
|
+
if (!n) return [];
|
|
5701
5701
|
try {
|
|
5702
5702
|
await this.ensureTokenCookie();
|
|
5703
|
-
let
|
|
5703
|
+
let e = (await this.fetch.get("https://openapi.youku.com/v2/videos/show_basic.json", {
|
|
5704
5704
|
params: {
|
|
5705
5705
|
client_id: "53e6cc67237fc59a",
|
|
5706
5706
|
package: "com.huawei.hwvplayer.youku",
|
|
5707
|
-
video_id:
|
|
5707
|
+
video_id: n
|
|
5708
5708
|
},
|
|
5709
5709
|
schema: youkuEpisodeInfoSchema,
|
|
5710
5710
|
cache: {
|
|
5711
|
-
cacheKey: `youku:segments:${
|
|
5711
|
+
cacheKey: `youku:segments:${n}`
|
|
5712
5712
|
}
|
|
5713
5713
|
})).data;
|
|
5714
|
-
if (!
|
|
5715
|
-
let
|
|
5716
|
-
if (0 ===
|
|
5714
|
+
if (!e) return console.warn(`Youku: Failed to get episode info for vid ${n}`), [];
|
|
5715
|
+
let t = e.totalMat;
|
|
5716
|
+
if (0 === t) return console.warn(`Youku: Video ${n} has duration 0, no danmaku to fetch.`), [];
|
|
5717
5717
|
return Array.from({
|
|
5718
|
-
length:
|
|
5718
|
+
length: t
|
|
5719
5719
|
}, (e, t)=>({
|
|
5720
5720
|
provider: this.providerName,
|
|
5721
5721
|
startTime: 60 * t,
|
|
5722
5722
|
segmentId: t.toString()
|
|
5723
5723
|
}));
|
|
5724
|
-
} catch (
|
|
5725
|
-
return console.error(`Youku: Failed to get segments for vid ${
|
|
5724
|
+
} catch (e) {
|
|
5725
|
+
return console.error(`Youku: Failed to get segments for vid ${n}:`, e), [];
|
|
5726
5726
|
}
|
|
5727
5727
|
}
|
|
5728
5728
|
async getComments(e, t) {
|
|
5729
|
+
var n;
|
|
5730
|
+
let { vid: r } = null != (n = this.parseIdString(e)) ? n : {};
|
|
5731
|
+
if (!r) return [];
|
|
5729
5732
|
try {
|
|
5730
|
-
return await this.ensureTokenCookie(), this.getDanmuContentByMat(
|
|
5731
|
-
} catch (
|
|
5732
|
-
return console.error(`Youku: Failed to get danmaku for vid ${
|
|
5733
|
+
return await this.ensureTokenCookie(), this.getDanmuContentByMat(r, parseInt(t, 10));
|
|
5734
|
+
} catch (e) {
|
|
5735
|
+
return console.error(`Youku: Failed to get danmaku for vid ${r}:`, e), [];
|
|
5733
5736
|
}
|
|
5734
5737
|
}
|
|
5735
5738
|
async getEpisodesPage(e, t, n) {
|
|
@@ -5795,7 +5798,7 @@ class YoukuScraper extends BaseScraper {
|
|
|
5795
5798
|
})
|
|
5796
5799
|
})).data) || null == (u = l.data.result) ? void 0 : u.data.result) ? c : [];
|
|
5797
5800
|
if (console.log(`Youku: \u{83B7}\u{53D6}\u{5230}\u{5206}\u{6BB5} ${t} \u{7684}\u{5F39}\u{5E55} ${e.length} \u{6761}`), !e || 0 === e.length) return [];
|
|
5798
|
-
return
|
|
5801
|
+
return e.map((e)=>{
|
|
5799
5802
|
let t = 1, n = 16777215;
|
|
5800
5803
|
try {
|
|
5801
5804
|
let r = e.propertis;
|
|
@@ -5826,26 +5829,34 @@ class YoukuScraper extends BaseScraper {
|
|
|
5826
5829
|
].join("&")).toString().toLowerCase();
|
|
5827
5830
|
}
|
|
5828
5831
|
async ensureTokenCookie() {
|
|
5829
|
-
|
|
5830
|
-
|
|
5832
|
+
this.fetch.cookie = {};
|
|
5833
|
+
try {
|
|
5834
|
+
await this.fetch.get("https://log.mmstat.com/eg.js", {
|
|
5835
|
+
headers: {
|
|
5836
|
+
Cookie: "",
|
|
5837
|
+
"If-None-Match": ""
|
|
5838
|
+
}
|
|
5839
|
+
});
|
|
5831
5840
|
} catch (e) {
|
|
5832
5841
|
console.warn(`Youku: \u{65E0}\u{6CD5}\u{8FDE}\u{63A5}\u{5230} youku.com \u{83B7}\u{53D6} 'cna' cookie\u{3002}\u{9519}\u{8BEF}: ${e}`);
|
|
5833
5842
|
}
|
|
5834
|
-
|
|
5835
|
-
|
|
5843
|
+
try {
|
|
5844
|
+
await this.fetch.get("https://acs.youku.com/h5/mtop.com.youku.aplatform.weakget/1.0/?jsv=2.5.1&appKey=24679788");
|
|
5836
5845
|
} catch (e) {
|
|
5837
5846
|
console.error(`Youku: \u{65E0}\u{6CD5}\u{8FDE}\u{63A5}\u{5230} acs.youku.com \u{83B7}\u{53D6}\u{4EE4}\u{724C} cookie\u{3002}\u{5F39}\u{5E55}\u{83B7}\u{53D6}\u{5F88}\u{53EF}\u{80FD}\u{4F1A}\u{5931}\u{8D25}\u{3002}\u{9519}\u{8BEF}: ${e}`);
|
|
5838
5847
|
}
|
|
5839
5848
|
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}'`);
|
|
5840
5849
|
}
|
|
5841
|
-
constructor(
|
|
5842
|
-
super(
|
|
5850
|
+
constructor(){
|
|
5851
|
+
super(), youku_define_property(this, "providerName", "youku"), youku_define_property(this, "idSchema", youkuIdSchema), youku_define_property(this, "EPISODE_BLACKLIST_KEYWORDS", [
|
|
5843
5852
|
"\u5F69\u86CB",
|
|
5844
5853
|
"\u52A0\u66F4",
|
|
5845
5854
|
"\u8D70\u5FC3",
|
|
5846
5855
|
"\u89E3\u5FE7",
|
|
5847
5856
|
"\u7EAF\u4EAB"
|
|
5848
|
-
])
|
|
5857
|
+
]), this.fetch.setHeaders({
|
|
5858
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36"
|
|
5859
|
+
});
|
|
5849
5860
|
}
|
|
5850
5861
|
}
|
|
5851
5862
|
function scrapers_define_property(e, t, n) {
|
|
@@ -5887,23 +5898,48 @@ class scrapers_Scraper {
|
|
|
5887
5898
|
}
|
|
5888
5899
|
async getSegmentWithTime() {
|
|
5889
5900
|
let e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
|
|
5890
|
-
for(var t = arguments.length,
|
|
5891
|
-
let
|
|
5892
|
-
for (let { provider: t,
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
|
|
5897
|
-
|
|
5901
|
+
for(var t, n = arguments.length, r = Array(n > 1 ? n - 1 : 0), i = 1; i < n; i++)r[i - 1] = arguments[i];
|
|
5902
|
+
let o = [];
|
|
5903
|
+
for (let { provider: t, idString: n } of r)o.push((async ()=>{
|
|
5904
|
+
let r = await this.getSegmentsByProvider(t, n);
|
|
5905
|
+
if (!r.length) return null;
|
|
5906
|
+
let i = this.findSegmentAtTime(r, e);
|
|
5907
|
+
if (!i) return null;
|
|
5908
|
+
let o = this.scraperMap[t];
|
|
5909
|
+
return o ? {
|
|
5910
|
+
comments: await o.getComments(n, i.segmentId),
|
|
5911
|
+
provider: t
|
|
5912
|
+
} : null;
|
|
5898
5913
|
})());
|
|
5899
|
-
|
|
5914
|
+
let s = await Promise.all(o), a = new Map();
|
|
5915
|
+
for (let e of s)if (null == e || null == (t = e.comments) ? void 0 : t.length) for (let t of e.comments){
|
|
5916
|
+
if (!t) continue;
|
|
5917
|
+
let n = [
|
|
5918
|
+
t.mode,
|
|
5919
|
+
t.color,
|
|
5920
|
+
t.content
|
|
5921
|
+
].join("___"), r = a.get(n);
|
|
5922
|
+
r ? (t.timestamp < r.item.timestamp && (r.item = t), r.count += 1) : a.set(n, {
|
|
5923
|
+
item: t,
|
|
5924
|
+
count: 1,
|
|
5925
|
+
provider: e.provider
|
|
5926
|
+
});
|
|
5927
|
+
}
|
|
5928
|
+
let u = [];
|
|
5929
|
+
return a.forEach((e)=>{
|
|
5930
|
+
let { item: t, count: n, provider: r } = e, i = n > 1 ? `${t.content} \xd7 ${n}` : t.content;
|
|
5931
|
+
u.push({
|
|
5932
|
+
p: `${t.timestamp.toFixed(2)},${t.mode},${t.color},[${r}]`,
|
|
5933
|
+
m: i
|
|
5934
|
+
});
|
|
5935
|
+
}), u;
|
|
5900
5936
|
}
|
|
5901
5937
|
getDanmuWithSegmentTimeByVideoId(e, t) {
|
|
5902
5938
|
let n = e.split(",").map((e)=>{
|
|
5903
5939
|
let [t, n] = e.split(":");
|
|
5904
5940
|
return {
|
|
5905
5941
|
provider: t,
|
|
5906
|
-
|
|
5942
|
+
idString: n
|
|
5907
5943
|
};
|
|
5908
5944
|
});
|
|
5909
5945
|
return this.getSegmentWithTime(t, ...n);
|
|
@@ -5911,7 +5947,7 @@ class scrapers_Scraper {
|
|
|
5911
5947
|
async getEpisodes() {
|
|
5912
5948
|
for(var e = arguments.length, t = Array(e), n = 0; n < e; n++)t[n] = arguments[n];
|
|
5913
5949
|
let r = [];
|
|
5914
|
-
for (let { provider: e,
|
|
5950
|
+
for (let { provider: e, idString: n } of t){
|
|
5915
5951
|
let t = this.scraperMap[e];
|
|
5916
5952
|
t && r.push(t.getEpisodes(n).catch((e)=>(console.error(e), [])));
|
|
5917
5953
|
}
|
|
@@ -5927,17 +5963,18 @@ class scrapers_Scraper {
|
|
|
5927
5963
|
async getDetailWithAnimeId(e, t, n) {
|
|
5928
5964
|
let [r, i] = e.split(":"), o = await this.getEpisodes({
|
|
5929
5965
|
provider: r,
|
|
5930
|
-
|
|
5966
|
+
idString: i
|
|
5931
5967
|
});
|
|
5932
5968
|
return this.formatEpisodeResult(o, t, n);
|
|
5933
5969
|
}
|
|
5934
5970
|
async getDetailWithDoubanId(e, t, n) {
|
|
5935
5971
|
let r = await getVideoPlatformInfoByDoubanId(e.toString()), i = [];
|
|
5936
5972
|
Object.entries(r.providers).forEach((e)=>{
|
|
5937
|
-
|
|
5973
|
+
var t, n;
|
|
5974
|
+
let [r, o] = e;
|
|
5938
5975
|
i.push({
|
|
5939
|
-
provider:
|
|
5940
|
-
|
|
5976
|
+
provider: r,
|
|
5977
|
+
idString: null != (n = null == (t = this.scraperMap[r]) ? void 0 : t.generateIdString(o)) ? n : ""
|
|
5941
5978
|
});
|
|
5942
5979
|
});
|
|
5943
5980
|
let o = await this.getEpisodes(...i);
|
|
@@ -5954,7 +5991,7 @@ WidgetMetadata = {
|
|
|
5954
5991
|
title: "\u901A\u7528\u5F39\u5E55",
|
|
5955
5992
|
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",
|
|
5956
5993
|
author: "Baran",
|
|
5957
|
-
version: "0.0.
|
|
5994
|
+
version: "0.0.5",
|
|
5958
5995
|
site: "https://github.com/baranwang/forward-widgets/tree/main/packages/danmu-universe",
|
|
5959
5996
|
requiredVersion: "0.0.2",
|
|
5960
5997
|
modules: [
|