@bililive-tools/huya-recorder 1.13.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/huya_api.d.ts CHANGED
@@ -17,4 +17,5 @@ export declare function getRoomInfo(roomIdOrShortId: string, opts?: {
17
17
  startTime: Date;
18
18
  liveId: string;
19
19
  gid: number;
20
+ area: string;
20
21
  }>;
package/lib/huya_api.js CHANGED
@@ -93,5 +93,6 @@ export async function getRoomInfo(roomIdOrShortId, opts = {}) {
93
93
  startTime,
94
94
  liveId: utils.md5(`${roomIdOrShortId}-${startTime?.getTime()}`),
95
95
  gid: data.gameLiveInfo.gid,
96
+ area: data.gameLiveInfo.gameFullName,
96
97
  };
97
98
  }
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: savePath,
288
+ savePath: downloader.videoFilePath,
303
289
  stop,
304
290
  cut,
305
291
  };
@@ -1,2 +1 @@
1
- import axios from "axios";
2
- export declare const requester: axios.AxiosInstance;
1
+ export declare const requester: import("axios").AxiosInstance;
package/lib/stream.d.ts CHANGED
@@ -10,6 +10,7 @@ export declare function getInfo(channelId: string): Promise<{
10
10
  liveStartTime: Date;
11
11
  liveId: string;
12
12
  recordStartTime: Date;
13
+ area: string;
13
14
  }>;
14
15
  export declare function getStream(opts: Pick<Recorder, "channelId" | "quality" | "streamPriorities" | "sourcePriorities" | "api" | "formatPriorities"> & {
15
16
  strictQuality?: boolean;
package/lib/stream.js CHANGED
@@ -17,6 +17,7 @@ export async function getInfo(channelId) {
17
17
  liveStartTime: info.startTime,
18
18
  liveId: info.liveId,
19
19
  recordStartTime: recordStartTime,
20
+ area: info.area,
20
21
  };
21
22
  }
22
23
  async function getRoomInfo(channelId, options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bililive-tools/huya-recorder",
3
- "version": "1.13.0",
3
+ "version": "1.16.0",
4
4
  "description": "bililive-tools huya recorder implemention",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
@@ -35,11 +35,11 @@
35
35
  "license": "LGPL",
36
36
  "dependencies": {
37
37
  "@tars/stream": "^2.0.3",
38
- "axios": "^1.7.8",
38
+ "axios": "^1.15.0",
39
39
  "lodash-es": "^4.17.21",
40
40
  "mitt": "^3.0.1",
41
- "@bililive-tools/manager": "^1.13.0",
42
- "huya-danma-listener": "0.1.4"
41
+ "huya-danma-listener": "0.1.4",
42
+ "@bililive-tools/manager": "^1.16.0"
43
43
  },
44
44
  "scripts": {
45
45
  "build": "tsc",