@forward-widget/danmu-universe 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -6
- package/dist/danmu-universe.js +356 -328
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -3,19 +3,25 @@
|
|
|
3
3
|
[](https://www.npmjs.com/package/@forward-widget/danmu-universe)
|
|
4
4
|
[](https://github.com/baranwang/forward-widgets)
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
一个通用的弹幕聚合插件,支持从多个主流视频平台获取弹幕数据,为 Forward 生态系统提供跨平台的弹幕服务
|
|
7
7
|
|
|
8
8
|
## 支持的平台
|
|
9
9
|
|
|
10
|
-
- 腾讯视频
|
|
11
|
-
- 优酷视频
|
|
12
|
-
- 爱奇艺
|
|
13
|
-
- 哔哩哔哩
|
|
10
|
+
- [x] 腾讯视频
|
|
11
|
+
- [x] 优酷视频
|
|
12
|
+
- [x] 爱奇艺
|
|
13
|
+
- [x] 哔哩哔哩
|
|
14
|
+
- [ ] 芒果 TV
|
|
15
|
+
- [ ] 人人视频
|
|
14
16
|
|
|
15
17
|
|
|
16
18
|
## 安装使用
|
|
17
19
|
|
|
18
|
-
###
|
|
20
|
+
### 一键安装
|
|
21
|
+
|
|
22
|
+
[](forward://widget?url=https%3A%2F%2Funpkg.com%2F%40forward-widget%2Fdanmu-universe)
|
|
23
|
+
|
|
24
|
+
### 手动安装
|
|
19
25
|
|
|
20
26
|
在Forward Widget的模块管理中导入以下URL:
|
|
21
27
|
|
|
@@ -23,6 +29,7 @@
|
|
|
23
29
|
https://unpkg.com/@forward-widget/danmu-universe
|
|
24
30
|
```
|
|
25
31
|
|
|
32
|
+
|
|
26
33
|
## 开发
|
|
27
34
|
|
|
28
35
|
欢迎社区贡献,如果你想为项目做出贡献
|
|
@@ -55,3 +62,7 @@ pnpm build
|
|
|
55
62
|
```bash
|
|
56
63
|
pnpm test
|
|
57
64
|
```
|
|
65
|
+
|
|
66
|
+
## 鸣谢
|
|
67
|
+
|
|
68
|
+
- [misaka_danmu_server](https://github.com/l429609201/misaka_danmu_server)
|
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
|
}
|
|
@@ -3917,21 +4168,17 @@ const getExternalIdsByTmdbId = async (e, t)=>{
|
|
|
3917
4168
|
case "qq":
|
|
3918
4169
|
{
|
|
3919
4170
|
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
|
-
}
|
|
4171
|
+
e && (o.providers.tencent = {
|
|
4172
|
+
cid: e,
|
|
4173
|
+
vid: n
|
|
4174
|
+
});
|
|
3928
4175
|
break;
|
|
3929
4176
|
}
|
|
3930
4177
|
case "iqiyi":
|
|
3931
4178
|
{
|
|
3932
4179
|
let { tvid: e } = t.query;
|
|
3933
4180
|
e && (o.providers.iqiyi = {
|
|
3934
|
-
|
|
4181
|
+
entityId: e
|
|
3935
4182
|
});
|
|
3936
4183
|
break;
|
|
3937
4184
|
}
|
|
@@ -3939,7 +4186,7 @@ const getExternalIdsByTmdbId = async (e, t)=>{
|
|
|
3939
4186
|
{
|
|
3940
4187
|
let { showid: e } = t.query;
|
|
3941
4188
|
e && (o.providers.youku = {
|
|
3942
|
-
|
|
4189
|
+
showId: e
|
|
3943
4190
|
});
|
|
3944
4191
|
break;
|
|
3945
4192
|
}
|
|
@@ -3947,9 +4194,7 @@ const getExternalIdsByTmdbId = async (e, t)=>{
|
|
|
3947
4194
|
{
|
|
3948
4195
|
let e = t.pathname.split("/").pop();
|
|
3949
4196
|
e && /\d+/.test(e) && (o.providers.bilibili = {
|
|
3950
|
-
|
|
3951
|
-
seasonId: e
|
|
3952
|
-
}))
|
|
4197
|
+
seasonId: e
|
|
3953
4198
|
});
|
|
3954
4199
|
}
|
|
3955
4200
|
}
|
|
@@ -4056,247 +4301,7 @@ class BaseScraper {
|
|
|
4056
4301
|
base_define_property(this, "idSchema", void 0), base_define_property(this, "fetch", new Fetch()), base_define_property(this, "GLOBAL_EPISODE_BLACKLIST_DEFAULT", "^(.*?)((.+?\u7248)|(\u7279(\u522B|\u5178))|((\u5BFC|\u6F14)\u5458|\u5609\u5BBE|\u89D2\u8272)\u8BBF\u8C08|\u798F\u5229|\u5148\u5BFC|\u5F69\u86CB|\u82B1\u7D6E|\u9884\u544A|\u7279\u8F91|\u4E13\u8BBF|\u8BBF\u8C08|\u5E55\u540E|\u5468\u8FB9|\u8D44\u8BAF|\u770B\u70B9|\u901F\u770B|\u56DE\u987E|\u76D8\u70B9|\u5408\u96C6|PV|MV|CM|OST|ED|OP|BD|\u7279\u5178|SP|NCOP|NCED|MENU|Web-DL|rip|x264|x265|aac|flac)(.*?)$"), base_define_property(this, "PROVIDER_SPECIFIC_BLACKLIST_DEFAULT", "");
|
|
4057
4302
|
}
|
|
4058
4303
|
}
|
|
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
|
-
})();
|
|
4304
|
+
var dm_proto = __webpack_require__("./src/scrapers/bilibili/dm.proto");
|
|
4300
4305
|
function bilibili_define_property(e, t, n) {
|
|
4301
4306
|
return t in e ? Object.defineProperty(e, t, {
|
|
4302
4307
|
value: n,
|
|
@@ -4363,7 +4368,7 @@ class BilibiliScraper extends BaseScraper {
|
|
|
4363
4368
|
return this.formatComments(a, (e)=>{
|
|
4364
4369
|
var t, n, r;
|
|
4365
4370
|
if (!e.progress) return null;
|
|
4366
|
-
let i = (null == (t = e.content) ? void 0 : t.replace(/\0/g, "")) || "";
|
|
4371
|
+
let i = (null == (t = e.content) ? void 0 : t.toString().replace(/\0/g, "")) || "";
|
|
4367
4372
|
return i ? {
|
|
4368
4373
|
id: e.id,
|
|
4369
4374
|
timestamp: e.progress / 1000.0,
|
|
@@ -4400,7 +4405,7 @@ class BilibiliScraper extends BaseScraper {
|
|
|
4400
4405
|
return r;
|
|
4401
4406
|
}
|
|
4402
4407
|
constructor(){
|
|
4403
|
-
super(), bilibili_define_property(this, "providerName", "bilibili"), bilibili_define_property(this, "idSchema", bilibiliIdSchema), bilibili_define_property(this, "DmSegMobileReply",
|
|
4408
|
+
super(), bilibili_define_property(this, "providerName", "bilibili"), bilibili_define_property(this, "idSchema", bilibiliIdSchema), bilibili_define_property(this, "DmSegMobileReply", dm_proto.biliproto.community.service.dm.v1.DmSegMobileReply), this.fetch.setHeaders({
|
|
4404
4409
|
Referer: "https://www.bilibili.com/"
|
|
4405
4410
|
});
|
|
4406
4411
|
}
|
|
@@ -5203,7 +5208,9 @@ function iqiyi_define_property(e, t, n) {
|
|
|
5203
5208
|
writable: !0
|
|
5204
5209
|
}) : e[t] = n, e;
|
|
5205
5210
|
}
|
|
5206
|
-
const
|
|
5211
|
+
const iqiyiIdSchema = schemas_object({
|
|
5212
|
+
entityId: schemas_string()
|
|
5213
|
+
}), iqiyiEpisodeTabDataVideoSchema = schemas_object({
|
|
5207
5214
|
page_url: schemas_string(),
|
|
5208
5215
|
short_display_name: schemas_string(),
|
|
5209
5216
|
title: schemas_string(),
|
|
@@ -5280,18 +5287,22 @@ const iqiyiEpisodeTabDataVideoSchema = schemas_object({
|
|
|
5280
5287
|
}).transform((e)=>e.danmu.data.entry);
|
|
5281
5288
|
class IqiyiScraper extends BaseScraper {
|
|
5282
5289
|
async getEpisodes(e, t) {
|
|
5283
|
-
let n =
|
|
5290
|
+
let n = this.parseIdString(e);
|
|
5291
|
+
if (!n) return [];
|
|
5292
|
+
let r = [];
|
|
5284
5293
|
try {
|
|
5285
|
-
|
|
5294
|
+
r = await this.getEpisodesV3(n.entityId);
|
|
5286
5295
|
} 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),
|
|
5296
|
+
console.warn(`\u{7231}\u{5947}\u{827A}: \u{65B0}\u{7248}API (v3) \u{83B7}\u{53D6}\u{5206}\u{96C6}\u{65F6}\u{53D1}\u{751F}\u{9519}\u{8BEF}: ${e}`, e), r = [];
|
|
5288
5297
|
}
|
|
5289
|
-
return !
|
|
5298
|
+
return !r.length, this.filterAndFinalizeEpisodes(r, t);
|
|
5290
5299
|
}
|
|
5291
5300
|
async getSegments(e) {
|
|
5292
|
-
let t =
|
|
5293
|
-
|
|
5294
|
-
|
|
5301
|
+
let t = this.parseIdString(e);
|
|
5302
|
+
if (!t) return [];
|
|
5303
|
+
let n = await this.getVideoBaseInfo(t.entityId), r = null == n ? void 0 : n.durationSec;
|
|
5304
|
+
return r ? Array.from({
|
|
5305
|
+
length: Math.floor(r / 300) + 1
|
|
5295
5306
|
}, (e, t)=>({
|
|
5296
5307
|
provider: this.providerName,
|
|
5297
5308
|
startTime: 300 * t,
|
|
@@ -5299,9 +5310,9 @@ class IqiyiScraper extends BaseScraper {
|
|
|
5299
5310
|
})) : [];
|
|
5300
5311
|
}
|
|
5301
5312
|
async getComments(e, t) {
|
|
5302
|
-
let n =
|
|
5303
|
-
if (!n) return
|
|
5304
|
-
let r =
|
|
5313
|
+
let n = this.parseIdString(e);
|
|
5314
|
+
if (!n) return [];
|
|
5315
|
+
let r = n.entityId;
|
|
5305
5316
|
if (!r || r.length < 4) return [];
|
|
5306
5317
|
let i = r.slice(-4, -2), o = r.slice(-2), s = `http://cmts.iqiyi.com/bullet/${i}/${o}/${r}_300_${t}.z`;
|
|
5307
5318
|
console.debug(`URL\u{6784}\u{5EFA}: s1=${i}, s2=${o}, \u{5B8C}\u{6574}URL=${s}`);
|
|
@@ -5363,7 +5374,9 @@ class IqiyiScraper extends BaseScraper {
|
|
|
5363
5374
|
let t = this.videoIdToEntityId(e.videoId);
|
|
5364
5375
|
t && (null != o && o.test(e.title) || (f.push({
|
|
5365
5376
|
provider: this.providerName,
|
|
5366
|
-
episodeId:
|
|
5377
|
+
episodeId: this.generateIdString({
|
|
5378
|
+
entityId: t
|
|
5379
|
+
}),
|
|
5367
5380
|
episodeTitle: e.title,
|
|
5368
5381
|
episodeNumber: null != (p = this.getEpisodeIndexFromTitle(e.short_display_name)) ? p : h,
|
|
5369
5382
|
url: e.page_url
|
|
@@ -5408,7 +5421,7 @@ class IqiyiScraper extends BaseScraper {
|
|
|
5408
5421
|
})).data) ? void 0 : t.data;
|
|
5409
5422
|
}
|
|
5410
5423
|
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({
|
|
5424
|
+
super(), iqiyi_define_property(this, "providerName", "iqiyi"), iqiyi_define_property(this, "xmlParser", new XMLParser()), iqiyi_define_property(this, "idSchema", iqiyiIdSchema), iqiyi_define_property(this, "PROVIDER_SPECIFIC_BLACKLIST_DEFAULT", "^(.*?)(\u62A2\u5148(\u7248|\u7BC7)?|\u52A0\u66F4(\u7248|\u7BC7)?|\u82B1\u7D6E|\u9884\u544A|\u7279\u8F91|\u5F69\u86CB|\u4E13\u8BBF|\u5E55\u540E(\u6545\u4E8B|\u82B1\u7D6E)?|\u76F4\u64AD|\u7EAF\u4EAB|\u672A\u64AD|\u884D\u751F|\u756A\u5916|\u4F1A\u5458(\u4E13\u5C5E|\u52A0\u957F)?|\u7247\u82B1|\u7CBE\u534E|\u770B\u70B9|\u901F\u89C8|\u89E3\u8BFB|reaction|\u5F71\u8BC4)(.*?)$"), this.fetch.setCookie({
|
|
5412
5425
|
pgv_pvid: "40b67e3b06027f3d",
|
|
5413
5426
|
video_platform: "2",
|
|
5414
5427
|
vversion_name: "8.2.95",
|
|
@@ -5626,7 +5639,10 @@ function youku_define_property(e, t, n) {
|
|
|
5626
5639
|
writable: !0
|
|
5627
5640
|
}) : e[t] = n, e;
|
|
5628
5641
|
}
|
|
5629
|
-
const
|
|
5642
|
+
const youkuIdSchema = schemas_object({
|
|
5643
|
+
showId: schemas_string(),
|
|
5644
|
+
vid: schemas_string().optional()
|
|
5645
|
+
}), youkuEpisodeInfoSchema = schemas_object({
|
|
5630
5646
|
id: schemas_string(),
|
|
5631
5647
|
title: schemas_string(),
|
|
5632
5648
|
duration: schemas_string(),
|
|
@@ -5670,66 +5686,77 @@ class YoukuScraper extends BaseScraper {
|
|
|
5670
5686
|
return null != (e = this.fetch.getCookie("cna")) ? e : "";
|
|
5671
5687
|
}
|
|
5672
5688
|
async getEpisodes(e, t) {
|
|
5673
|
-
let n =
|
|
5689
|
+
let n = this.parseIdString(e);
|
|
5690
|
+
if (!n) return [];
|
|
5691
|
+
let r = [], i = 1, o = 20, s = 0;
|
|
5674
5692
|
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 ${
|
|
5693
|
+
let e = await this.getEpisodesPage(n.showId, i, o);
|
|
5694
|
+
if (!e || !e.videos || 0 === e.videos.length) break;
|
|
5695
|
+
1 === i && e.total && (s = e.total);
|
|
5696
|
+
let a = e.videos.filter((e)=>!this.EPISODE_BLACKLIST_KEYWORDS.some((t)=>e.title.includes(t)));
|
|
5697
|
+
if (r.push(...a), r.length >= s || e.videos.length < o || t && r.length >= t) break;
|
|
5698
|
+
i++, await this.sleep(300);
|
|
5699
|
+
} catch (e) {
|
|
5700
|
+
console.error(`Youku: Failed to get episodes page ${i} for media_id ${n.showId}:`, e);
|
|
5683
5701
|
break;
|
|
5684
5702
|
}
|
|
5685
|
-
let
|
|
5703
|
+
let a = r.map((e, t)=>({
|
|
5686
5704
|
provider: this.providerName,
|
|
5687
|
-
episodeId:
|
|
5705
|
+
episodeId: this.generateIdString({
|
|
5706
|
+
showId: n.showId,
|
|
5707
|
+
vid: e.id
|
|
5708
|
+
}),
|
|
5688
5709
|
episodeTitle: e.title,
|
|
5689
5710
|
episodeNumber: t + 1,
|
|
5690
5711
|
url: e.link
|
|
5691
5712
|
}));
|
|
5692
5713
|
if (void 0 !== t) {
|
|
5693
|
-
let e =
|
|
5714
|
+
let e = a.find((e)=>e.episodeNumber === t);
|
|
5694
5715
|
return e ? [
|
|
5695
5716
|
e
|
|
5696
5717
|
] : [];
|
|
5697
5718
|
}
|
|
5698
|
-
return
|
|
5719
|
+
return a;
|
|
5699
5720
|
}
|
|
5700
5721
|
async getSegments(e) {
|
|
5722
|
+
var t;
|
|
5723
|
+
let { vid: n } = null != (t = this.parseIdString(e)) ? t : {};
|
|
5724
|
+
if (!n) return [];
|
|
5701
5725
|
try {
|
|
5702
5726
|
await this.ensureTokenCookie();
|
|
5703
|
-
let
|
|
5727
|
+
let e = (await this.fetch.get("https://openapi.youku.com/v2/videos/show_basic.json", {
|
|
5704
5728
|
params: {
|
|
5705
5729
|
client_id: "53e6cc67237fc59a",
|
|
5706
5730
|
package: "com.huawei.hwvplayer.youku",
|
|
5707
|
-
video_id:
|
|
5731
|
+
video_id: n
|
|
5708
5732
|
},
|
|
5709
5733
|
schema: youkuEpisodeInfoSchema,
|
|
5710
5734
|
cache: {
|
|
5711
|
-
cacheKey: `youku:segments:${
|
|
5735
|
+
cacheKey: `youku:segments:${n}`
|
|
5712
5736
|
}
|
|
5713
5737
|
})).data;
|
|
5714
|
-
if (!
|
|
5715
|
-
let
|
|
5716
|
-
if (0 ===
|
|
5738
|
+
if (!e) return console.warn(`Youku: Failed to get episode info for vid ${n}`), [];
|
|
5739
|
+
let t = e.totalMat;
|
|
5740
|
+
if (0 === t) return console.warn(`Youku: Video ${n} has duration 0, no danmaku to fetch.`), [];
|
|
5717
5741
|
return Array.from({
|
|
5718
|
-
length:
|
|
5742
|
+
length: t
|
|
5719
5743
|
}, (e, t)=>({
|
|
5720
5744
|
provider: this.providerName,
|
|
5721
5745
|
startTime: 60 * t,
|
|
5722
5746
|
segmentId: t.toString()
|
|
5723
5747
|
}));
|
|
5724
|
-
} catch (
|
|
5725
|
-
return console.error(`Youku: Failed to get segments for vid ${
|
|
5748
|
+
} catch (e) {
|
|
5749
|
+
return console.error(`Youku: Failed to get segments for vid ${n}:`, e), [];
|
|
5726
5750
|
}
|
|
5727
5751
|
}
|
|
5728
5752
|
async getComments(e, t) {
|
|
5753
|
+
var n;
|
|
5754
|
+
let { vid: r } = null != (n = this.parseIdString(e)) ? n : {};
|
|
5755
|
+
if (!r) return [];
|
|
5729
5756
|
try {
|
|
5730
|
-
return await this.ensureTokenCookie(), this.getDanmuContentByMat(
|
|
5731
|
-
} catch (
|
|
5732
|
-
return console.error(`Youku: Failed to get danmaku for vid ${
|
|
5757
|
+
return await this.ensureTokenCookie(), this.getDanmuContentByMat(r, parseInt(t, 10));
|
|
5758
|
+
} catch (e) {
|
|
5759
|
+
return console.error(`Youku: Failed to get danmaku for vid ${r}:`, e), [];
|
|
5733
5760
|
}
|
|
5734
5761
|
}
|
|
5735
5762
|
async getEpisodesPage(e, t, n) {
|
|
@@ -5839,7 +5866,7 @@ class YoukuScraper extends BaseScraper {
|
|
|
5839
5866
|
this.cna && this.token || console.warn(`Youku: \u{672A}\u{80FD}\u{83B7}\u{53D6}\u{5230}\u{5F39}\u{5E55}\u{7B7E}\u{540D}\u{6240}\u{9700}\u{7684}\u{5168}\u{90E8} cookie\u{3002} cna: '${this.cna}', token: '${this.token}'`);
|
|
5840
5867
|
}
|
|
5841
5868
|
constructor(...e){
|
|
5842
|
-
super(...e), youku_define_property(this, "providerName", "youku"), youku_define_property(this, "EPISODE_BLACKLIST_KEYWORDS", [
|
|
5869
|
+
super(...e), youku_define_property(this, "providerName", "youku"), youku_define_property(this, "idSchema", youkuIdSchema), youku_define_property(this, "EPISODE_BLACKLIST_KEYWORDS", [
|
|
5843
5870
|
"\u5F69\u86CB",
|
|
5844
5871
|
"\u52A0\u66F4",
|
|
5845
5872
|
"\u8D70\u5FC3",
|
|
@@ -5889,7 +5916,7 @@ class scrapers_Scraper {
|
|
|
5889
5916
|
let e = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : 0;
|
|
5890
5917
|
for(var t = arguments.length, n = Array(t > 1 ? t - 1 : 0), r = 1; r < t; r++)n[r - 1] = arguments[r];
|
|
5891
5918
|
let i = [];
|
|
5892
|
-
for (let { provider: t,
|
|
5919
|
+
for (let { provider: t, idString: r } of n)i.push((async ()=>{
|
|
5893
5920
|
var n;
|
|
5894
5921
|
let i = await this.getSegmentsByProvider(t, r);
|
|
5895
5922
|
if (!i.length) return [];
|
|
@@ -5903,7 +5930,7 @@ class scrapers_Scraper {
|
|
|
5903
5930
|
let [t, n] = e.split(":");
|
|
5904
5931
|
return {
|
|
5905
5932
|
provider: t,
|
|
5906
|
-
|
|
5933
|
+
idString: n
|
|
5907
5934
|
};
|
|
5908
5935
|
});
|
|
5909
5936
|
return this.getSegmentWithTime(t, ...n);
|
|
@@ -5911,7 +5938,7 @@ class scrapers_Scraper {
|
|
|
5911
5938
|
async getEpisodes() {
|
|
5912
5939
|
for(var e = arguments.length, t = Array(e), n = 0; n < e; n++)t[n] = arguments[n];
|
|
5913
5940
|
let r = [];
|
|
5914
|
-
for (let { provider: e,
|
|
5941
|
+
for (let { provider: e, idString: n } of t){
|
|
5915
5942
|
let t = this.scraperMap[e];
|
|
5916
5943
|
t && r.push(t.getEpisodes(n).catch((e)=>(console.error(e), [])));
|
|
5917
5944
|
}
|
|
@@ -5927,17 +5954,18 @@ class scrapers_Scraper {
|
|
|
5927
5954
|
async getDetailWithAnimeId(e, t, n) {
|
|
5928
5955
|
let [r, i] = e.split(":"), o = await this.getEpisodes({
|
|
5929
5956
|
provider: r,
|
|
5930
|
-
|
|
5957
|
+
idString: i
|
|
5931
5958
|
});
|
|
5932
5959
|
return this.formatEpisodeResult(o, t, n);
|
|
5933
5960
|
}
|
|
5934
5961
|
async getDetailWithDoubanId(e, t, n) {
|
|
5935
5962
|
let r = await getVideoPlatformInfoByDoubanId(e.toString()), i = [];
|
|
5936
5963
|
Object.entries(r.providers).forEach((e)=>{
|
|
5937
|
-
|
|
5964
|
+
var t, n;
|
|
5965
|
+
let [r, o] = e;
|
|
5938
5966
|
i.push({
|
|
5939
|
-
provider:
|
|
5940
|
-
|
|
5967
|
+
provider: r,
|
|
5968
|
+
idString: null != (n = null == (t = this.scraperMap[r]) ? void 0 : t.generateIdString(o)) ? n : ""
|
|
5941
5969
|
});
|
|
5942
5970
|
});
|
|
5943
5971
|
let o = await this.getEpisodes(...i);
|
|
@@ -5954,7 +5982,7 @@ WidgetMetadata = {
|
|
|
5954
5982
|
title: "\u901A\u7528\u5F39\u5E55",
|
|
5955
5983
|
description: "\u901A\u7528\u5F39\u5E55\u63D2\u4EF6\uFF0C\u652F\u6301\u817E\u8BAF\u3001\u4F18\u9177\u3001\u7231\u5947\u827A\u3001\u54D4\u54E9\u54D4\u54E9\u7B49\u5E73\u53F0",
|
|
5956
5984
|
author: "Baran",
|
|
5957
|
-
version: "0.0.
|
|
5985
|
+
version: "0.0.4",
|
|
5958
5986
|
site: "https://github.com/baranwang/forward-widgets/tree/main/packages/danmu-universe",
|
|
5959
5987
|
requiredVersion: "0.0.2",
|
|
5960
5988
|
modules: [
|
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.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/danmu-universe.js",
|
|
6
6
|
"exports": {
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"@types/node": "^22.16.0",
|
|
28
28
|
"@types/url-parse": "^1.4.11",
|
|
29
29
|
"protobufjs-cli": "^1.1.3",
|
|
30
|
+
"rsbuild-plugin-protobufjs": "^0.0.0",
|
|
30
31
|
"typescript": "^5.8.3"
|
|
31
32
|
},
|
|
32
33
|
"repository": {
|