@bililive-tools/douyin-recorder 1.12.2 → 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 CHANGED
@@ -2,7 +2,7 @@ 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, singleton } from "./utils.js";
5
+ import { singleton } from "./utils.js";
6
6
  import { resolveShortURL, parseUser } from "./douyin_api.js";
7
7
  import DouYinDanmaClient from "douyin-danma-listener";
8
8
  function createRecorder(opts) {
@@ -164,6 +164,7 @@ const checkLiveStatusAndRecord = async function ({ getSavePath, banLiveId, isMan
164
164
  startTime: opts.startTime,
165
165
  liveStartTime: liveStartTime,
166
166
  recordStartTime,
167
+ extraMs: opts.extraMs,
167
168
  }),
168
169
  disableDanma: this.disableProvideCommentsWhenRecording,
169
170
  videoFormat: this.videoFormat ?? "auto",
@@ -178,20 +179,6 @@ const checkLiveStatusAndRecord = async function ({ getSavePath, banLiveId, isMan
178
179
  });
179
180
  return info;
180
181
  });
181
- const savePath = getSavePath({
182
- owner,
183
- title,
184
- startTime: Date.now(),
185
- liveStartTime,
186
- recordStartTime,
187
- });
188
- try {
189
- ensureFolderExist(savePath);
190
- }
191
- catch (err) {
192
- this.state = "idle";
193
- throw err;
194
- }
195
182
  const handleVideoCreated = async ({ filename, title, cover, rawFilename }) => {
196
183
  this.emit("videoFileCreated", { filename, cover, rawFilename });
197
184
  if (title && this?.liveInfo) {
@@ -253,7 +240,6 @@ const checkLiveStatusAndRecord = async function ({ getSavePath, banLiveId, isMan
253
240
  // },
254
241
  },
255
242
  };
256
- console.log("Message", JSON.stringify(msg), null, 2);
257
243
  this.emit("Message", comment);
258
244
  extraDataController.addMessage(comment);
259
245
  });
@@ -429,7 +415,7 @@ const checkLiveStatusAndRecord = async function ({ getSavePath, banLiveId, isMan
429
415
  recorderType: downloader.type,
430
416
  url: stream.url,
431
417
  downloaderArgs,
432
- savePath: savePath,
418
+ savePath: downloader.videoFilePath,
433
419
  stop,
434
420
  cut,
435
421
  };
package/lib/stream.d.ts CHANGED
@@ -16,6 +16,7 @@ export declare function getInfo(channelId: string, opts?: {
16
16
  api: RealAPIType;
17
17
  liveStartTime: Date;
18
18
  recordStartTime: Date;
19
+ area: string;
19
20
  }>;
20
21
  export declare function getStream(opts: Pick<Recorder, "channelId" | "quality" | "streamPriorities" | "sourcePriorities"> & {
21
22
  rejectCache?: boolean;
package/lib/stream.js CHANGED
@@ -25,6 +25,7 @@ export async function getInfo(channelId, opts) {
25
25
  api: info.api,
26
26
  liveStartTime: startTime,
27
27
  recordStartTime: startTime,
28
+ area: info.area ?? "",
28
29
  };
29
30
  }
30
31
  export async function getStream(opts) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bililive-tools/douyin-recorder",
3
- "version": "1.12.2",
3
+ "version": "1.16.0",
4
4
  "description": "@bililive-tools douyin recorder implemention",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
@@ -34,12 +34,12 @@
34
34
  "author": "WhiteMind",
35
35
  "license": "LGPL",
36
36
  "dependencies": {
37
- "axios": "^1.7.8",
37
+ "axios": "^1.15.0",
38
38
  "lodash-es": "^4.17.21",
39
39
  "mitt": "^3.0.1",
40
40
  "sm-crypto": "^0.3.13",
41
- "@bililive-tools/manager": "^1.13.0",
42
- "douyin-danma-listener": "0.4.0"
41
+ "douyin-danma-listener": "0.4.1",
42
+ "@bililive-tools/manager": "^1.16.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/node": "*"