@bililive-tools/douyu-recorder 1.3.0 → 1.4.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/dy_api.d.ts +1 -0
- package/lib/dy_api.js +2 -0
- package/lib/index.js +2 -1
- package/lib/stream.d.ts +1 -0
- package/lib/stream.js +2 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/lib/dy_api.d.ts
CHANGED
package/lib/dy_api.js
CHANGED
|
@@ -21,6 +21,8 @@ export async function getLiveInfo(opts) {
|
|
|
21
21
|
cdn: opts.cdn ?? "",
|
|
22
22
|
// 相当于清晰度类型的 id,给 -1 会由后端决定,0为原画
|
|
23
23
|
rate: String(opts.rate ?? 0),
|
|
24
|
+
// 是否只录制音频
|
|
25
|
+
fa: opts.onlyAudio ? "1" : "0",
|
|
24
26
|
}));
|
|
25
27
|
if (res.status !== 200) {
|
|
26
28
|
if (res.status === 403 && res.data === "鉴权失败" && !opts.rejectSignFnCache) {
|
package/lib/index.js
CHANGED
|
@@ -155,6 +155,7 @@ const checkLiveStatusAndRecord = async function ({ getSavePath, banLiveId, isMan
|
|
|
155
155
|
quality: this.quality,
|
|
156
156
|
source: this.source,
|
|
157
157
|
strictQuality,
|
|
158
|
+
onlyAudio: this.onlyAudio,
|
|
158
159
|
});
|
|
159
160
|
}
|
|
160
161
|
catch (err) {
|
|
@@ -220,7 +221,7 @@ const checkLiveStatusAndRecord = async function ({ getSavePath, banLiveId, isMan
|
|
|
220
221
|
room_id: this.channelId,
|
|
221
222
|
platform: provider?.id,
|
|
222
223
|
liveStartTimestamp: liveInfo.startTime?.getTime(),
|
|
223
|
-
recordStopTimestamp: Date.now(),
|
|
224
|
+
// recordStopTimestamp: Date.now(),
|
|
224
225
|
title: title,
|
|
225
226
|
user_name: owner,
|
|
226
227
|
});
|
package/lib/stream.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export declare function getStream(opts: Pick<Recorder, "channelId" | "quality">
|
|
|
12
12
|
rejectCache?: boolean;
|
|
13
13
|
strictQuality?: boolean;
|
|
14
14
|
source?: string;
|
|
15
|
+
onlyAudio?: boolean;
|
|
15
16
|
}): Promise<{
|
|
16
17
|
living: true;
|
|
17
18
|
sources: import("./dy_api.js").SourceProfile[];
|
package/lib/stream.js
CHANGED
|
@@ -48,6 +48,7 @@ export async function getStream(opts) {
|
|
|
48
48
|
channelId: opts.channelId,
|
|
49
49
|
rate: qn,
|
|
50
50
|
cdn: opts.source === "auto" ? undefined : opts.source,
|
|
51
|
+
onlyAudio: opts.onlyAudio,
|
|
51
52
|
});
|
|
52
53
|
if (!liveInfo.living)
|
|
53
54
|
throw new Error("It must be called getStream when living");
|
|
@@ -68,6 +69,7 @@ export async function getStream(opts) {
|
|
|
68
69
|
liveInfo = await getLiveInfo({
|
|
69
70
|
channelId: opts.channelId,
|
|
70
71
|
rate: liveInfo.streams[0].rate,
|
|
72
|
+
onlyAudio: opts.onlyAudio,
|
|
71
73
|
});
|
|
72
74
|
if (!liveInfo.living)
|
|
73
75
|
throw new Error("It must be called getStream when living");
|