bililive-cli 3.10.1 → 3.10.2

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.
@@ -4,7 +4,7 @@ var path$7 = require('node:path');
4
4
  var require$$2$1 = require('node:http');
5
5
  var require$$1$2 = require('node:url');
6
6
  var a = require('node:https');
7
- var index = require('./index-CuJEbURl.cjs');
7
+ var index = require('./index-CRFwDTYd.cjs');
8
8
  var require$$0$4 = require('tty');
9
9
  var require$$1$3 = require('util');
10
10
  var require$$0$b = require('assert');
@@ -80740,9 +80740,9 @@ class WebhookHandler {
80740
80740
  });
80741
80741
  return this.handleUploadTask(task, pathArray);
80742
80742
  };
80743
- addEditMediaTask = async (uid, aid, pathArray, limitedUploadTime, afterUploadDeletAction) => {
80743
+ addEditMediaTask = async (uid, aid, pathArray, uploadPreset, limitedUploadTime, afterUploadDeletAction) => {
80744
80744
  const checkCallback = this.setupDeleteAfterCheckLock(pathArray);
80745
- const task = await index.biliApi.editMedia(aid, pathArray, {}, uid, {
80745
+ const task = await index.biliApi.editMedia(aid, pathArray, uploadPreset, uid, {
80746
80746
  limitedUploadTime,
80747
80747
  afterUploadDeletAction: "none",
80748
80748
  forceCheck: afterUploadDeletAction === "deleteAfterCheck",
@@ -80866,13 +80866,13 @@ class WebhookHandler {
80866
80866
  * 执行续传操作
80867
80867
  * @private
80868
80868
  */
80869
- async performContinueUpload(live, aid, filePaths, type, config, limitedUploadTime) {
80869
+ async performContinueUpload(live, aid, filePaths, type, config, uploadPreset, limitedUploadTime) {
80870
80870
  index.logObj.info("续传", filePaths);
80871
80871
  live.batchUpdateUploadStatus(filePaths.map((item) => item.part), "uploading", type);
80872
80872
  await this.addEditMediaTask(config.uid, aid, filePaths.map((item) => ({
80873
80873
  path: item.path,
80874
80874
  title: item.title,
80875
- })), limitedUploadTime, config.afterUploadDeletAction);
80875
+ })), uploadPreset, limitedUploadTime, config.afterUploadDeletAction);
80876
80876
  live.batchUpdateUploadStatus(filePaths.map((item) => item.part), "uploaded", type);
80877
80877
  }
80878
80878
  /**
@@ -80922,7 +80922,7 @@ class WebhookHandler {
80922
80922
  try {
80923
80923
  // 8. 执行上传(续传或新上传)
80924
80924
  if (live[aidField]) {
80925
- await this.performContinueUpload(live, live[aidField], filePaths, type, config, limitedUploadTime);
80925
+ await this.performContinueUpload(live, live[aidField], filePaths, type, config, uploadPreset, limitedUploadTime);
80926
80926
  }
80927
80927
  else {
80928
80928
  await this.performNewUpload(live, filePaths, type, config, uploadPreset, limitedUploadTime);
@@ -80993,7 +80993,7 @@ exports.handler = void 0;
80993
80993
  exports.appConfig = void 0;
80994
80994
  exports.container = void 0;
80995
80995
  const fileCache = createFileCache();
80996
- path$7.dirname(require$$1$2.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-DOo0dewT.cjs', document.baseURI).href))));
80996
+ path$7.dirname(require$$1$2.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-Ba_4umAo.cjs', document.baseURI).href))));
80997
80997
  const authMiddleware = (passKey) => {
80998
80998
  return async (ctx, next) => {
80999
80999
  const authHeader = ctx.headers["authorization"] || ctx.request.query.auth;
@@ -11646,7 +11646,7 @@ const APP_DEFAULT_CONFIG = {
11646
11646
  line: undefined,
11647
11647
  checkInterval: 60,
11648
11648
  maxThreadCount: 3,
11649
- waitTime: 0,
11649
+ waitTime: 500,
11650
11650
  disableProvideCommentsWhenRecording: false,
11651
11651
  segment: "90",
11652
11652
  saveGiftDanma: false,
@@ -44555,7 +44555,7 @@ async function trash(paths, options) {
44555
44555
  } else if (process$2.platform === 'win32') {
44556
44556
  module = await Promise.resolve().then(function () { return require('./windows-OmnJ7a39.cjs'); });
44557
44557
  } else {
44558
- module = await Promise.resolve().then(function () { return require('./linux-CINV_k6s.cjs'); });
44558
+ module = await Promise.resolve().then(function () { return require('./linux-Cv3TbjgK.cjs'); });
44559
44559
  }
44560
44560
 
44561
44561
  return module.default(paths);
@@ -214068,6 +214068,22 @@ async function getRoomInfoByWeb(webRoomId, opts = {}) {
214068
214068
  "User-Agent": ua,
214069
214069
  },
214070
214070
  });
214071
+ if (res.data.status_code === 30003) {
214072
+ // 直播已结束
214073
+ return {
214074
+ living: false,
214075
+ nickname: "",
214076
+ sec_uid: "",
214077
+ avatar: "",
214078
+ api: "web",
214079
+ room: {
214080
+ title: "",
214081
+ cover: "",
214082
+ id_str: "",
214083
+ stream_url: null,
214084
+ },
214085
+ };
214086
+ }
214071
214087
  assert$i(res.data.status_code === 0, `Unexpected resp, code ${res.data.status_code}, msg ${JSON.stringify(res.data.data)}, id ${webRoomId}, cookies: ${cookies}`);
214072
214088
  const data = res.data.data;
214073
214089
  const room = data?.data?.[0];
@@ -246387,9 +246403,14 @@ const checkLiveStatusAndRecord$1 = async function ({ getSavePath, banLiveId, isM
246387
246403
  const extraDataController = downloader.getExtraDataController();
246388
246404
  if (!extraDataController)
246389
246405
  return;
246406
+ let timestamp = Date.now();
246407
+ if (this.useServerTimestamp && msg.eventTime) {
246408
+ // 某些消息可能没有 eventTime 字段
246409
+ timestamp = Number(msg.eventTime) * 1000;
246410
+ }
246390
246411
  const comment = {
246391
246412
  type: "comment",
246392
- timestamp: this.useServerTimestamp ? Number(msg.eventTime) * 1000 : Date.now(),
246413
+ timestamp: timestamp,
246393
246414
  text: msg.content,
246394
246415
  color: "#ffffff",
246395
246416
  sender: {
@@ -246401,6 +246422,7 @@ const checkLiveStatusAndRecord$1 = async function ({ getSavePath, banLiveId, isM
246401
246422
  // },
246402
246423
  },
246403
246424
  };
246425
+ console.log("Message", JSON.stringify(msg), null, 2);
246404
246426
  this.emit("Message", comment);
246405
246427
  extraDataController.addMessage(comment);
246406
246428
  });
package/lib/index.cjs CHANGED
@@ -3715,7 +3715,7 @@ const {
3715
3715
  Help,
3716
3716
  } = commander;
3717
3717
 
3718
- var version = "3.10.1";
3718
+ var version = "3.10.2";
3719
3719
 
3720
3720
  process.on("uncaughtException", function (error) {
3721
3721
  console.error(`${new Date().toISOString()} uncaughtException`, error);
@@ -3741,8 +3741,8 @@ program
3741
3741
  throw new Error(`${c.configFolder}参数不存在,请先重新运行 config gen 命令`);
3742
3742
  }
3743
3743
  // 下面两行顺序不能换(
3744
- const { init } = await Promise.resolve().then(function () { return require('./index-CuJEbURl.cjs'); }).then(function (n) { return n.index; });
3745
- const { serverStart } = await Promise.resolve().then(function () { return require('./index-DOo0dewT.cjs'); });
3744
+ const { init } = await Promise.resolve().then(function () { return require('./index-CRFwDTYd.cjs'); }).then(function (n) { return n.index; });
3745
+ const { serverStart } = await Promise.resolve().then(function () { return require('./index-Ba_4umAo.cjs'); });
3746
3746
  const globalConfig = {
3747
3747
  ffmpegPresetPath: path$1.join(c.configFolder, "ffmpeg_presets.json"),
3748
3748
  videoPresetPath: path$1.join(c.configFolder, "presets.json"),
@@ -4,7 +4,7 @@ var os$3 = require('node:os');
4
4
  var path$5 = require('node:path');
5
5
  var fs$3 = require('node:fs');
6
6
  var crypto = require('node:crypto');
7
- var index = require('./index-CuJEbURl.cjs');
7
+ var index = require('./index-CRFwDTYd.cjs');
8
8
  var require$$0$1 = require('fs');
9
9
  var require$$0 = require('path');
10
10
  var require$$0$2 = require('child_process');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bililive-cli",
3
- "version": "3.10.1",
3
+ "version": "3.10.2",
4
4
  "type": "module",
5
5
  "description": "biliLive-tools的cli程序",
6
6
  "main": "./lib/index.js",
@@ -39,9 +39,9 @@
39
39
  "commander": "^12.1.0",
40
40
  "rimraf": "^6.0.1",
41
41
  "tsx": "^4.19.2",
42
- "@biliLive-tools/http": "3.10.1",
43
- "@biliLive-tools/shared": "3.10.1",
44
- "@biliLive-tools/types": "3.10.1"
42
+ "@biliLive-tools/http": "3.10.2",
43
+ "@biliLive-tools/shared": "3.10.2",
44
+ "@biliLive-tools/types": "3.10.2"
45
45
  },
46
46
  "scripts": {
47
47
  "start": "tsx src/index.ts",