llonebot-dist 7.12.11 → 7.12.13
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/llbot.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { createRequire } from "node:module";
|
|
2
2
|
import * as path$4 from "node:path";
|
|
3
3
|
import path, { dirname, join } from "node:path";
|
|
4
|
-
import
|
|
5
|
-
import fs, { existsSync } from "fs";
|
|
6
|
-
import * as fs$
|
|
7
|
-
import fs$
|
|
4
|
+
import fs, { access, copyFile, mkdir, readFile, stat, unlink, writeFile } from "node:fs/promises";
|
|
5
|
+
import fs$1, { existsSync } from "fs";
|
|
6
|
+
import * as fs$6 from "node:fs";
|
|
7
|
+
import fs$2, { appendFile, appendFileSync, createReadStream, existsSync as existsSync$1, mkdirSync, promises, stat as stat$1, statSync, watch } from "node:fs";
|
|
8
8
|
import os from "node:os";
|
|
9
9
|
import { Binary, Time, camelize, clone, deduplicate, deepEqual, defineProperty, difference, filterKeys, hyphenate, is, isNonNullable, isNullable, isPlainObject, makeArray, mapValues, noop, omit, pick, remove, valueMap } from "cosmokit";
|
|
10
10
|
import { Exporter, Factory } from "reggol";
|
|
@@ -21,7 +21,7 @@ import http, { STATUS_CODES, createServer, request } from "node:http";
|
|
|
21
21
|
import { Http2ServerRequest, constants as constants$1 } from "node:http2";
|
|
22
22
|
import { Readable, Transform } from "node:stream";
|
|
23
23
|
import { deflateSync, gunzipSync, gzipSync, inflateSync } from "node:zlib";
|
|
24
|
-
import fsPromise
|
|
24
|
+
import fsPromise, { stat as stat$2, unlink as unlink$1 } from "fs/promises";
|
|
25
25
|
import { inspect, isDeepStrictEqual } from "node:util";
|
|
26
26
|
import net, { connect } from "node:net";
|
|
27
27
|
import https from "node:https";
|
|
@@ -3973,7 +3973,7 @@ var require_utils$1 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
3973
3973
|
//#endregion
|
|
3974
3974
|
//#region node_modules/qrcode/lib/renderer/png.js
|
|
3975
3975
|
var require_png = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
3976
|
-
var fs$
|
|
3976
|
+
var fs$11 = __require("fs");
|
|
3977
3977
|
var PNG = require_png$1().PNG;
|
|
3978
3978
|
var Utils = require_utils$1();
|
|
3979
3979
|
exports.render = function render(qrData, options) {
|
|
@@ -4025,7 +4025,7 @@ var require_png = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
4025
4025
|
called = true;
|
|
4026
4026
|
cb.apply(null, args);
|
|
4027
4027
|
};
|
|
4028
|
-
const stream = fs$
|
|
4028
|
+
const stream = fs$11.createWriteStream(path);
|
|
4029
4029
|
stream.on("error", done);
|
|
4030
4030
|
stream.on("close", done);
|
|
4031
4031
|
exports.renderToFileStream(stream, qrData, options);
|
|
@@ -6624,7 +6624,7 @@ async function logSummaryMessage(ctx, message) {
|
|
|
6624
6624
|
var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6625
6625
|
module.exports = isexe;
|
|
6626
6626
|
isexe.sync = sync;
|
|
6627
|
-
var fs$
|
|
6627
|
+
var fs$10 = __require("fs");
|
|
6628
6628
|
function checkPathExt(path, options) {
|
|
6629
6629
|
var pathext = options.pathExt !== void 0 ? options.pathExt : process.env.PATHEXT;
|
|
6630
6630
|
if (!pathext) return true;
|
|
@@ -6641,12 +6641,12 @@ var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6641
6641
|
return checkPathExt(path, options);
|
|
6642
6642
|
}
|
|
6643
6643
|
function isexe(path, options, cb) {
|
|
6644
|
-
fs$
|
|
6644
|
+
fs$10.stat(path, function(er, stat) {
|
|
6645
6645
|
cb(er, er ? false : checkStat(stat, path, options));
|
|
6646
6646
|
});
|
|
6647
6647
|
}
|
|
6648
6648
|
function sync(path, options) {
|
|
6649
|
-
return checkStat(fs$
|
|
6649
|
+
return checkStat(fs$10.statSync(path), path, options);
|
|
6650
6650
|
}
|
|
6651
6651
|
}));
|
|
6652
6652
|
//#endregion
|
|
@@ -6654,14 +6654,14 @@ var require_windows = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
6654
6654
|
var require_mode = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
6655
6655
|
module.exports = isexe;
|
|
6656
6656
|
isexe.sync = sync;
|
|
6657
|
-
var fs$
|
|
6657
|
+
var fs$9 = __require("fs");
|
|
6658
6658
|
function isexe(path, options, cb) {
|
|
6659
|
-
fs$
|
|
6659
|
+
fs$9.stat(path, function(er, stat) {
|
|
6660
6660
|
cb(er, er ? false : checkStat(stat, options));
|
|
6661
6661
|
});
|
|
6662
6662
|
}
|
|
6663
6663
|
function sync(path, options) {
|
|
6664
|
-
return checkStat(fs$
|
|
6664
|
+
return checkStat(fs$9.statSync(path), options);
|
|
6665
6665
|
}
|
|
6666
6666
|
function checkStat(stat, options) {
|
|
6667
6667
|
return stat.isFile() && checkMode(stat, options);
|
|
@@ -9153,7 +9153,7 @@ var require_processor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
9153
9153
|
//#endregion
|
|
9154
9154
|
//#region node_modules/fluent-ffmpeg/lib/capabilities.js
|
|
9155
9155
|
var require_capabilities = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
9156
|
-
var fs$
|
|
9156
|
+
var fs$8 = __require("fs");
|
|
9157
9157
|
var path$7 = __require("path");
|
|
9158
9158
|
var async = require_async();
|
|
9159
9159
|
var utils = require_utils();
|
|
@@ -9229,7 +9229,7 @@ var require_capabilities = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
9229
9229
|
proto._getFfmpegPath = function(callback) {
|
|
9230
9230
|
if ("ffmpegPath" in cache) return callback(null, cache.ffmpegPath);
|
|
9231
9231
|
async.waterfall([function(cb) {
|
|
9232
|
-
if (process.env.FFMPEG_PATH) fs$
|
|
9232
|
+
if (process.env.FFMPEG_PATH) fs$8.exists(process.env.FFMPEG_PATH, function(exists) {
|
|
9233
9233
|
if (exists) cb(null, process.env.FFMPEG_PATH);
|
|
9234
9234
|
else cb(null, "");
|
|
9235
9235
|
});
|
|
@@ -9260,7 +9260,7 @@ var require_capabilities = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
9260
9260
|
if ("ffprobePath" in cache) return callback(null, cache.ffprobePath);
|
|
9261
9261
|
async.waterfall([
|
|
9262
9262
|
function(cb) {
|
|
9263
|
-
if (process.env.FFPROBE_PATH) fs$
|
|
9263
|
+
if (process.env.FFPROBE_PATH) fs$8.exists(process.env.FFPROBE_PATH, function(exists) {
|
|
9264
9264
|
cb(null, exists ? process.env.FFPROBE_PATH : "");
|
|
9265
9265
|
});
|
|
9266
9266
|
else cb(null, "");
|
|
@@ -9278,7 +9278,7 @@ var require_capabilities = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
9278
9278
|
else if (ffmpeg.length) {
|
|
9279
9279
|
var name = utils.isWindows ? "ffprobe.exe" : "ffprobe";
|
|
9280
9280
|
var ffprobe = path$7.join(path$7.dirname(ffmpeg), name);
|
|
9281
|
-
fs$
|
|
9281
|
+
fs$8.exists(ffprobe, function(exists) {
|
|
9282
9282
|
cb(null, exists ? ffprobe : "");
|
|
9283
9283
|
});
|
|
9284
9284
|
} else cb(null, "");
|
|
@@ -9303,14 +9303,14 @@ var require_capabilities = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
9303
9303
|
if ("flvtoolPath" in cache) return callback(null, cache.flvtoolPath);
|
|
9304
9304
|
async.waterfall([
|
|
9305
9305
|
function(cb) {
|
|
9306
|
-
if (process.env.FLVMETA_PATH) fs$
|
|
9306
|
+
if (process.env.FLVMETA_PATH) fs$8.exists(process.env.FLVMETA_PATH, function(exists) {
|
|
9307
9307
|
cb(null, exists ? process.env.FLVMETA_PATH : "");
|
|
9308
9308
|
});
|
|
9309
9309
|
else cb(null, "");
|
|
9310
9310
|
},
|
|
9311
9311
|
function(flvtool, cb) {
|
|
9312
9312
|
if (flvtool.length) return cb(null, flvtool);
|
|
9313
|
-
if (process.env.FLVTOOL2_PATH) fs$
|
|
9313
|
+
if (process.env.FLVTOOL2_PATH) fs$8.exists(process.env.FLVTOOL2_PATH, function(exists) {
|
|
9314
9314
|
cb(null, exists ? process.env.FLVTOOL2_PATH : "");
|
|
9315
9315
|
});
|
|
9316
9316
|
else cb(null, "");
|
|
@@ -9815,7 +9815,7 @@ var require_ffprobe = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
9815
9815
|
//#endregion
|
|
9816
9816
|
//#region node_modules/fluent-ffmpeg/lib/recipes.js
|
|
9817
9817
|
var require_recipes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
9818
|
-
var fs$
|
|
9818
|
+
var fs$7 = __require("fs");
|
|
9819
9819
|
var path$6 = __require("path");
|
|
9820
9820
|
var PassThrough$4 = __require("stream").PassThrough;
|
|
9821
9821
|
var async = require_async();
|
|
@@ -10021,8 +10021,8 @@ var require_recipes = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
10021
10021
|
next(null, filenames);
|
|
10022
10022
|
},
|
|
10023
10023
|
function createDirectory(filenames, next) {
|
|
10024
|
-
fs$
|
|
10025
|
-
if (!exists) fs$
|
|
10024
|
+
fs$7.exists(config.folder, function(exists) {
|
|
10025
|
+
if (!exists) fs$7.mkdir(config.folder, function(err) {
|
|
10026
10026
|
if (err) next(err);
|
|
10027
10027
|
else next(null, filenames);
|
|
10028
10028
|
});
|
|
@@ -10270,7 +10270,7 @@ function setFFMpegPath(ffmpegPath) {
|
|
|
10270
10270
|
path.join(import.meta.dirname, "ffmpeg.exe"),
|
|
10271
10271
|
process.env["FFMPEG_PATH"] || ""
|
|
10272
10272
|
];
|
|
10273
|
-
for (const p of paths) if (fs$
|
|
10273
|
+
for (const p of paths) if (fs$2.existsSync(p)) {
|
|
10274
10274
|
import_fluent_ffmpeg.default.setFfmpegPath(p);
|
|
10275
10275
|
console.log("set ffmpeg successfully", p);
|
|
10276
10276
|
break;
|
|
@@ -11389,7 +11389,7 @@ var OB11HeartbeatEvent = class extends OB11BaseMetaEvent {
|
|
|
11389
11389
|
};
|
|
11390
11390
|
//#endregion
|
|
11391
11391
|
//#region src/version.ts
|
|
11392
|
-
var version$2 = "7.12.
|
|
11392
|
+
var version$2 = "7.12.13";
|
|
11393
11393
|
//#endregion
|
|
11394
11394
|
//#region node_modules/sift/es5m/index.js
|
|
11395
11395
|
/******************************************************************************
|
|
@@ -12223,7 +12223,6 @@ var OB11WebSocket = class {
|
|
|
12223
12223
|
}
|
|
12224
12224
|
const disposeHeartBeat = this.ctx.interval(() => {
|
|
12225
12225
|
const event = new OB11HeartbeatEvent(selfInfo.online, true, this.config.heartInterval);
|
|
12226
|
-
if (!matchEventFilter(this.config.filter, event)) return;
|
|
12227
12226
|
this.reply(socket, event);
|
|
12228
12227
|
}, this.config.heartInterval);
|
|
12229
12228
|
socket.on("close", () => {
|
|
@@ -12346,7 +12345,6 @@ var OB11WebSocketReverse = class {
|
|
|
12346
12345
|
const disposeHeartBeat = this.ctx.interval(() => {
|
|
12347
12346
|
if (this.wsClient) {
|
|
12348
12347
|
const event = new OB11HeartbeatEvent(selfInfo.online, true, this.config.heartInterval);
|
|
12349
|
-
if (!matchEventFilter(this.config.filter, event)) return;
|
|
12350
12348
|
this.reply(this.wsClient, event);
|
|
12351
12349
|
}
|
|
12352
12350
|
}, this.config.heartInterval);
|
|
@@ -17049,7 +17047,7 @@ var processQueue = async () => {
|
|
|
17049
17047
|
const promises = queue.splice(0, concurrency).map(async ({ filePath, resolve, reject }) => {
|
|
17050
17048
|
let handle;
|
|
17051
17049
|
try {
|
|
17052
|
-
handle = await fs$
|
|
17050
|
+
handle = await fs$6.promises.open(path$4.resolve(filePath), "r");
|
|
17053
17051
|
} catch (err) {
|
|
17054
17052
|
return reject(err);
|
|
17055
17053
|
}
|
|
@@ -17096,7 +17094,7 @@ function checkUriType(uri) {
|
|
|
17096
17094
|
if (uri.startsWith("data:")) return { type: FileUriType.DataURL };
|
|
17097
17095
|
if (uri.startsWith("http://") || uri.startsWith("https://")) return { type: FileUriType.RemoteURL };
|
|
17098
17096
|
if (uri.startsWith("file://")) return { type: FileUriType.FileURL };
|
|
17099
|
-
if (fs$
|
|
17097
|
+
if (fs$2.existsSync(uri)) return { type: FileUriType.Path };
|
|
17100
17098
|
return { type: FileUriType.Unknown };
|
|
17101
17099
|
}
|
|
17102
17100
|
async function fetchFile(url, headersInit) {
|
|
@@ -17126,7 +17124,7 @@ async function uri2local(ctx, uri, needExt) {
|
|
|
17126
17124
|
const { type } = checkUriType(uri);
|
|
17127
17125
|
if (type === FileUriType.FileURL) {
|
|
17128
17126
|
const filePath = fileURLToPath(uri);
|
|
17129
|
-
if (!fs$
|
|
17127
|
+
if (!fs$2.existsSync(filePath)) return {
|
|
17130
17128
|
success: false,
|
|
17131
17129
|
errMsg: "路径不存在",
|
|
17132
17130
|
fileName: "",
|
|
@@ -17152,12 +17150,12 @@ async function uri2local(ctx, uri, needExt) {
|
|
|
17152
17150
|
const res = await fetchFile(uri);
|
|
17153
17151
|
let fileName = randomUUID();
|
|
17154
17152
|
let filePath = path.join(TEMP_DIR, fileName);
|
|
17155
|
-
await
|
|
17153
|
+
await fs.writeFile(filePath, res.data);
|
|
17156
17154
|
if (needExt) {
|
|
17157
17155
|
const ext = (await ctx.ntFileApi.getFileType(filePath)).ext;
|
|
17158
17156
|
fileName += `.${ext}`;
|
|
17159
17157
|
const newPath = `${filePath}.${ext}`;
|
|
17160
|
-
await
|
|
17158
|
+
await fs.rename(filePath, newPath);
|
|
17161
17159
|
filePath = newPath;
|
|
17162
17160
|
}
|
|
17163
17161
|
return {
|
|
@@ -17180,11 +17178,11 @@ async function uri2local(ctx, uri, needExt) {
|
|
|
17180
17178
|
let filename = randomUUID();
|
|
17181
17179
|
let filePath = path.join(TEMP_DIR, filename);
|
|
17182
17180
|
const base64 = uri.replace(/^base64:\/\//, "");
|
|
17183
|
-
await
|
|
17181
|
+
await fs.writeFile(filePath, base64, "base64");
|
|
17184
17182
|
if (needExt) {
|
|
17185
17183
|
const ext = (await ctx.ntFileApi.getFileType(filePath)).ext;
|
|
17186
17184
|
filename += `.${ext}`;
|
|
17187
|
-
await
|
|
17185
|
+
await fs.rename(filePath, `${filePath}.${ext}`);
|
|
17188
17186
|
filePath = `${filePath}.${ext}`;
|
|
17189
17187
|
}
|
|
17190
17188
|
return {
|
|
@@ -17201,11 +17199,11 @@ async function uri2local(ctx, uri, needExt) {
|
|
|
17201
17199
|
let filename = randomUUID();
|
|
17202
17200
|
const [, _type, base64] = capture;
|
|
17203
17201
|
let filePath = path.join(TEMP_DIR, filename);
|
|
17204
|
-
await
|
|
17202
|
+
await fs.writeFile(filePath, base64, "base64");
|
|
17205
17203
|
if (needExt) {
|
|
17206
17204
|
const ext = (await ctx.ntFileApi.getFileType(filePath)).ext;
|
|
17207
17205
|
filename += `.${ext}`;
|
|
17208
|
-
await
|
|
17206
|
+
await fs.rename(filePath, `${filePath}.${ext}`);
|
|
17209
17207
|
filePath = `${filePath}.${ext}`;
|
|
17210
17208
|
}
|
|
17211
17209
|
return {
|
|
@@ -17269,13 +17267,13 @@ function getSha1HexFromBuffer(buf) {
|
|
|
17269
17267
|
}
|
|
17270
17268
|
async function getMd5HexFromFile(filePath) {
|
|
17271
17269
|
const hash = createHash("md5");
|
|
17272
|
-
const stream = fs$
|
|
17270
|
+
const stream = fs$2.createReadStream(filePath);
|
|
17273
17271
|
for await (const chunk of stream) hash.update(chunk);
|
|
17274
17272
|
return hash.digest("hex");
|
|
17275
17273
|
}
|
|
17276
17274
|
async function getSha1HexFromFile(filePath) {
|
|
17277
17275
|
const hash = createHash("sha1");
|
|
17278
|
-
const stream = fs$
|
|
17276
|
+
const stream = fs$2.createReadStream(filePath);
|
|
17279
17277
|
for await (const chunk of stream) hash.update(chunk);
|
|
17280
17278
|
return hash.digest("hex");
|
|
17281
17279
|
}
|
|
@@ -17284,13 +17282,13 @@ function getMd5BufferFromBuffer(buf) {
|
|
|
17284
17282
|
}
|
|
17285
17283
|
async function getMd5BufferFromFile(filePath) {
|
|
17286
17284
|
const hash = createHash("md5");
|
|
17287
|
-
const stream = fs$
|
|
17285
|
+
const stream = fs$2.createReadStream(filePath);
|
|
17288
17286
|
for await (const chunk of stream) hash.update(chunk);
|
|
17289
17287
|
return hash.digest();
|
|
17290
17288
|
}
|
|
17291
17289
|
async function getSha1BufferFromFile(filePath) {
|
|
17292
17290
|
const hash = createHash("sha1");
|
|
17293
|
-
const stream = fs$
|
|
17291
|
+
const stream = fs$2.createReadStream(filePath);
|
|
17294
17292
|
for await (const chunk of stream) hash.update(chunk);
|
|
17295
17293
|
return hash.digest();
|
|
17296
17294
|
}
|
|
@@ -17526,7 +17524,7 @@ async function calculateSha1StreamBytes(filePath) {
|
|
|
17526
17524
|
let bytesRead = 0;
|
|
17527
17525
|
let nextBlockBoundary = blockSize;
|
|
17528
17526
|
const byteArrayList = [];
|
|
17529
|
-
const readable = fs$
|
|
17527
|
+
const readable = fs$2.createReadStream(filePath);
|
|
17530
17528
|
for await (const chunk of readable) {
|
|
17531
17529
|
let buf;
|
|
17532
17530
|
if (tail.length > 0) {
|
|
@@ -17551,7 +17549,7 @@ async function calculateSha1StreamBytes(filePath) {
|
|
|
17551
17549
|
}
|
|
17552
17550
|
async function readAndHash10M(filePath) {
|
|
17553
17551
|
const maxSize = 10002432;
|
|
17554
|
-
const fd = await
|
|
17552
|
+
const fd = await fs.open(filePath, "r");
|
|
17555
17553
|
const buffer = Buffer.allocUnsafe(maxSize);
|
|
17556
17554
|
const { bytesRead } = await fd.read(buffer, 0, maxSize, 0);
|
|
17557
17555
|
await fd.close();
|
|
@@ -17593,13 +17591,13 @@ var TriSha1 = class {
|
|
|
17593
17591
|
};
|
|
17594
17592
|
async function calculateTriSha1(filePath, fileSize) {
|
|
17595
17593
|
const hash = new TriSha1(fileSize);
|
|
17596
|
-
const stream = fs$
|
|
17594
|
+
const stream = fs$2.createReadStream(filePath);
|
|
17597
17595
|
for await (const chunk of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CHCgQtMBKBCUAJQISgBDQA00DEzQAuaADNMBc0AGaADNABQAUAJQAlABQISgAoAKACgBaACgBKAEoAnqTQSgBRQIcKBC0xCUAJQISgBKAENADDQAmaYwzQAuaADNAC0AFABQAUAFAhKACgBKACgAoAWgAoELQAlAxKAJqk0EoAWgQooELTEFADaBCUABoENNMY00ANNAwzQAZoAXNAC0AFAC0CFoASgAoASgBKACgAoAWgQtABQAUANNAyWpNAoAKBCimIWgQUCEoASmIQ0ANNADTQMaaAEoGLmgAzQAtADhQIWgBaACgQhoASgYlACUALQIWgBaACgBKAENAyWpNBKYBQIcKBC0CEoEJTAKBCUANNADDQMQ0ANoGFAC5oAUGgBwNAhRQIWgBaAENACGgBtAwoAKAFzQIXNABmgAoAQ0DJKRoJQAtAhRQSLQIKYCUCCgBDQA00AMNAxpoGNoAM0AGaAFBoAcDQIcKBDqACgBDQAhoAQ0DEoAKADNAC5oEGaBhmgAoAkpGgUCCgQooELQIKYhKACgBKAGmgBpoGMNAxDQAlAwzQIUUAOFAhwoAcKBC0AJQAhoGNNACUAFABQAZoAXNABQAUAS0ixKACgQoNAhaYgoEFACUABoAaaAGmgYw0DENAxtABQAooEOFADhQIcKAFoASgBDQAhoGJQAUAFACUALQIKBi0CJDSLEoATNAhc0CHZpiCgQUAJQIKBjTQAhoGNNAxpoATFABigBQKAHCgBwoAWgAoAKACgBKAEoASgAoASgBaAAUAOoEONIoaTQAZoAUGmIUGgQtAgzQISgAoAQ0DGmgYlAxKACgAxQAtACigBRQAtAxaACgAoATFABigBCKAG0CEoAWgBRTAUUAf//Z", "base64");
|
|
17601
17599
|
async function getVideoInfo(filePath) {
|
|
17602
|
-
const size = fs$
|
|
17600
|
+
const size = fs$2.statSync(filePath).size;
|
|
17603
17601
|
return new Promise((resolve, reject) => {
|
|
17604
17602
|
(0, import_fluent_ffmpeg.default)(filePath).ffprobe((err, metadata) => {
|
|
17605
17603
|
if (err) reject(err);
|
|
@@ -17676,7 +17674,7 @@ function convert(ctx, input, options, outputPath) {
|
|
|
17676
17674
|
});
|
|
17677
17675
|
}
|
|
17678
17676
|
async function encodeSilk(ctx, filePath) {
|
|
17679
|
-
const file = await
|
|
17677
|
+
const file = await fs.readFile(filePath);
|
|
17680
17678
|
if (!isSilk(file)) {
|
|
17681
17679
|
ctx.logger.info(`语音文件${filePath}需要转换成silk`);
|
|
17682
17680
|
let result;
|
|
@@ -17695,7 +17693,7 @@ async function encodeSilk(ctx, filePath) {
|
|
|
17695
17693
|
"-f s16le"
|
|
17696
17694
|
] }), 24e3);
|
|
17697
17695
|
const pttPath = path.join(TEMP_DIR, randomUUID());
|
|
17698
|
-
await
|
|
17696
|
+
await fs.writeFile(pttPath, result.data);
|
|
17699
17697
|
ctx.logger.info(`语音文件${filePath}转换成功!`, pttPath, `时长:`, result.duration);
|
|
17700
17698
|
return {
|
|
17701
17699
|
converted: true,
|
|
@@ -17718,11 +17716,11 @@ async function encodeSilk(ctx, filePath) {
|
|
|
17718
17716
|
}
|
|
17719
17717
|
}
|
|
17720
17718
|
async function decodeSilk(ctx, inputFilePath, outFormat) {
|
|
17721
|
-
const { data } = await decode(await
|
|
17719
|
+
const { data } = await decode(await fs.readFile(inputFilePath), 24e3);
|
|
17722
17720
|
const tmpPath = path.join(TEMP_DIR, path.basename(inputFilePath));
|
|
17723
17721
|
const outFilePath = tmpPath + `.${outFormat}`;
|
|
17724
17722
|
const pcmFilePath = tmpPath + ".pcm";
|
|
17725
|
-
await
|
|
17723
|
+
await fs.writeFile(pcmFilePath, data);
|
|
17726
17724
|
return convert(ctx, pcmFilePath, { input: [
|
|
17727
17725
|
"-f s16le",
|
|
17728
17726
|
"-ar 24000",
|
|
@@ -24909,17 +24907,17 @@ var DownloadFile = class extends BaseAction {
|
|
|
24909
24907
|
const isRandomName = !payload.name;
|
|
24910
24908
|
const name = payload.name ? path.basename(payload.name) : randomUUID();
|
|
24911
24909
|
const filePath = path.join(TEMP_DIR, name);
|
|
24912
|
-
if (payload.base64) await fsPromise
|
|
24910
|
+
if (payload.base64) await fsPromise.writeFile(filePath, payload.base64, "base64");
|
|
24913
24911
|
else if (payload.url) {
|
|
24914
24912
|
const headers = this.getHeaders(payload.headers);
|
|
24915
24913
|
const res = await fetchFile(payload.url, headers);
|
|
24916
|
-
await fsPromise
|
|
24914
|
+
await fsPromise.writeFile(filePath, res.data);
|
|
24917
24915
|
} else throw new Error("不存在任何文件, 无法下载");
|
|
24918
|
-
if (fs.existsSync(filePath)) {
|
|
24916
|
+
if (fs$1.existsSync(filePath)) {
|
|
24919
24917
|
if (isRandomName) {
|
|
24920
24918
|
const md5 = await getMd5HexFromFile(filePath);
|
|
24921
24919
|
const newPath = path.join(TEMP_DIR, md5);
|
|
24922
|
-
await fsPromise
|
|
24920
|
+
await fsPromise.rename(filePath, newPath);
|
|
24923
24921
|
return { file: newPath };
|
|
24924
24922
|
}
|
|
24925
24923
|
return { file: filePath };
|
|
@@ -24999,24 +24997,40 @@ async function decodeMultiMessage(ctx, items, messageFormat) {
|
|
|
24999
24997
|
type: OB11MessageDataType.Text,
|
|
25000
24998
|
data: { text: element.text.str }
|
|
25001
24999
|
};
|
|
25002
|
-
else if (element.commonElem
|
|
25003
|
-
const
|
|
25004
|
-
|
|
25005
|
-
|
|
25006
|
-
|
|
25007
|
-
|
|
25008
|
-
|
|
25009
|
-
|
|
25010
|
-
|
|
25011
|
-
|
|
25012
|
-
|
|
25013
|
-
|
|
25014
|
-
|
|
25015
|
-
|
|
25016
|
-
|
|
25017
|
-
|
|
25018
|
-
|
|
25019
|
-
|
|
25000
|
+
else if (element.commonElem) {
|
|
25001
|
+
const { businessType, serviceType, pbElem } = element.commonElem;
|
|
25002
|
+
if (serviceType === 48 && (businessType === 10 || businessType === 20)) {
|
|
25003
|
+
const richMediaInfo = Media.MsgInfo.decode(pbElem);
|
|
25004
|
+
const infoBody = richMediaInfo.msgInfoBody[0];
|
|
25005
|
+
const parsedUrl = new URL("https://" + infoBody.pic.domain + infoBody.pic.urlPath + infoBody.pic.ext.originalParam);
|
|
25006
|
+
const imageAppid = parsedUrl.searchParams.get("appid");
|
|
25007
|
+
const rkeyData = await ctx.ntFileApi.rkeyManager.getRkey();
|
|
25008
|
+
const url = parsedUrl.href + (imageAppid === "1406" ? rkeyData.private_rkey : rkeyData.group_rkey);
|
|
25009
|
+
const { info } = richMediaInfo.msgInfoBody[0].index;
|
|
25010
|
+
const { pic } = richMediaInfo.extBizInfo;
|
|
25011
|
+
segment = {
|
|
25012
|
+
type: OB11MessageDataType.Image,
|
|
25013
|
+
data: {
|
|
25014
|
+
file: info.fileName,
|
|
25015
|
+
subType: pic.bizType,
|
|
25016
|
+
url,
|
|
25017
|
+
file_size: info.fileSize.toString()
|
|
25018
|
+
}
|
|
25019
|
+
};
|
|
25020
|
+
} else if (serviceType === 48 && (businessType === 11 || businessType === 21)) {
|
|
25021
|
+
const { msgInfoBody } = Media.MsgInfo.decode(pbElem);
|
|
25022
|
+
const { index } = msgInfoBody[0];
|
|
25023
|
+
const url = await ctx.ntFileApi.getVideoUrlByPacket(index.fileUuid, businessType === 21);
|
|
25024
|
+
segment = {
|
|
25025
|
+
type: OB11MessageDataType.Video,
|
|
25026
|
+
data: {
|
|
25027
|
+
file: index.info.fileName,
|
|
25028
|
+
url,
|
|
25029
|
+
path: "",
|
|
25030
|
+
file_size: index.info.fileSize.toString()
|
|
25031
|
+
}
|
|
25032
|
+
};
|
|
25033
|
+
}
|
|
25020
25034
|
}
|
|
25021
25035
|
if (segment) if (typeof content === "string") content += encodeCQCode(segment);
|
|
25022
25036
|
else content.push(segment);
|
|
@@ -43470,7 +43484,7 @@ async function download(url, headers) {
|
|
|
43470
43484
|
return Buffer.from(bytes);
|
|
43471
43485
|
}
|
|
43472
43486
|
async function resolveMilkyUri(uri) {
|
|
43473
|
-
if (uri.startsWith("file://")) return await
|
|
43487
|
+
if (uri.startsWith("file://")) return await fs.readFile(fileURLToPath(uri));
|
|
43474
43488
|
if (uri.startsWith("http://") || uri.startsWith("https://")) return await download(uri);
|
|
43475
43489
|
if (uri.startsWith("base64://")) return Buffer.from(uri.slice(9), "base64");
|
|
43476
43490
|
throw new Error(`Unsupported URI scheme: ${uri}`);
|
|
@@ -54337,7 +54351,7 @@ var NTQQWebApi = class extends Service {
|
|
|
54337
54351
|
const iBatchID = Math.floor(Date.now() / 1e3);
|
|
54338
54352
|
for (let i = 0; i < filePathList.length; i++) {
|
|
54339
54353
|
const filePath = filePathList[i];
|
|
54340
|
-
const fileBuffer = await
|
|
54354
|
+
const fileBuffer = await fs.readFile(filePath);
|
|
54341
54355
|
const fileSize = fileBuffer.length;
|
|
54342
54356
|
const fileType = await fileTypeFromBuffer(fileBuffer);
|
|
54343
54357
|
const timestamp = Math.floor(Date.now() / 1e3);
|
|
@@ -54522,7 +54536,7 @@ var NTQQWebApi = class extends Service {
|
|
|
54522
54536
|
}
|
|
54523
54537
|
if (sVid) {
|
|
54524
54538
|
const filePath = await createThumb(this.ctx, filePathList[i]);
|
|
54525
|
-
const fileBuffer = await
|
|
54539
|
+
const fileBuffer = await fs.readFile(filePath);
|
|
54526
54540
|
const fileSize = fileBuffer.length;
|
|
54527
54541
|
const timestamp = Math.floor(Date.now() / 1e3);
|
|
54528
54542
|
const checksum = getMd5HexFromBuffer(fileBuffer);
|
|
@@ -56014,7 +56028,7 @@ var Config = class extends Service {
|
|
|
56014
56028
|
this.logger.info("配置文件位于", this.configPath);
|
|
56015
56029
|
this.config = this.get();
|
|
56016
56030
|
if (this.configPath) {
|
|
56017
|
-
fs$
|
|
56031
|
+
fs$2.watchFile(this.configPath, {
|
|
56018
56032
|
persistent: true,
|
|
56019
56033
|
interval: 1e3
|
|
56020
56034
|
}, () => {
|
|
@@ -56032,7 +56046,7 @@ var Config = class extends Service {
|
|
|
56032
56046
|
}
|
|
56033
56047
|
getDefaultConfig() {
|
|
56034
56048
|
const _defaultConfig = { ...defaultConfig };
|
|
56035
|
-
const defaultConfigFromFile = fs$
|
|
56049
|
+
const defaultConfigFromFile = fs$2.readFileSync(this.defaultConfigPath, "utf-8");
|
|
56036
56050
|
try {
|
|
56037
56051
|
const parsedDefaultConfig = import_dist.default.parse(defaultConfigFromFile);
|
|
56038
56052
|
Object.assign(_defaultConfig, parsedDefaultConfig);
|
|
@@ -56043,12 +56057,12 @@ var Config = class extends Service {
|
|
|
56043
56057
|
}
|
|
56044
56058
|
reloadConfig() {
|
|
56045
56059
|
if (!this.configPath) return this.getDefaultConfig();
|
|
56046
|
-
if (!fs$
|
|
56060
|
+
if (!fs$2.existsSync(this.configPath)) {
|
|
56047
56061
|
this.config = this.getDefaultConfig();
|
|
56048
56062
|
this.set(this.config);
|
|
56049
56063
|
return this.config;
|
|
56050
56064
|
} else {
|
|
56051
|
-
const data = fs$
|
|
56065
|
+
const data = fs$2.readFileSync(this.configPath, "utf-8");
|
|
56052
56066
|
let jsonData = defaultConfig;
|
|
56053
56067
|
try {
|
|
56054
56068
|
jsonData = import_dist.default.parse(data);
|
|
@@ -56074,7 +56088,7 @@ var Config = class extends Service {
|
|
|
56074
56088
|
writeConfig(config) {
|
|
56075
56089
|
if (!this.configPath) return;
|
|
56076
56090
|
this.watch = false;
|
|
56077
|
-
fs$
|
|
56091
|
+
fs$2.writeFileSync(this.configPath, JSON.stringify(config, null, 2), "utf-8");
|
|
56078
56092
|
setTimeout(() => {
|
|
56079
56093
|
this.watch = true;
|
|
56080
56094
|
}, 1500);
|
|
@@ -56180,13 +56194,13 @@ var WebUITokenUtil = class {
|
|
|
56180
56194
|
}
|
|
56181
56195
|
getToken() {
|
|
56182
56196
|
if (!this.token) {
|
|
56183
|
-
if (fs$
|
|
56197
|
+
if (fs$2.existsSync(this.tokenPath)) this.token = fs$2.readFileSync(this.tokenPath, "utf-8").trim();
|
|
56184
56198
|
}
|
|
56185
56199
|
return this.token;
|
|
56186
56200
|
}
|
|
56187
56201
|
setToken(token) {
|
|
56188
56202
|
this.token = token.trim();
|
|
56189
|
-
fs$
|
|
56203
|
+
fs$2.writeFileSync(this.tokenPath, token, "utf-8");
|
|
56190
56204
|
}
|
|
56191
56205
|
};
|
|
56192
56206
|
var webuiTokenUtil = new WebUITokenUtil(path.join(DATA_DIR, "webui_token.txt"));
|
|
@@ -58461,7 +58475,7 @@ var require_fetch = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
58461
58475
|
var require_shared = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
58462
58476
|
var urllib$2 = __require("url");
|
|
58463
58477
|
var util$1 = __require("util");
|
|
58464
|
-
var fs$
|
|
58478
|
+
var fs$5 = __require("fs");
|
|
58465
58479
|
var nmfetch = require_fetch();
|
|
58466
58480
|
var dns$1 = __require("dns");
|
|
58467
58481
|
var net$4 = __require("net");
|
|
@@ -58797,7 +58811,7 @@ var require_shared = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
58797
58811
|
const parsedDataUri = module.exports.parseDataURI(content.path || content.href);
|
|
58798
58812
|
if (!parsedDataUri || !parsedDataUri.data) return callback(null, Buffer.from(0));
|
|
58799
58813
|
return callback(null, parsedDataUri.data);
|
|
58800
|
-
} else if (content.path) return resolveStream(fs$
|
|
58814
|
+
} else if (content.path) return resolveStream(fs$5.createReadStream(content.path), callback);
|
|
58801
58815
|
}
|
|
58802
58816
|
if (typeof data[key].content === "string" && ![
|
|
58803
58817
|
"utf8",
|
|
@@ -62737,7 +62751,7 @@ var require_le_unix = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
62737
62751
|
//#region node_modules/nodemailer/lib/mime-node/index.js
|
|
62738
62752
|
var require_mime_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
62739
62753
|
var crypto$8 = __require("crypto");
|
|
62740
|
-
var fs$
|
|
62754
|
+
var fs$4 = __require("fs");
|
|
62741
62755
|
var punycode = require_punycode();
|
|
62742
62756
|
var { PassThrough: PassThrough$2 } = __require("stream");
|
|
62743
62757
|
var shared = require_shared();
|
|
@@ -63446,7 +63460,7 @@ var require_mime_node = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
63446
63460
|
});
|
|
63447
63461
|
return contentStream;
|
|
63448
63462
|
}
|
|
63449
|
-
return fs$
|
|
63463
|
+
return fs$4.createReadStream(content.path);
|
|
63450
63464
|
}
|
|
63451
63465
|
if (content && typeof content.href === "string") {
|
|
63452
63466
|
if (this.disableUrlAccess) {
|
|
@@ -64285,7 +64299,7 @@ var require_dkim = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
64285
64299
|
var RelaxedBody = require_relaxed_body();
|
|
64286
64300
|
var sign = require_sign();
|
|
64287
64301
|
var { PassThrough: PassThrough$1 } = __require("stream");
|
|
64288
|
-
var fs$
|
|
64302
|
+
var fs$3 = __require("fs");
|
|
64289
64303
|
var path$2 = __require("path");
|
|
64290
64304
|
var crypto$5 = __require("crypto");
|
|
64291
64305
|
var DKIM_ALGO = "sha256";
|
|
@@ -64318,10 +64332,10 @@ var require_dkim = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
64318
64332
|
}
|
|
64319
64333
|
cleanup() {
|
|
64320
64334
|
if (!this.cache || !this.cachePath) return;
|
|
64321
|
-
fs$
|
|
64335
|
+
fs$3.unlink(this.cachePath, () => false);
|
|
64322
64336
|
}
|
|
64323
64337
|
createReadCache() {
|
|
64324
|
-
this.cache = fs$
|
|
64338
|
+
this.cache = fs$3.createReadStream(this.cachePath);
|
|
64325
64339
|
this.cache.once("error", (err) => {
|
|
64326
64340
|
this.cleanup();
|
|
64327
64341
|
this.output.emit("error", err);
|
|
@@ -64367,7 +64381,7 @@ var require_dkim = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
64367
64381
|
}
|
|
64368
64382
|
createWriteCache() {
|
|
64369
64383
|
this.output.usingCache = true;
|
|
64370
|
-
this.cache = fs$
|
|
64384
|
+
this.cache = fs$3.createWriteStream(this.cachePath);
|
|
64371
64385
|
this.cache.once("error", (err) => {
|
|
64372
64386
|
this.cleanup();
|
|
64373
64387
|
this.relaxedBody.unpipe(this.cache);
|