bililive-cli 3.20.0 → 3.21.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/{fileFromPath-Cqq5W5LP.cjs → fileFromPath-CXG-E0Z1.cjs} +3 -3
- package/lib/{index-RwUbYTSt.cjs → index-BC-o_4nM.cjs} +1734 -2128
- package/lib/{index-DTguSku6.cjs → index-CNjM3nfn.cjs} +32 -12
- package/lib/index.cjs +3 -3
- package/lib/{linux-B_JvwbpW.cjs → linux-DNsQQ17L.cjs} +2 -2
- package/package.json +7 -5
|
@@ -4,7 +4,7 @@ var path$3 = require('node:path');
|
|
|
4
4
|
var http$4 = require('node:http');
|
|
5
5
|
var urlLib = require('node:url');
|
|
6
6
|
var https = require('node:https');
|
|
7
|
-
var index$1 = require('./index-
|
|
7
|
+
var index$1 = require('./index-BC-o_4nM.cjs');
|
|
8
8
|
var require$$0$5 = require('tty');
|
|
9
9
|
var require$$1$4 = require('util');
|
|
10
10
|
var require$$0$b = require('assert');
|
|
@@ -26,8 +26,8 @@ var require$$1$6 = require('os');
|
|
|
26
26
|
var require$$1$1 = require('node:child_process');
|
|
27
27
|
var crypto$3 = require('node:crypto');
|
|
28
28
|
var fs$6 = require('node:fs');
|
|
29
|
+
require('node:module');
|
|
29
30
|
var EventEmitter$4 = require('node:events');
|
|
30
|
-
require('ntsuspend');
|
|
31
31
|
require('node:readline');
|
|
32
32
|
require('@napi-rs/canvas');
|
|
33
33
|
require('better-sqlite3');
|
|
@@ -30041,8 +30041,11 @@ router$h.post("/webhook/bililiverecorder", async (ctx) => {
|
|
|
30041
30041
|
return;
|
|
30042
30042
|
}
|
|
30043
30043
|
const roomId = event.EventData.RoomId;
|
|
30044
|
-
|
|
30045
|
-
|
|
30044
|
+
let recoderFolder = config.webhook.recoderFolder;
|
|
30045
|
+
if (isDocker && !config.webhook.recoderFolder) {
|
|
30046
|
+
// 如果是docker,且不存在recoderFolder参数,那么修改默认值
|
|
30047
|
+
recoderFolder = "/app/video";
|
|
30048
|
+
}
|
|
30046
30049
|
const filePath = path$3.join(recoderFolder, event.EventData.RelativePath);
|
|
30047
30050
|
index$1.logObj.info("录播姬文件路径:", filePath, recoderFolder);
|
|
30048
30051
|
handler.handle({
|
|
@@ -62603,7 +62606,7 @@ class MultipartBody {
|
|
|
62603
62606
|
let fileFromPathWarned = false;
|
|
62604
62607
|
async function fileFromPath(path, ...args) {
|
|
62605
62608
|
// this import fails in environments that don't handle export maps correctly, like old versions of Jest
|
|
62606
|
-
const { fileFromPath: _fileFromPath } = await Promise.resolve().then(function () { return require('./fileFromPath-
|
|
62609
|
+
const { fileFromPath: _fileFromPath } = await Promise.resolve().then(function () { return require('./fileFromPath-CXG-E0Z1.cjs'); });
|
|
62607
62610
|
if (!fileFromPathWarned) {
|
|
62608
62611
|
console.warn(`fileFromPath is deprecated; use fs.createReadStream(${JSON.stringify(path)}) instead`);
|
|
62609
62612
|
fileFromPathWarned = true;
|
|
@@ -68770,7 +68773,7 @@ class QwenLLM {
|
|
|
68770
68773
|
this.client = new OpenAI({
|
|
68771
68774
|
apiKey: config.apiKey,
|
|
68772
68775
|
baseURL: config.baseURL || "https://dashscope.aliyuncs.com/compatible-mode/v1",
|
|
68773
|
-
timeout: config.timeout ||
|
|
68776
|
+
timeout: config.timeout || 300000,
|
|
68774
68777
|
});
|
|
68775
68778
|
this.model = config.model || "qwen-plus";
|
|
68776
68779
|
}
|
|
@@ -73203,7 +73206,13 @@ async function recognize(file, lyricOptimize) {
|
|
|
73203
73206
|
// console.log("Shazam 识别结果:", JSON.stringify(result, null, 2));
|
|
73204
73207
|
if (!result)
|
|
73205
73208
|
return null;
|
|
73206
|
-
|
|
73209
|
+
let info = null;
|
|
73210
|
+
try {
|
|
73211
|
+
info = await shazamQueryInfo(result.trackId);
|
|
73212
|
+
}
|
|
73213
|
+
catch (error) {
|
|
73214
|
+
console.error("Shazam 查询信息失败:", error);
|
|
73215
|
+
}
|
|
73207
73216
|
const appleMusicId = result.appleMusicId || info?.appleMusicId;
|
|
73208
73217
|
const title = info?.title || result.title;
|
|
73209
73218
|
const subtitle = info?.subtitle || "";
|
|
@@ -73379,6 +73388,7 @@ async function optimizeLyrics(asrData, lyrics, offset) {
|
|
|
73379
73388
|
temperature: 0.5,
|
|
73380
73389
|
enableSearch: false,
|
|
73381
73390
|
responseFormat: enableStructuredOutput ? { type: "json_object" } : undefined,
|
|
73391
|
+
enableThinking: false,
|
|
73382
73392
|
});
|
|
73383
73393
|
index$1.logObj.info("优化结果:", response);
|
|
73384
73394
|
if (!response.content) {
|
|
@@ -73471,6 +73481,7 @@ async function recognizeSongNameWithLLM(asrText, vendorId, options) {
|
|
|
73471
73481
|
enableSearch: options.enableSearch,
|
|
73472
73482
|
responseFormat: options.enableStructuredOutput ? { type: "json_object" } : undefined,
|
|
73473
73483
|
temperature: 0.6,
|
|
73484
|
+
enableThinking: false,
|
|
73474
73485
|
searchOptions: {
|
|
73475
73486
|
forcedSearch: options.enableSearch,
|
|
73476
73487
|
search_strategy: "max",
|
|
@@ -74035,7 +74046,7 @@ router$a.get("/ws/danma-test", async (ctx) => {
|
|
|
74035
74046
|
};
|
|
74036
74047
|
});
|
|
74037
74048
|
router$a.post("/add", async (ctx) => {
|
|
74038
|
-
const args = index$1.pick((ctx.request.body ?? {}), "providerId", "channelId", "remarks", "disableAutoCheck", "quality", "streamPriorities", "sourcePriorities", "extra", "noGlobalFollowFields", "line", "disableProvideCommentsWhenRecording", "saveGiftDanma", "saveSCDanma", "segment", "sendToWebhook", "uid", "saveCover", "convert2Mp4", "qualityRetry", "formatName", "useM3U8Proxy", "customHost", "codecName", "titleKeywords", "liveStartNotification", "chargeLiveNotification", "liveEndNotification", "weight", "source", "videoFormat", "recorderType", "cookie", "doubleScreen", "onlyAudio", "useServerTimestamp", "handleTime", "debugLevel", "api");
|
|
74049
|
+
const args = index$1.pick((ctx.request.body ?? {}), "providerId", "channelId", "remarks", "disableAutoCheck", "quality", "streamPriorities", "sourcePriorities", "extra", "noGlobalFollowFields", "line", "disableProvideCommentsWhenRecording", "saveGiftDanma", "saveSCDanma", "segment", "sendToWebhook", "uid", "saveCover", "convert2Mp4", "qualityRetry", "formatName", "useM3U8Proxy", "customHost", "codecName", "titleKeywords", "segmentOnTitleChange", "liveStartNotification", "chargeLiveNotification", "liveEndNotification", "weight", "source", "videoFormat", "recorderType", "cookie", "doubleScreen", "onlyAudio", "useServerTimestamp", "handleTime", "debugLevel", "api");
|
|
74039
74050
|
const data = await recorderService.addRecorder(args);
|
|
74040
74051
|
ctx.body = { payload: data };
|
|
74041
74052
|
});
|
|
@@ -74064,7 +74075,7 @@ router$a.post("/:id/stream", async (ctx) => {
|
|
|
74064
74075
|
});
|
|
74065
74076
|
router$a.put("/:id", (ctx) => {
|
|
74066
74077
|
const { id } = ctx.params;
|
|
74067
|
-
const patch = index$1.pick(ctx.request.body, "remarks", "disableAutoCheck", "quality", "streamPriorities", "sourcePriorities", "noGlobalFollowFields", "line", "disableProvideCommentsWhenRecording", "saveGiftDanma", "saveSCDanma", "saveCover", "segment", "sendToWebhook", "uid", "qualityRetry", "formatName", "useM3U8Proxy", "customHost", "codecName", "titleKeywords", "liveStartNotification", "chargeLiveNotification", "liveEndNotification", "weight", "source", "videoFormat", "recorderType", "cookie", "doubleScreen", "onlyAudio", "useServerTimestamp", "handleTime", "debugLevel", "convert2Mp4", "api");
|
|
74078
|
+
const patch = index$1.pick(ctx.request.body, "remarks", "disableAutoCheck", "quality", "streamPriorities", "sourcePriorities", "noGlobalFollowFields", "line", "disableProvideCommentsWhenRecording", "saveGiftDanma", "saveSCDanma", "saveCover", "segment", "sendToWebhook", "uid", "qualityRetry", "formatName", "useM3U8Proxy", "customHost", "codecName", "titleKeywords", "segmentOnTitleChange", "liveStartNotification", "chargeLiveNotification", "liveEndNotification", "weight", "source", "videoFormat", "recorderType", "cookie", "doubleScreen", "onlyAudio", "useServerTimestamp", "handleTime", "debugLevel", "convert2Mp4", "api");
|
|
74068
74079
|
ctx.body = { payload: recorderService.updateRecorder({ id, ...patch }) };
|
|
74069
74080
|
});
|
|
74070
74081
|
/**
|
|
@@ -74350,6 +74361,11 @@ router$9.get("/seasons", async (ctx) => {
|
|
|
74350
74361
|
const data = await index$1.biliApi.getSeasonList(uid);
|
|
74351
74362
|
ctx.body = data;
|
|
74352
74363
|
});
|
|
74364
|
+
router$9.get("/reserveList", async (ctx) => {
|
|
74365
|
+
const { uid } = ctx.request.query;
|
|
74366
|
+
const data = await index$1.biliApi.getReserveList(uid);
|
|
74367
|
+
ctx.body = data;
|
|
74368
|
+
});
|
|
74353
74369
|
router$9.get("/season/:aid", async (ctx) => {
|
|
74354
74370
|
const { uid } = ctx.request.query;
|
|
74355
74371
|
const { aid } = ctx.params;
|
|
@@ -76808,6 +76824,7 @@ async function subtitleRecognize(file, modelId, options) {
|
|
|
76808
76824
|
fillGap,
|
|
76809
76825
|
disableCache,
|
|
76810
76826
|
song: options?.song,
|
|
76827
|
+
modelId,
|
|
76811
76828
|
});
|
|
76812
76829
|
try {
|
|
76813
76830
|
// 生成缓存路径
|
|
@@ -76917,8 +76934,11 @@ router$1.post("/subtitle", async (ctx) => {
|
|
|
76917
76934
|
};
|
|
76918
76935
|
return;
|
|
76919
76936
|
}
|
|
76920
|
-
|
|
76921
|
-
|
|
76937
|
+
let asrModelId = data.modelId;
|
|
76938
|
+
if (!asrModelId) {
|
|
76939
|
+
const config = index$1.appConfig.get("ai") || {};
|
|
76940
|
+
asrModelId = config.subtitleRecognize.modelId;
|
|
76941
|
+
}
|
|
76922
76942
|
if (!asrModelId) {
|
|
76923
76943
|
throw new Error("请先在配置中设置字幕识别ASR模型");
|
|
76924
76944
|
}
|
|
@@ -79238,7 +79258,7 @@ let handler;
|
|
|
79238
79258
|
let appConfig;
|
|
79239
79259
|
let container;
|
|
79240
79260
|
const fileCache = createFileCache();
|
|
79241
|
-
path$3.dirname(urlLib.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-
|
|
79261
|
+
path$3.dirname(urlLib.fileURLToPath((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index-CNjM3nfn.cjs', document.baseURI).href))));
|
|
79242
79262
|
const authMiddleware = (passKey) => {
|
|
79243
79263
|
return async (ctx, next) => {
|
|
79244
79264
|
const authHeader = ctx.headers["authorization"] || ctx.request.query.auth;
|
package/lib/index.cjs
CHANGED
|
@@ -3715,7 +3715,7 @@ const {
|
|
|
3715
3715
|
Help,
|
|
3716
3716
|
} = commander;
|
|
3717
3717
|
|
|
3718
|
-
var version = "3.
|
|
3718
|
+
var version = "3.21.0";
|
|
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-
|
|
3745
|
-
const { serverStart } = await Promise.resolve().then(function () { return require('./index-
|
|
3744
|
+
const { init } = await Promise.resolve().then(function () { return require('./index-BC-o_4nM.cjs'); }).then(function (n) { return n.index; });
|
|
3745
|
+
const { serverStart } = await Promise.resolve().then(function () { return require('./index-CNjM3nfn.cjs'); }).then(function (n) { return n.index; });
|
|
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-
|
|
7
|
+
var index = require('./index-BC-o_4nM.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');
|
|
@@ -30,7 +30,7 @@ require('crypto');
|
|
|
30
30
|
require('http2');
|
|
31
31
|
require('tty');
|
|
32
32
|
require('zlib');
|
|
33
|
-
require('
|
|
33
|
+
require('node:module');
|
|
34
34
|
require('node:readline');
|
|
35
35
|
require('node:https');
|
|
36
36
|
require('node:url');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bililive-cli",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.21.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "biliLive-tools的cli程序",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -26,11 +26,13 @@
|
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@napi-rs/canvas": "^0.1.60",
|
|
28
28
|
"font-ls": "0.6.6",
|
|
29
|
-
"ntsuspend": "^1.0.2",
|
|
30
29
|
"better-sqlite3": "12.11.1",
|
|
31
30
|
"shazamio-core": "^1.3.1",
|
|
32
31
|
"music-segment-detector": "^0.3.1"
|
|
33
32
|
},
|
|
33
|
+
"optionalDependencies": {
|
|
34
|
+
"ntsuspend": "^1.0.2"
|
|
35
|
+
},
|
|
34
36
|
"devDependencies": {
|
|
35
37
|
"@types/cli-progress": "^3.11.6",
|
|
36
38
|
"@yao-pkg/pkg": "^6.1.1",
|
|
@@ -39,9 +41,9 @@
|
|
|
39
41
|
"commander": "^12.1.0",
|
|
40
42
|
"rimraf": "^6.0.1",
|
|
41
43
|
"tsx": "^4.19.2",
|
|
42
|
-
"@biliLive-tools/
|
|
43
|
-
"@biliLive-tools/types": "3.
|
|
44
|
-
"@biliLive-tools/
|
|
44
|
+
"@biliLive-tools/shared": "3.21.0",
|
|
45
|
+
"@biliLive-tools/types": "3.21.0",
|
|
46
|
+
"@biliLive-tools/http": "3.21.0"
|
|
45
47
|
},
|
|
46
48
|
"scripts": {
|
|
47
49
|
"start": "tsx src/index.ts",
|