@dan-uni/dan-any 1.0.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/157.min.js +30 -0
- package/dist/{index.min.js → browser/17.min.js} +14 -8
- package/dist/browser/898.min.js +10 -0
- package/dist/browser/index.min.js +1 -0
- package/dist/browser/plugins/bili-dedupe.min.js +1 -0
- package/dist/browser/plugins/index.min.js +2 -0
- package/dist/browser/plugins/stats.min.js +1 -0
- package/dist/{src → browser/src}/index.d.ts +4 -4
- package/dist/browser/src/plugins/bili-dedupe/index.d.ts +3 -0
- package/dist/browser/src/plugins/index.d.ts +2 -0
- package/dist/browser/src/plugins/stats/getLatestDan.d.ts +6 -0
- package/dist/browser/src/plugins/stats/index.d.ts +1 -0
- package/dist/browser/src/plugins/stats/index.test.d.ts +1 -0
- package/dist/browser/src/utils/dm-gen.test.d.ts +1 -0
- package/dist/node/157.js +30 -0
- package/dist/{index.js → node/17.js} +2 -2
- package/dist/node/898.js +10 -0
- package/dist/node/index.js +1 -0
- package/dist/node/plugins/bili-dedupe.js +1 -0
- package/dist/node/plugins/index.js +2 -0
- package/dist/node/plugins/stats.js +1 -0
- package/dist/node/src/ass-gen/__tests__/canvas.test.d.ts +1 -0
- package/dist/node/src/ass-gen/__tests__/generate.test.d.ts +1 -0
- package/dist/node/src/ass-gen/ass/create.d.ts +4 -0
- package/dist/node/src/ass-gen/ass/dialogue.d.ts +16 -0
- package/dist/node/src/ass-gen/ass/event.d.ts +2 -0
- package/dist/node/src/ass-gen/ass/info.d.ts +8 -0
- package/dist/node/src/ass-gen/ass/raw.d.ts +14 -0
- package/dist/node/src/ass-gen/ass/style.d.ts +2 -0
- package/dist/node/src/ass-gen/config.d.ts +2 -0
- package/dist/node/src/ass-gen/index.d.ts +30 -0
- package/dist/node/src/ass-gen/types.d.ts +71 -0
- package/dist/node/src/ass-gen/util/color.d.ts +18 -0
- package/dist/node/src/ass-gen/util/danconvert.d.ts +5 -0
- package/dist/node/src/ass-gen/util/index.d.ts +4 -0
- package/dist/node/src/ass-gen/util/lang.d.ts +3 -0
- package/dist/node/src/ass-gen/util/layout.d.ts +4 -0
- package/dist/node/src/index.d.ts +255 -0
- package/dist/node/src/index.test.d.ts +1 -0
- package/dist/node/src/plugins/bili-dedupe/index.d.ts +3 -0
- package/dist/node/src/plugins/bili-dedupe/index.test.d.ts +1 -0
- package/dist/node/src/plugins/index.d.ts +2 -0
- package/dist/node/src/plugins/stats/getLatestDan.d.ts +6 -0
- package/dist/node/src/plugins/stats/index.d.ts +1 -0
- package/dist/node/src/plugins/stats/index.test.d.ts +1 -0
- package/dist/node/src/proto/gen/bili/dm_pb.d.ts +3426 -0
- package/dist/node/src/proto/gen/danuni_pb.d.ts +172 -0
- package/dist/node/src/utils/dm-gen.d.ts +309 -0
- package/dist/node/src/utils/dm-gen.test.d.ts +1 -0
- package/dist/node/src/utils/id-gen.d.ts +50 -0
- package/dist/node/src/utils/platform.d.ts +24 -0
- package/dist/{index.umd.min.js → umd/index.umd.min.js} +76 -67
- package/dist/umd/plugins/bili-dedupe.umd.min.js +25028 -0
- package/dist/umd/plugins/bili-dedupe.umd.min.js.LICENSE.txt +34 -0
- package/dist/umd/plugins/index.umd.min.js +25048 -0
- package/dist/umd/plugins/index.umd.min.js.LICENSE.txt +34 -0
- package/dist/umd/plugins/stats.umd.min.js +39 -0
- package/dist/umd/src/ass-gen/__tests__/canvas.test.d.ts +1 -0
- package/dist/umd/src/ass-gen/__tests__/generate.test.d.ts +1 -0
- package/dist/umd/src/ass-gen/ass/create.d.ts +4 -0
- package/dist/umd/src/ass-gen/ass/dialogue.d.ts +16 -0
- package/dist/umd/src/ass-gen/ass/event.d.ts +2 -0
- package/dist/umd/src/ass-gen/ass/info.d.ts +8 -0
- package/dist/umd/src/ass-gen/ass/raw.d.ts +14 -0
- package/dist/umd/src/ass-gen/ass/style.d.ts +2 -0
- package/dist/umd/src/ass-gen/config.d.ts +2 -0
- package/dist/umd/src/ass-gen/index.d.ts +30 -0
- package/dist/umd/src/ass-gen/types.d.ts +71 -0
- package/dist/umd/src/ass-gen/util/color.d.ts +18 -0
- package/dist/umd/src/ass-gen/util/danconvert.d.ts +5 -0
- package/dist/umd/src/ass-gen/util/index.d.ts +4 -0
- package/dist/umd/src/ass-gen/util/lang.d.ts +3 -0
- package/dist/umd/src/ass-gen/util/layout.d.ts +4 -0
- package/dist/umd/src/index.d.ts +255 -0
- package/dist/umd/src/index.test.d.ts +1 -0
- package/dist/umd/src/plugins/bili-dedupe/index.d.ts +3 -0
- package/dist/umd/src/plugins/bili-dedupe/index.test.d.ts +1 -0
- package/dist/umd/src/plugins/index.d.ts +2 -0
- package/dist/umd/src/plugins/stats/getLatestDan.d.ts +6 -0
- package/dist/umd/src/plugins/stats/index.d.ts +1 -0
- package/dist/umd/src/plugins/stats/index.test.d.ts +1 -0
- package/dist/umd/src/proto/gen/bili/dm_pb.d.ts +3426 -0
- package/dist/umd/src/proto/gen/danuni_pb.d.ts +172 -0
- package/dist/umd/src/utils/dm-gen.d.ts +309 -0
- package/dist/umd/src/utils/dm-gen.test.d.ts +1 -0
- package/dist/umd/src/utils/id-gen.d.ts +50 -0
- package/dist/umd/src/utils/platform.d.ts +24 -0
- package/package.json +8 -8
- package/plugins/package.json +6 -0
- package/rslib.config.ts +11 -0
- package/src/index.ts +8 -4
- package/src/plugins/bili-dedupe/index.test.ts +43 -0
- package/src/plugins/bili-dedupe/index.ts +29 -0
- package/src/plugins/index.ts +2 -0
- package/src/plugins/stats/getLatestDan.ts +13 -0
- package/src/plugins/stats/index.test.ts +39 -0
- package/src/plugins/stats/index.ts +1 -0
- package/src/proto/gen/bili/dm_pb.ts +1 -1
- package/src/proto/gen/danuni_pb.ts +1 -1
- /package/dist/{index.min.js.LICENSE.txt → browser/17.min.js.LICENSE.txt} +0 -0
- /package/dist/{rslib-runtime.min.js → browser/rslib-runtime.min.js} +0 -0
- /package/dist/{src → browser/src}/ass-gen/__tests__/canvas.test.d.ts +0 -0
- /package/dist/{src → browser/src}/ass-gen/__tests__/generate.test.d.ts +0 -0
- /package/dist/{src → browser/src}/ass-gen/ass/create.d.ts +0 -0
- /package/dist/{src → browser/src}/ass-gen/ass/dialogue.d.ts +0 -0
- /package/dist/{src → browser/src}/ass-gen/ass/event.d.ts +0 -0
- /package/dist/{src → browser/src}/ass-gen/ass/info.d.ts +0 -0
- /package/dist/{src → browser/src}/ass-gen/ass/raw.d.ts +0 -0
- /package/dist/{src → browser/src}/ass-gen/ass/style.d.ts +0 -0
- /package/dist/{src → browser/src}/ass-gen/config.d.ts +0 -0
- /package/dist/{src → browser/src}/ass-gen/index.d.ts +0 -0
- /package/dist/{src → browser/src}/ass-gen/types.d.ts +0 -0
- /package/dist/{src → browser/src}/ass-gen/util/color.d.ts +0 -0
- /package/dist/{src → browser/src}/ass-gen/util/danconvert.d.ts +0 -0
- /package/dist/{src → browser/src}/ass-gen/util/index.d.ts +0 -0
- /package/dist/{src → browser/src}/ass-gen/util/lang.d.ts +0 -0
- /package/dist/{src → browser/src}/ass-gen/util/layout.d.ts +0 -0
- /package/dist/{src → browser/src}/index.test.d.ts +0 -0
- /package/dist/{src/utils/dm-gen.test.d.ts → browser/src/plugins/bili-dedupe/index.test.d.ts} +0 -0
- /package/dist/{src → browser/src}/proto/gen/bili/dm_pb.d.ts +0 -0
- /package/dist/{src → browser/src}/proto/gen/danuni_pb.d.ts +0 -0
- /package/dist/{src → browser/src}/utils/dm-gen.d.ts +0 -0
- /package/dist/{src → browser/src}/utils/id-gen.d.ts +0 -0
- /package/dist/{src → browser/src}/utils/platform.d.ts +0 -0
- /package/dist/{rslib-runtime.js → node/rslib-runtime.js} +0 -0
- /package/dist/{index.umd.min.js.LICENSE.txt → umd/index.umd.min.js.LICENSE.txt} +0 -0
|
@@ -6218,7 +6218,7 @@
|
|
|
6218
6218
|
},
|
|
6219
6219
|
"../../node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/index.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
6220
6220
|
"use strict";
|
|
6221
|
-
var whichTypedArray = __webpack_require__("../../node_modules/.pnpm/which-typed-array@1.1.
|
|
6221
|
+
var whichTypedArray = __webpack_require__("../../node_modules/.pnpm/which-typed-array@1.1.20/node_modules/which-typed-array/index.js");
|
|
6222
6222
|
module1.exports = function(value) {
|
|
6223
6223
|
return !!whichTypedArray(value);
|
|
6224
6224
|
};
|
|
@@ -12487,7 +12487,7 @@
|
|
|
12487
12487
|
"use strict";
|
|
12488
12488
|
var isArgumentsObject = __webpack_require__("../../node_modules/.pnpm/is-arguments@1.2.0/node_modules/is-arguments/index.js");
|
|
12489
12489
|
var isGeneratorFunction = __webpack_require__("../../node_modules/.pnpm/is-generator-function@1.1.2/node_modules/is-generator-function/index.js");
|
|
12490
|
-
var whichTypedArray = __webpack_require__("../../node_modules/.pnpm/which-typed-array@1.1.
|
|
12490
|
+
var whichTypedArray = __webpack_require__("../../node_modules/.pnpm/which-typed-array@1.1.20/node_modules/which-typed-array/index.js");
|
|
12491
12491
|
var isTypedArray = __webpack_require__("../../node_modules/.pnpm/is-typed-array@1.1.15/node_modules/is-typed-array/index.js");
|
|
12492
12492
|
function uncurryThis(f) {
|
|
12493
12493
|
return f.call.bind(f);
|
|
@@ -13486,7 +13486,7 @@
|
|
|
13486
13486
|
module1.exports = exports1["default"];
|
|
13487
13487
|
module1.exports["default"] = exports1["default"];
|
|
13488
13488
|
},
|
|
13489
|
-
"../../node_modules/.pnpm/which-typed-array@1.1.
|
|
13489
|
+
"../../node_modules/.pnpm/which-typed-array@1.1.20/node_modules/which-typed-array/index.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
13490
13490
|
"use strict";
|
|
13491
13491
|
var forEach = __webpack_require__("../../node_modules/.pnpm/for-each@0.3.5/node_modules/for-each/index.js");
|
|
13492
13492
|
var availableTypedArrays = __webpack_require__("../../node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/index.js");
|
|
@@ -13515,12 +13515,18 @@
|
|
|
13515
13515
|
var superProto = getProto(proto);
|
|
13516
13516
|
descriptor = gOPD(superProto, Symbol.toStringTag);
|
|
13517
13517
|
}
|
|
13518
|
-
|
|
13518
|
+
if (descriptor && descriptor.get) {
|
|
13519
|
+
var bound = callBind(descriptor.get);
|
|
13520
|
+
cache['$' + typedArray] = bound;
|
|
13521
|
+
}
|
|
13519
13522
|
}
|
|
13520
13523
|
}) : forEach(typedArrays, function(typedArray) {
|
|
13521
13524
|
var arr = new g[typedArray]();
|
|
13522
13525
|
var fn = arr.slice || arr.set;
|
|
13523
|
-
if (fn)
|
|
13526
|
+
if (fn) {
|
|
13527
|
+
var bound = callBind(fn);
|
|
13528
|
+
cache['$' + typedArray] = bound;
|
|
13529
|
+
}
|
|
13524
13530
|
});
|
|
13525
13531
|
var tryTypedArrays = function(value) {
|
|
13526
13532
|
var found = false;
|
|
@@ -13564,6 +13570,51 @@
|
|
|
13564
13570
|
return number + '';
|
|
13565
13571
|
};
|
|
13566
13572
|
},
|
|
13573
|
+
"./src/utils/platform.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
|
|
13574
|
+
"use strict";
|
|
13575
|
+
__webpack_require__.r(__webpack_exports__);
|
|
13576
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
13577
|
+
PlatformDanmakuOnlySource: ()=>PlatformDanmakuOnlySource,
|
|
13578
|
+
PlatformDanmakuOnlySources: ()=>PlatformDanmakuOnlySources,
|
|
13579
|
+
PlatformDanmakuSources: ()=>PlatformDanmakuSources,
|
|
13580
|
+
PlatformInfoSource: ()=>PlatformInfoSource,
|
|
13581
|
+
PlatformInfoSources: ()=>PlatformInfoSources,
|
|
13582
|
+
PlatformSources: ()=>PlatformSources,
|
|
13583
|
+
PlatformVideoSource: ()=>PlatformVideoSource,
|
|
13584
|
+
PlatformVideoSources: ()=>PlatformVideoSources
|
|
13585
|
+
});
|
|
13586
|
+
var PlatformInfoSource = /*#__PURE__*/ function(PlatformInfoSource) {
|
|
13587
|
+
PlatformInfoSource["Bangumi"] = "bgm";
|
|
13588
|
+
PlatformInfoSource["TMDB"] = "tmdb";
|
|
13589
|
+
return PlatformInfoSource;
|
|
13590
|
+
}({});
|
|
13591
|
+
const PlatformInfoSources = Object.values(PlatformInfoSource);
|
|
13592
|
+
var PlatformVideoSource = /*#__PURE__*/ function(PlatformVideoSource) {
|
|
13593
|
+
PlatformVideoSource["Acfun"] = "acfun";
|
|
13594
|
+
PlatformVideoSource["Baha"] = "baha";
|
|
13595
|
+
PlatformVideoSource["Bilibili"] = "bili";
|
|
13596
|
+
PlatformVideoSource["BilibiliGlobal"] = "bglobal";
|
|
13597
|
+
PlatformVideoSource["Iqiyi"] = "iqiyi";
|
|
13598
|
+
PlatformVideoSource["Tencent"] = "tencent";
|
|
13599
|
+
PlatformVideoSource["Youku"] = "youku";
|
|
13600
|
+
return PlatformVideoSource;
|
|
13601
|
+
}({});
|
|
13602
|
+
const PlatformVideoSources = Object.values(PlatformVideoSource);
|
|
13603
|
+
var PlatformDanmakuOnlySource = /*#__PURE__*/ function(PlatformDanmakuOnlySource) {
|
|
13604
|
+
PlatformDanmakuOnlySource["DanDanPlay"] = "ddplay";
|
|
13605
|
+
PlatformDanmakuOnlySource["TuCao"] = "tucao";
|
|
13606
|
+
return PlatformDanmakuOnlySource;
|
|
13607
|
+
}({});
|
|
13608
|
+
const PlatformDanmakuOnlySources = Object.values(PlatformDanmakuOnlySource);
|
|
13609
|
+
const PlatformDanmakuSources = [
|
|
13610
|
+
...PlatformVideoSources,
|
|
13611
|
+
...PlatformDanmakuOnlySources
|
|
13612
|
+
];
|
|
13613
|
+
const PlatformSources = [
|
|
13614
|
+
...PlatformInfoSources,
|
|
13615
|
+
...PlatformDanmakuSources
|
|
13616
|
+
];
|
|
13617
|
+
},
|
|
13567
13618
|
"?c028" () {},
|
|
13568
13619
|
"?8beb" () {},
|
|
13569
13620
|
"../../node_modules/.pnpm/available-typed-arrays@1.0.7/node_modules/available-typed-arrays/index.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
@@ -14211,24 +14262,12 @@ and limitations under the License.
|
|
|
14211
14262
|
"use strict";
|
|
14212
14263
|
__webpack_require__.r(__webpack_exports__);
|
|
14213
14264
|
__webpack_require__.d(__webpack_exports__, {
|
|
14214
|
-
platform: ()=>
|
|
14265
|
+
platform: ()=>platform,
|
|
14215
14266
|
UniDM: ()=>UniDM,
|
|
14216
14267
|
UniDMTools: ()=>dm_gen_namespaceObject,
|
|
14217
14268
|
UniPool: ()=>UniPool,
|
|
14218
14269
|
UniIDTools: ()=>id_gen_namespaceObject
|
|
14219
14270
|
});
|
|
14220
|
-
var platform_namespaceObject = {};
|
|
14221
|
-
__webpack_require__.r(platform_namespaceObject);
|
|
14222
|
-
__webpack_require__.d(platform_namespaceObject, {
|
|
14223
|
-
PlatformDanmakuOnlySource: ()=>platform_PlatformDanmakuOnlySource,
|
|
14224
|
-
PlatformDanmakuOnlySources: ()=>PlatformDanmakuOnlySources,
|
|
14225
|
-
PlatformDanmakuSources: ()=>PlatformDanmakuSources,
|
|
14226
|
-
PlatformInfoSource: ()=>platform_PlatformInfoSource,
|
|
14227
|
-
PlatformInfoSources: ()=>PlatformInfoSources,
|
|
14228
|
-
PlatformSources: ()=>PlatformSources,
|
|
14229
|
-
PlatformVideoSource: ()=>platform_PlatformVideoSource,
|
|
14230
|
-
PlatformVideoSources: ()=>PlatformVideoSources
|
|
14231
|
-
});
|
|
14232
14271
|
var id_gen_namespaceObject = {};
|
|
14233
14272
|
__webpack_require__.r(id_gen_namespaceObject);
|
|
14234
14273
|
__webpack_require__.d(id_gen_namespaceObject, {
|
|
@@ -21004,7 +21043,7 @@ and limitations under the License.
|
|
|
21004
21043
|
function timestamp_timestampMs(timestamp) {
|
|
21005
21044
|
return 1000 * Number(timestamp.seconds) + Math.round(timestamp.nanos / 1000000);
|
|
21006
21045
|
}
|
|
21007
|
-
var package_namespaceObject = JSON.parse('{"UU":"@dan-uni/dan-any","rE":"1.
|
|
21046
|
+
var package_namespaceObject = JSON.parse('{"UU":"@dan-uni/dan-any","rE":"1.2.2","TB":"https://github.com/ani-uni/danuni/tree/master/packages/dan-any#readme"}');
|
|
21008
21047
|
const color_pad = (s)=>s.length < 2 ? `0${s}` : s;
|
|
21009
21048
|
const decimalToHex = (n)=>color_pad(n.toString(16));
|
|
21010
21049
|
const isDarkColor = ({ r, g, b })=>0.299 * r + 0.587 * g + 0.114 * b < 0x30;
|
|
@@ -23241,37 +23280,7 @@ and limitations under the License.
|
|
|
23241
23280
|
return this.P.getHMAC(t, n);
|
|
23242
23281
|
}
|
|
23243
23282
|
}
|
|
23244
|
-
var
|
|
23245
|
-
PlatformInfoSource["Bangumi"] = "bgm";
|
|
23246
|
-
PlatformInfoSource["TMDB"] = "tmdb";
|
|
23247
|
-
return PlatformInfoSource;
|
|
23248
|
-
}({});
|
|
23249
|
-
const PlatformInfoSources = Object.values(platform_PlatformInfoSource);
|
|
23250
|
-
var platform_PlatformVideoSource = /*#__PURE__*/ function(PlatformVideoSource) {
|
|
23251
|
-
PlatformVideoSource["Acfun"] = "acfun";
|
|
23252
|
-
PlatformVideoSource["Baha"] = "baha";
|
|
23253
|
-
PlatformVideoSource["Bilibili"] = "bili";
|
|
23254
|
-
PlatformVideoSource["BilibiliGlobal"] = "bglobal";
|
|
23255
|
-
PlatformVideoSource["Iqiyi"] = "iqiyi";
|
|
23256
|
-
PlatformVideoSource["Tencent"] = "tencent";
|
|
23257
|
-
PlatformVideoSource["Youku"] = "youku";
|
|
23258
|
-
return PlatformVideoSource;
|
|
23259
|
-
}({});
|
|
23260
|
-
const PlatformVideoSources = Object.values(platform_PlatformVideoSource);
|
|
23261
|
-
var platform_PlatformDanmakuOnlySource = /*#__PURE__*/ function(PlatformDanmakuOnlySource) {
|
|
23262
|
-
PlatformDanmakuOnlySource["DanDanPlay"] = "ddplay";
|
|
23263
|
-
PlatformDanmakuOnlySource["TuCao"] = "tucao";
|
|
23264
|
-
return PlatformDanmakuOnlySource;
|
|
23265
|
-
}({});
|
|
23266
|
-
const PlatformDanmakuOnlySources = Object.values(platform_PlatformDanmakuOnlySource);
|
|
23267
|
-
const PlatformDanmakuSources = [
|
|
23268
|
-
...PlatformVideoSources,
|
|
23269
|
-
...PlatformDanmakuOnlySources
|
|
23270
|
-
];
|
|
23271
|
-
const PlatformSources = [
|
|
23272
|
-
...PlatformInfoSources,
|
|
23273
|
-
...PlatformDanmakuSources
|
|
23274
|
-
];
|
|
23283
|
+
var platform = __webpack_require__("./src/utils/platform.ts");
|
|
23275
23284
|
class id_gen_UniID {
|
|
23276
23285
|
constructor(id, domain){
|
|
23277
23286
|
this.id = id;
|
|
@@ -23288,10 +23297,10 @@ and limitations under the License.
|
|
|
23288
23297
|
return new id_gen_UniID('runtime' === domain ? 'runtime' : 'anonymous', domain || 'danuni');
|
|
23289
23298
|
}
|
|
23290
23299
|
static fromBili({ cid, mid, midHash }) {
|
|
23291
|
-
if (cid) return new id_gen_UniID(cid.toString(),
|
|
23292
|
-
if (mid) return new id_gen_UniID(mid.toString(),
|
|
23293
|
-
if (midHash) return new id_gen_UniID(midHash,
|
|
23294
|
-
return this.fromNull(
|
|
23300
|
+
if (cid) return new id_gen_UniID(cid.toString(), platform.PlatformVideoSource.Bilibili);
|
|
23301
|
+
if (mid) return new id_gen_UniID(mid.toString(), platform.PlatformVideoSource.Bilibili);
|
|
23302
|
+
if (midHash) return new id_gen_UniID(midHash, platform.PlatformVideoSource.Bilibili);
|
|
23303
|
+
return this.fromNull(platform.PlatformVideoSource.Bilibili);
|
|
23295
23304
|
}
|
|
23296
23305
|
static fromUnknown(id, domain) {
|
|
23297
23306
|
if (id) return new id_gen_UniID(id, domain);
|
|
@@ -23473,7 +23482,7 @@ and limitations under the License.
|
|
|
23473
23482
|
return extra;
|
|
23474
23483
|
}
|
|
23475
23484
|
get isFrom3rdPlatform() {
|
|
23476
|
-
if (this.platform && PlatformDanmakuSources.includes(this.platform)) return true;
|
|
23485
|
+
if (this.platform && platform.PlatformDanmakuSources.includes(this.platform)) return true;
|
|
23477
23486
|
return false;
|
|
23478
23487
|
}
|
|
23479
23488
|
toDMID() {
|
|
@@ -23627,7 +23636,7 @@ and limitations under the License.
|
|
|
23627
23636
|
}
|
|
23628
23637
|
static fromBili(args, cid, options, recSOID) {
|
|
23629
23638
|
if (args.oid && !cid) cid = args.oid;
|
|
23630
|
-
const SOID = recSOID || `def_${
|
|
23639
|
+
const SOID = recSOID || `def_${platform.PlatformVideoSource.Bilibili}+${id_gen_UniID.fromBili({
|
|
23631
23640
|
cid
|
|
23632
23641
|
})}`;
|
|
23633
23642
|
const senderID = IsEmail_isEmail(args.midHash, {
|
|
@@ -23680,8 +23689,8 @@ and limitations under the License.
|
|
|
23680
23689
|
ctime: this.transCtime(args.ctime, 's'),
|
|
23681
23690
|
weight: args.weight || (3 === pool ? 1 : 0),
|
|
23682
23691
|
pool,
|
|
23683
|
-
attr: DMAttrUtils.fromBin(args.attr,
|
|
23684
|
-
platform:
|
|
23692
|
+
attr: DMAttrUtils.fromBin(args.attr, platform.PlatformVideoSource.Bilibili),
|
|
23693
|
+
platform: platform.PlatformVideoSource.Bilibili,
|
|
23685
23694
|
extra
|
|
23686
23695
|
}, options);
|
|
23687
23696
|
}
|
|
@@ -23732,7 +23741,7 @@ and limitations under the License.
|
|
|
23732
23741
|
this.color,
|
|
23733
23742
|
this.ctime.getTime() / 1000,
|
|
23734
23743
|
this.extra.bili?.pool || this.pool,
|
|
23735
|
-
options?.avoidSenderIDWithAt ? this.senderID.replaceAll(`@${
|
|
23744
|
+
options?.avoidSenderIDWithAt ? this.senderID.replaceAll(`@${platform.PlatformVideoSource.Bilibili}`, '') : this.senderID,
|
|
23736
23745
|
this.extra.bili?.dmid || this.DMID || this.toDMID(),
|
|
23737
23746
|
this.weight
|
|
23738
23747
|
].join(',')
|
|
@@ -23740,7 +23749,7 @@ and limitations under the License.
|
|
|
23740
23749
|
}
|
|
23741
23750
|
static fromBiliCommand(args, cid, options) {
|
|
23742
23751
|
if (args.oid && !cid) cid = args.oid;
|
|
23743
|
-
const SOID = `def_${
|
|
23752
|
+
const SOID = `def_${platform.PlatformVideoSource.Bilibili}+${id_gen_UniID.fromBili({
|
|
23744
23753
|
cid
|
|
23745
23754
|
})}`;
|
|
23746
23755
|
const senderID = id_gen_UniID.fromBili({
|
|
@@ -23757,7 +23766,7 @@ and limitations under the License.
|
|
|
23757
23766
|
attr: [
|
|
23758
23767
|
"Protect"
|
|
23759
23768
|
],
|
|
23760
|
-
platform:
|
|
23769
|
+
platform: platform.PlatformVideoSource.Bilibili,
|
|
23761
23770
|
extra: {
|
|
23762
23771
|
bili: {
|
|
23763
23772
|
command: args
|
|
@@ -23829,8 +23838,8 @@ and limitations under the License.
|
|
|
23829
23838
|
style: this.extra.artplayer?.style
|
|
23830
23839
|
};
|
|
23831
23840
|
}
|
|
23832
|
-
static fromDDplay(args, episodeId, domain =
|
|
23833
|
-
const SOID = id_gen_UniID.fromUnknown(`def_${
|
|
23841
|
+
static fromDDplay(args, episodeId, domain = platform.PlatformDanmakuOnlySource.DanDanPlay, options) {
|
|
23842
|
+
const SOID = id_gen_UniID.fromUnknown(`def_${platform.PlatformDanmakuOnlySource.DanDanPlay}+${episodeId}`, domain);
|
|
23834
23843
|
return this.create({
|
|
23835
23844
|
...args,
|
|
23836
23845
|
SOID: SOID.toString(),
|
|
@@ -24855,14 +24864,14 @@ and limitations under the License.
|
|
|
24855
24864
|
toBiliXML(options) {
|
|
24856
24865
|
const genCID = (id)=>{
|
|
24857
24866
|
const UniID = id_gen_UniID.fromString(id);
|
|
24858
|
-
if (UniID.domain ===
|
|
24859
|
-
const cid = UniID.id.replaceAll(`def_${
|
|
24867
|
+
if (UniID.domain === platform.PlatformVideoSource.Bilibili) {
|
|
24868
|
+
const cid = UniID.id.replaceAll(`def_${platform.PlatformVideoSource.Bilibili}+`, '');
|
|
24860
24869
|
if (cid) return cid;
|
|
24861
24870
|
}
|
|
24862
24871
|
return !options?.cid || id;
|
|
24863
24872
|
};
|
|
24864
24873
|
if (options?.avoidSenderIDWithAt) {
|
|
24865
|
-
const ok = this.dans.every((d)=>d.senderID.endsWith(`@${
|
|
24874
|
+
const ok = this.dans.every((d)=>d.senderID.endsWith(`@${platform.PlatformVideoSource.Bilibili}`));
|
|
24866
24875
|
if (!ok) throw new Error('存在其他来源的senderID,请关闭该功能再试!');
|
|
24867
24876
|
}
|
|
24868
24877
|
const builder = new Builder({
|
|
@@ -24997,7 +25006,7 @@ and limitations under the License.
|
|
|
24997
25006
|
});
|
|
24998
25007
|
}
|
|
24999
25008
|
toDDplay() {
|
|
25000
|
-
const episodeId = this.dans[0].SOID.split('@')[0].replaceAll(`def_${
|
|
25009
|
+
const episodeId = this.dans[0].SOID.split('@')[0].replaceAll(`def_${platform.PlatformDanmakuOnlySource.DanDanPlay}+`, '');
|
|
25001
25010
|
return {
|
|
25002
25011
|
danuni: {
|
|
25003
25012
|
...DanUniConvertTipTemplate,
|