@bililive-tools/bilibili-recorder 1.1.0 → 1.2.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/README.md +1 -0
- package/lib/danma.js +2 -2
- package/lib/index.js +2 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -50,6 +50,7 @@ interface Options {
|
|
|
50
50
|
codecName?: CodecName; // 见 CodecName 参数
|
|
51
51
|
useM3U8Proxy?: boolean; // 是否使用m3u8代理,由于hls及fmp4存在一个小时超时时间,需自行实现代理避免
|
|
52
52
|
m3u8ProxyUrl?: string; // 代理链接,文档待补充
|
|
53
|
+
videoFormat?: "auto"; // 视频格式: "auto", "ts", "mkv" ,auto模式下, 分段使用 "ts",不分段使用 "mp4"
|
|
53
54
|
}
|
|
54
55
|
```
|
|
55
56
|
|
package/lib/danma.js
CHANGED
|
@@ -5,7 +5,7 @@ class DanmaClient extends EventEmitter {
|
|
|
5
5
|
roomId;
|
|
6
6
|
auth;
|
|
7
7
|
uid;
|
|
8
|
-
retryCount =
|
|
8
|
+
retryCount = 10;
|
|
9
9
|
constructor(roomId, auth, uid) {
|
|
10
10
|
super();
|
|
11
11
|
this.roomId = roomId;
|
|
@@ -112,7 +112,7 @@ class DanmaClient extends EventEmitter {
|
|
|
112
112
|
if (this.retryCount > 0) {
|
|
113
113
|
setTimeout(() => {
|
|
114
114
|
this.client && this.client.reconnect();
|
|
115
|
-
}, 2000
|
|
115
|
+
}, 2000);
|
|
116
116
|
}
|
|
117
117
|
this.emit("error", err);
|
|
118
118
|
});
|
package/lib/index.js
CHANGED
|
@@ -93,7 +93,6 @@ const checkLiveStatusAndRecord = async function ({ getSavePath, isManualStart, b
|
|
|
93
93
|
cover: "",
|
|
94
94
|
liveId: liveId,
|
|
95
95
|
};
|
|
96
|
-
this.emit("LiveStart", { liveId });
|
|
97
96
|
if (liveId === banLiveId) {
|
|
98
97
|
this.tempStopIntervalCheck = true;
|
|
99
98
|
}
|
|
@@ -104,6 +103,7 @@ const checkLiveStatusAndRecord = async function ({ getSavePath, isManualStart, b
|
|
|
104
103
|
return null;
|
|
105
104
|
if (!living)
|
|
106
105
|
return null;
|
|
106
|
+
this.emit("LiveStart", { liveId });
|
|
107
107
|
const liveInfo = await getInfo(this.channelId);
|
|
108
108
|
const { owner, title, roomId } = liveInfo;
|
|
109
109
|
this.liveInfo = liveInfo;
|
|
@@ -185,6 +185,7 @@ const checkLiveStatusAndRecord = async function ({ getSavePath, isManualStart, b
|
|
|
185
185
|
getSavePath: (opts) => getSavePath({ owner, title, startTime: opts.startTime }),
|
|
186
186
|
isHls: streamOptions.protocol_name === "http_hls",
|
|
187
187
|
disableDanma: this.disableProvideCommentsWhenRecording,
|
|
188
|
+
videoFormat: this.videoFormat,
|
|
188
189
|
}, onEnd);
|
|
189
190
|
const savePath = getSavePath({
|
|
190
191
|
owner,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bililive-tools/bilibili-recorder",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "bililive-tools bilibili recorder implemention",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"tiny-bilibili-ws": "^1.0.1",
|
|
40
40
|
"lodash-es": "^4.17.21",
|
|
41
41
|
"axios": "^1.7.8",
|
|
42
|
-
"@bililive-tools/manager": "^1.
|
|
42
|
+
"@bililive-tools/manager": "^1.2.0"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "tsc",
|