@bililive-tools/bilibili-recorder 1.13.0 → 1.15.0
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/lib/bilibili_api.d.ts +1 -0
- package/lib/bilibili_api.js +3 -0
- package/lib/stream.d.ts +1 -0
- package/lib/stream.js +2 -0
- package/package.json +3 -3
package/lib/bilibili_api.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export declare function getStatusInfoByUIDs<UID extends number>(userIds: UID[]):
|
|
|
42
42
|
online: number;
|
|
43
43
|
room_id: number;
|
|
44
44
|
short_id: number;
|
|
45
|
+
area_v2_parent_name: string;
|
|
45
46
|
}>>;
|
|
46
47
|
export declare function getRoomBaseInfo<RoomId extends number>(roomId: RoomId): Promise<Record<RoomId, {
|
|
47
48
|
title: string;
|
package/lib/bilibili_api.js
CHANGED
|
@@ -8,6 +8,9 @@ const requester = axios.create({
|
|
|
8
8
|
// axios 会自动读取环境变量中的 http_proxy 和 https_proxy 并应用,
|
|
9
9
|
// 但会导致请求报错 "Client network socket disconnected before secure TLS connection was established"。
|
|
10
10
|
proxy: false,
|
|
11
|
+
headers: {
|
|
12
|
+
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/119.0.0.0 Safari/537.36",
|
|
13
|
+
},
|
|
11
14
|
});
|
|
12
15
|
export async function getRoomInit(roomIdOrShortId) {
|
|
13
16
|
const res = await requester.get(`https://api.live.bilibili.com/room/v1/Room/room_init?id=${roomIdOrShortId}`);
|
package/lib/stream.d.ts
CHANGED
package/lib/stream.js
CHANGED
|
@@ -55,6 +55,7 @@ export async function getInfo(channelId) {
|
|
|
55
55
|
roomId: roomInit.room_id,
|
|
56
56
|
liveId: utils.md5(`${roomInit.room_id}-${liveStartTime?.getTime()}`),
|
|
57
57
|
recordStartTime,
|
|
58
|
+
area: status.parent_area_name,
|
|
58
59
|
};
|
|
59
60
|
}
|
|
60
61
|
const liveStartTime = new Date(status.live_time * 1000);
|
|
@@ -69,6 +70,7 @@ export async function getInfo(channelId) {
|
|
|
69
70
|
liveStartTime: liveStartTime,
|
|
70
71
|
liveId: utils.md5(`${roomInit.room_id}-${liveStartTime.getTime()}`),
|
|
71
72
|
recordStartTime,
|
|
73
|
+
area: status.area_v2_parent_name,
|
|
72
74
|
};
|
|
73
75
|
}
|
|
74
76
|
async function getLiveInfo(roomIdOrShortId, opts) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bililive-tools/bilibili-recorder",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"description": "bililive-tools bilibili recorder implemention",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"mitt": "^3.0.1",
|
|
39
39
|
"tiny-bilibili-ws": "^1.0.2",
|
|
40
40
|
"lodash-es": "^4.17.21",
|
|
41
|
-
"axios": "^1.
|
|
42
|
-
"@bililive-tools/manager": "^1.
|
|
41
|
+
"axios": "^1.15.0",
|
|
42
|
+
"@bililive-tools/manager": "^1.14.1"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "tsc",
|