@floating-live/bilibili 0.15.0 → 0.15.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/index.js +5 -0
- package/index.ts +6 -1
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const room_1 = require("./room");
|
|
4
4
|
const utils_1 = require("./utils");
|
|
5
|
+
const parser_1 = require("./parser");
|
|
5
6
|
const platformInfo = {
|
|
6
7
|
name: "bilibili",
|
|
7
8
|
membership: {
|
|
@@ -34,6 +35,10 @@ class Bilibili {
|
|
|
34
35
|
main.command.register("bilibili.room.create", (id, options) => {
|
|
35
36
|
return new room_1.RoomBilibili(Number(id), options);
|
|
36
37
|
});
|
|
38
|
+
main.command.register("bilibili.room.info", async (id) => {
|
|
39
|
+
const rawInfo = await (0, utils_1.getInfoByRoom)(parseInt("" + id));
|
|
40
|
+
return (0, parser_1.parseInfo)(rawInfo);
|
|
41
|
+
});
|
|
37
42
|
main.command.register("bilibili.credentials.check", async (credentials) => {
|
|
38
43
|
const buvid = (await (0, utils_1.getBuvid)(credentials)) || "";
|
|
39
44
|
const userId = await (0, utils_1.getLoginUid)(credentials);
|
package/index.ts
CHANGED
|
@@ -4,9 +4,10 @@ import {
|
|
|
4
4
|
checkLoginQRcode,
|
|
5
5
|
generateLoginQRcode,
|
|
6
6
|
getBuvid,
|
|
7
|
+
getInfoByRoom,
|
|
7
8
|
getLoginUid,
|
|
8
|
-
parseCookieString,
|
|
9
9
|
} from "./utils";
|
|
10
|
+
import { parseInfo } from "./parser";
|
|
10
11
|
|
|
11
12
|
interface BilibiliLoginInfo {
|
|
12
13
|
credentials: string;
|
|
@@ -68,6 +69,10 @@ class Bilibili {
|
|
|
68
69
|
return new RoomBilibili(Number(id), options);
|
|
69
70
|
}
|
|
70
71
|
);
|
|
72
|
+
main.command.register("bilibili.room.info", async (id: string | number) => {
|
|
73
|
+
const rawInfo = await getInfoByRoom(parseInt("" + id));
|
|
74
|
+
return parseInfo(rawInfo);
|
|
75
|
+
});
|
|
71
76
|
|
|
72
77
|
main.command.register("bilibili.credentials.check", async (credentials) => {
|
|
73
78
|
const buvid = (await getBuvid(credentials)) || "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@floating-live/bilibili",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.1",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -24,6 +24,6 @@
|
|
|
24
24
|
"typescript": "^4.8.4"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
|
-
"floating-live": "^0.15.
|
|
27
|
+
"floating-live": "^0.15.5"
|
|
28
28
|
}
|
|
29
29
|
}
|