@bililive-tools/huya-recorder 1.6.0 → 1.7.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 +12 -6
- package/package.json +3 -3
package/lib/index.js
CHANGED
|
@@ -77,10 +77,16 @@ const ffmpegInputOptions = [
|
|
|
77
77
|
const checkLiveStatusAndRecord = async function ({ getSavePath, banLiveId, isManualStart, }) {
|
|
78
78
|
if (this.recordHandle != null)
|
|
79
79
|
return this.recordHandle;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
try {
|
|
81
|
+
const liveInfo = await getInfo(this.channelId);
|
|
82
|
+
this.liveInfo = liveInfo;
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
this.state = "check-error";
|
|
86
|
+
throw error;
|
|
87
|
+
}
|
|
88
|
+
const { living, owner, title } = this.liveInfo;
|
|
89
|
+
if (this.liveInfo.liveId === banLiveId) {
|
|
84
90
|
this.tempStopIntervalCheck = true;
|
|
85
91
|
}
|
|
86
92
|
else {
|
|
@@ -116,7 +122,7 @@ const checkLiveStatusAndRecord = async function ({ getSavePath, banLiveId, isMan
|
|
|
116
122
|
catch (err) {
|
|
117
123
|
if (this.qualityRetry > 0)
|
|
118
124
|
this.qualityRetry -= 1;
|
|
119
|
-
this.state = "
|
|
125
|
+
this.state = "check-error";
|
|
120
126
|
throw err;
|
|
121
127
|
}
|
|
122
128
|
this.state = "recording";
|
|
@@ -178,7 +184,7 @@ const checkLiveStatusAndRecord = async function ({ getSavePath, banLiveId, isMan
|
|
|
178
184
|
extraDataController?.setMeta({
|
|
179
185
|
room_id: this.channelId,
|
|
180
186
|
platform: provider?.id,
|
|
181
|
-
liveStartTimestamp: liveInfo
|
|
187
|
+
liveStartTimestamp: this?.liveInfo?.startTime?.getTime(),
|
|
182
188
|
// recordStopTimestamp: Date.now(),
|
|
183
189
|
title: title,
|
|
184
190
|
user_name: owner,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bililive-tools/huya-recorder",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "bililive-tools huya recorder implemention",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"mitt": "^3.0.1",
|
|
38
38
|
"lodash-es": "^4.17.21",
|
|
39
39
|
"axios": "^1.7.8",
|
|
40
|
-
"
|
|
41
|
-
"
|
|
40
|
+
"huya-danma-listener": "0.1.2",
|
|
41
|
+
"@bililive-tools/manager": "^1.6.1"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {},
|
|
44
44
|
"scripts": {
|