@bililive-tools/douyin-recorder 1.12.3 → 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.
Files changed (2) hide show
  1. package/lib/index.js +3 -16
  2. package/package.json +3 -3
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) {
@@ -428,7 +415,7 @@ const checkLiveStatusAndRecord = async function ({ getSavePath, banLiveId, isMan
428
415
  recorderType: downloader.type,
429
416
  url: stream.url,
430
417
  downloaderArgs,
431
- savePath: savePath,
418
+ savePath: downloader.videoFilePath,
432
419
  stop,
433
420
  cut,
434
421
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bililive-tools/douyin-recorder",
3
- "version": "1.12.3",
3
+ "version": "1.16.0",
4
4
  "description": "@bililive-tools douyin recorder implemention",
5
5
  "main": "./lib/index.js",
6
6
  "type": "module",
@@ -38,8 +38,8 @@
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.14.1",
42
- "douyin-danma-listener": "0.4.1"
41
+ "douyin-danma-listener": "0.4.1",
42
+ "@bililive-tools/manager": "^1.16.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/node": "*"