@bililive-tools/huya-recorder 1.15.0 → 1.16.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/index.js +2 -16
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -2,7 +2,6 @@ import path from "node:path";
|
|
|
2
2
|
import mitt from "mitt";
|
|
3
3
|
import { defaultFromJSON, defaultToJSON, genRecorderUUID, genRecordUUID, utils, createDownloader, } from "@bililive-tools/manager";
|
|
4
4
|
import { getInfo, getStream } from "./stream.js";
|
|
5
|
-
import { ensureFolderExist } from "./utils.js";
|
|
6
5
|
import HuYaDanMu from "huya-danma-listener";
|
|
7
6
|
function createRecorder(opts) {
|
|
8
7
|
// 内部实现时,应该只有 proxy 包裹的那一层会使用这个 recorder 标识符,不应该有直接通过
|
|
@@ -146,6 +145,7 @@ const checkLiveStatusAndRecord = async function ({ getSavePath, banLiveId, isMan
|
|
|
146
145
|
startTime: opts.startTime,
|
|
147
146
|
liveStartTime,
|
|
148
147
|
recordStartTime,
|
|
148
|
+
extraMs: opts.extraMs,
|
|
149
149
|
}),
|
|
150
150
|
disableDanma: this.disableProvideCommentsWhenRecording,
|
|
151
151
|
videoFormat: this.videoFormat ?? "auto",
|
|
@@ -157,20 +157,6 @@ const checkLiveStatusAndRecord = async function ({ getSavePath, banLiveId, isMan
|
|
|
157
157
|
const info = await getInfo(this.channelId);
|
|
158
158
|
return info;
|
|
159
159
|
});
|
|
160
|
-
const savePath = getSavePath({
|
|
161
|
-
owner,
|
|
162
|
-
title,
|
|
163
|
-
startTime: Date.now(),
|
|
164
|
-
liveStartTime,
|
|
165
|
-
recordStartTime,
|
|
166
|
-
});
|
|
167
|
-
try {
|
|
168
|
-
ensureFolderExist(savePath);
|
|
169
|
-
}
|
|
170
|
-
catch (err) {
|
|
171
|
-
this.state = "idle";
|
|
172
|
-
throw err;
|
|
173
|
-
}
|
|
174
160
|
const handleVideoCreated = async ({ filename, title, cover, rawFilename }) => {
|
|
175
161
|
this.emit("videoFileCreated", { filename, cover, rawFilename });
|
|
176
162
|
if (title && this?.liveInfo) {
|
|
@@ -299,7 +285,7 @@ const checkLiveStatusAndRecord = async function ({ getSavePath, banLiveId, isMan
|
|
|
299
285
|
recorderType: downloader.type,
|
|
300
286
|
url: stream.url,
|
|
301
287
|
downloaderArgs,
|
|
302
|
-
savePath:
|
|
288
|
+
savePath: downloader.videoFilePath,
|
|
303
289
|
stop,
|
|
304
290
|
cut,
|
|
305
291
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bililive-tools/huya-recorder",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"description": "bililive-tools huya recorder implemention",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -38,8 +38,8 @@
|
|
|
38
38
|
"axios": "^1.15.0",
|
|
39
39
|
"lodash-es": "^4.17.21",
|
|
40
40
|
"mitt": "^3.0.1",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
41
|
+
"huya-danma-listener": "0.1.4",
|
|
42
|
+
"@bililive-tools/manager": "^1.16.0"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "tsc",
|