@dan-uni/dan-any 1.0.0 → 1.1.1
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 +14 -0
- package/dist/browser/42.min.js +45 -0
- package/dist/{index.min.js → browser/index.min.js} +371 -1003
- package/dist/browser/plugins/bili-dedupe.min.js +1 -0
- package/dist/browser/plugins/index.min.js +1 -0
- package/dist/browser/rslib-runtime.min.js +49 -0
- package/dist/{src → browser/src}/index.d.ts +6 -6
- package/dist/browser/src/plugins/bili-dedupe/index.d.ts +5 -0
- package/dist/browser/src/plugins/index.d.ts +2 -0
- package/dist/{src → browser/src}/utils/dm-gen.d.ts +3 -3
- package/dist/browser/src/utils/dm-gen.test.d.ts +1 -0
- package/dist/node/157.js +14 -0
- package/dist/node/42.js +45 -0
- package/dist/{index.js → node/index.js} +275 -894
- package/dist/node/plugins/bili-dedupe.js +1 -0
- package/dist/node/plugins/index.js +1 -0
- package/dist/node/rslib-runtime.js +37 -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 +5 -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/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} +452 -990
- package/dist/umd/plugins/bili-dedupe.umd.min.js +79 -0
- package/dist/umd/plugins/index.umd.min.js +98 -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 +5 -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/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 +22 -22
- package/plugins/package.json +6 -0
- package/rslib.config.ts +13 -3
- package/src/ass-gen/util/index.ts +2 -2
- package/src/index.ts +6 -6
- package/src/plugins/bili-dedupe/index.test.ts +40 -0
- package/src/plugins/bili-dedupe/index.ts +19 -0
- package/src/plugins/index.ts +3 -0
- package/src/proto/gen/bili/dm_pb.ts +1 -1
- package/src/proto/gen/danuni_pb.ts +1 -1
- package/src/utils/dm-gen.test.ts +2 -2
- package/src/utils/dm-gen.ts +30 -5
- package/dist/{index.min.js.LICENSE.txt → browser/index.min.js.LICENSE.txt} +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 +2 -2
- /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/id-gen.d.ts +0 -0
- /package/dist/{src → browser/src}/utils/platform.d.ts +0 -0
- /package/dist/{index.umd.min.js.LICENSE.txt → umd/index.umd.min.js.LICENSE.txt} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { bili_dedupe as default } from "../157.min.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { bili_dedupe } from "../157.min.js";
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __webpack_modules__ = {};
|
|
2
|
+
var __webpack_module_cache__ = {};
|
|
3
|
+
function __webpack_require__(moduleId) {
|
|
4
|
+
var cachedModule = __webpack_module_cache__[moduleId];
|
|
5
|
+
if (void 0 !== cachedModule) return cachedModule.exports;
|
|
6
|
+
var module = __webpack_module_cache__[moduleId] = {
|
|
7
|
+
exports: {}
|
|
8
|
+
};
|
|
9
|
+
__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
10
|
+
return module.exports;
|
|
11
|
+
}
|
|
12
|
+
__webpack_require__.m = __webpack_modules__;
|
|
13
|
+
(()=>{
|
|
14
|
+
__webpack_require__.add = function(modules) {
|
|
15
|
+
Object.assign(__webpack_require__.m, modules);
|
|
16
|
+
};
|
|
17
|
+
})();
|
|
18
|
+
(()=>{
|
|
19
|
+
__webpack_require__.d = (exports, definition)=>{
|
|
20
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: definition[key]
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
})();
|
|
26
|
+
(()=>{
|
|
27
|
+
__webpack_require__.g = (()=>{
|
|
28
|
+
if ('object' == typeof globalThis) return globalThis;
|
|
29
|
+
try {
|
|
30
|
+
return this || new Function('return this')();
|
|
31
|
+
} catch (e) {
|
|
32
|
+
if ('object' == typeof window) return window;
|
|
33
|
+
}
|
|
34
|
+
})();
|
|
35
|
+
})();
|
|
36
|
+
(()=>{
|
|
37
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
38
|
+
})();
|
|
39
|
+
(()=>{
|
|
40
|
+
__webpack_require__.r = (exports)=>{
|
|
41
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports, Symbol.toStringTag, {
|
|
42
|
+
value: 'Module'
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperty(exports, '__esModule', {
|
|
45
|
+
value: true
|
|
46
|
+
});
|
|
47
|
+
};
|
|
48
|
+
})();
|
|
49
|
+
export { __webpack_require__ };
|
|
@@ -13,7 +13,7 @@ interface DanUniConvertTip {
|
|
|
13
13
|
export interface DM_XML_Bili {
|
|
14
14
|
i: {
|
|
15
15
|
chatserver: string;
|
|
16
|
-
chatid:
|
|
16
|
+
chatid: bigint;
|
|
17
17
|
mission: number;
|
|
18
18
|
maxlimit: number;
|
|
19
19
|
state: number;
|
|
@@ -44,15 +44,15 @@ export interface DM_JSON_BiliUp {
|
|
|
44
44
|
};
|
|
45
45
|
result: {
|
|
46
46
|
/** 弹幕 ID,int64 */
|
|
47
|
-
id:
|
|
47
|
+
id: bigint;
|
|
48
48
|
/** 弹幕 ID 字符串形式 */
|
|
49
49
|
id_str: string;
|
|
50
50
|
/** 弹幕类型:1 表示视频弹幕(当前接口恒为 1) */
|
|
51
51
|
type: number;
|
|
52
|
-
aid:
|
|
52
|
+
aid: bigint;
|
|
53
53
|
bvid: string;
|
|
54
|
-
oid:
|
|
55
|
-
mid:
|
|
54
|
+
oid: bigint;
|
|
55
|
+
mid: bigint;
|
|
56
56
|
/** 发送者 mid 的 CRC 哈希(正常接口里用的是这个,保护隐私) */
|
|
57
57
|
mid_hash: string;
|
|
58
58
|
/** 弹幕池 */
|
|
@@ -111,7 +111,7 @@ export interface DM_JSON_Artplayer {
|
|
|
111
111
|
export interface DM_JSON_DDPlay {
|
|
112
112
|
count: number | string;
|
|
113
113
|
comments: {
|
|
114
|
-
cid:
|
|
114
|
+
cid: bigint;
|
|
115
115
|
p: string;
|
|
116
116
|
m: string;
|
|
117
117
|
}[];
|
|
@@ -18,7 +18,7 @@ interface DMBili {
|
|
|
18
18
|
mode: number;
|
|
19
19
|
fontsize: number;
|
|
20
20
|
color: number;
|
|
21
|
-
mid?:
|
|
21
|
+
mid?: bigint;
|
|
22
22
|
midHash: string;
|
|
23
23
|
/**
|
|
24
24
|
* 特殊类型解析:
|
|
@@ -63,7 +63,7 @@ interface DMArtplayer {
|
|
|
63
63
|
style?: object;
|
|
64
64
|
}
|
|
65
65
|
interface DMDDplay {
|
|
66
|
-
cid:
|
|
66
|
+
cid: bigint;
|
|
67
67
|
/**
|
|
68
68
|
* content
|
|
69
69
|
*/
|
|
@@ -99,7 +99,7 @@ interface ExtraBili {
|
|
|
99
99
|
pool?: number;
|
|
100
100
|
dmid?: bigint;
|
|
101
101
|
attr?: number;
|
|
102
|
-
mid?:
|
|
102
|
+
mid?: bigint;
|
|
103
103
|
adv?: string;
|
|
104
104
|
code?: string;
|
|
105
105
|
bas?: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/node/157.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { platform_PlatformVideoSource } from "./42.js";
|
|
2
|
+
function bili_dedupe(that) {
|
|
3
|
+
that.dans.forEach((d)=>{
|
|
4
|
+
if (d.platform !== platform_PlatformVideoSource.Bilibili) throw new Error('bili-dedupe: 仅支持B站(主站)的弹幕');
|
|
5
|
+
if (!d.extra.bili?.dmid) throw new Error('bili-dedupe: 弹幕缺少bili extra dmid字段');
|
|
6
|
+
});
|
|
7
|
+
const map = new Map();
|
|
8
|
+
that.dans.forEach((d)=>map.set(d.extra.bili.dmid, d));
|
|
9
|
+
that.dans = [
|
|
10
|
+
...map.values()
|
|
11
|
+
];
|
|
12
|
+
return that;
|
|
13
|
+
}
|
|
14
|
+
export { bili_dedupe };
|
package/dist/node/42.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { __webpack_require__ } from "./rslib-runtime.js";
|
|
2
|
+
var platform_namespaceObject = {};
|
|
3
|
+
__webpack_require__.r(platform_namespaceObject);
|
|
4
|
+
__webpack_require__.d(platform_namespaceObject, {
|
|
5
|
+
PlatformDanmakuOnlySource: ()=>platform_PlatformDanmakuOnlySource,
|
|
6
|
+
PlatformDanmakuOnlySources: ()=>PlatformDanmakuOnlySources,
|
|
7
|
+
PlatformDanmakuSources: ()=>PlatformDanmakuSources,
|
|
8
|
+
PlatformInfoSource: ()=>platform_PlatformInfoSource,
|
|
9
|
+
PlatformInfoSources: ()=>PlatformInfoSources,
|
|
10
|
+
PlatformSources: ()=>PlatformSources,
|
|
11
|
+
PlatformVideoSource: ()=>platform_PlatformVideoSource,
|
|
12
|
+
PlatformVideoSources: ()=>PlatformVideoSources
|
|
13
|
+
});
|
|
14
|
+
var platform_PlatformInfoSource = /*#__PURE__*/ function(PlatformInfoSource) {
|
|
15
|
+
PlatformInfoSource["Bangumi"] = "bgm";
|
|
16
|
+
PlatformInfoSource["TMDB"] = "tmdb";
|
|
17
|
+
return PlatformInfoSource;
|
|
18
|
+
}({});
|
|
19
|
+
const PlatformInfoSources = Object.values(platform_PlatformInfoSource);
|
|
20
|
+
var platform_PlatformVideoSource = /*#__PURE__*/ function(PlatformVideoSource) {
|
|
21
|
+
PlatformVideoSource["Acfun"] = "acfun";
|
|
22
|
+
PlatformVideoSource["Baha"] = "baha";
|
|
23
|
+
PlatformVideoSource["Bilibili"] = "bili";
|
|
24
|
+
PlatformVideoSource["BilibiliGlobal"] = "bglobal";
|
|
25
|
+
PlatformVideoSource["Iqiyi"] = "iqiyi";
|
|
26
|
+
PlatformVideoSource["Tencent"] = "tencent";
|
|
27
|
+
PlatformVideoSource["Youku"] = "youku";
|
|
28
|
+
return PlatformVideoSource;
|
|
29
|
+
}({});
|
|
30
|
+
const PlatformVideoSources = Object.values(platform_PlatformVideoSource);
|
|
31
|
+
var platform_PlatformDanmakuOnlySource = /*#__PURE__*/ function(PlatformDanmakuOnlySource) {
|
|
32
|
+
PlatformDanmakuOnlySource["DanDanPlay"] = "ddplay";
|
|
33
|
+
PlatformDanmakuOnlySource["TuCao"] = "tucao";
|
|
34
|
+
return PlatformDanmakuOnlySource;
|
|
35
|
+
}({});
|
|
36
|
+
const PlatformDanmakuOnlySources = Object.values(platform_PlatformDanmakuOnlySource);
|
|
37
|
+
const PlatformDanmakuSources = [
|
|
38
|
+
...PlatformVideoSources,
|
|
39
|
+
...PlatformDanmakuOnlySources
|
|
40
|
+
];
|
|
41
|
+
const PlatformSources = [
|
|
42
|
+
...PlatformInfoSources,
|
|
43
|
+
...PlatformDanmakuSources
|
|
44
|
+
];
|
|
45
|
+
export { PlatformDanmakuSources, platform_PlatformDanmakuOnlySource, platform_PlatformVideoSource, platform_namespaceObject as platform };
|