bililive-cli 1.2.3

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/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # 介绍
2
+
3
+ [biliLive-tools](https://github.com/renmu123/biliLive-tools)的命令行版本
4
+
5
+ 这是一个用于 B 站录播的一站式工具,支持弹幕转换与视频压制并上传至B站,支持录播姬与blrec的webhook。
6
+ 如果你是录播man正在寻找xml弹幕转换、弹幕压制、webhook上传工具,如果你是切片man正在寻找下载b站视频工具,如果你厌倦了b站的多p上传,你可以来试试本软件。
7
+ 做这款工具的初衷是为了解决录播工具的碎片化,往往想完整处理一场带有弹幕的录播要使用多个软件的配合,一些工具只有CLI,加大了使用难度。
8
+
9
+ # 安装
10
+
11
+ `npm i bililive-cli -g`
12
+
13
+ # 使用
14
+
15
+ CLI是GUI的拓展,使用前需要设置相关目录,由于配置文件很多且复杂,请在GUI中生成并进行修改配置后复制到CLI所配置的目录,或直接将目录设置为GUI的配置目录。
16
+ 暂时只支持webhook相关的指令,也即启动webhook server,可以避免启动electron带来的消耗。
17
+
18
+ **CLI版本暂时不支持删除到回收站,高能进度条功能**
19
+
20
+ ## 配置
21
+
22
+ 使用前通过 `biliLive config gen` 生成默认配置文件,如果你已经安装客户端,相关配置会被自动设置(仅限win)
23
+ 如果你仅使用上传功能,那么无需配置二进制文件
24
+
25
+ ```js
26
+ {
27
+ port: 18010, // 启动端口,如果不希望与客户端的冲突,请修改为其他端口号
28
+ host: "127.0.0.1", // host
29
+ configFolder: "", // 配置文件夹,推荐在GUI中生成并进行修改配置后复制到CLI所配置的目录,可在“打开log文件夹”上一层文件夹找到
30
+ binFolder: "", // 二进制文件夹,如果你配置了选项,那么默认会从这个文件夹读取相关二进制文件
31
+ ffmpegPath: "ffmpeg.exe", // 覆盖binFolder中的ffmpeg二进制路径
32
+ ffprobePath: "ffprobe.exe", // 覆盖binFolder中的ffprobe二进制路径
33
+ danmakuFactoryPath: "DanmakuFactory.exe", // 覆盖binFolder中的DanmakuFactory二进制路径
34
+ logPath: "main.log", // log文件路径
35
+ }
36
+ ```
37
+
38
+ ## 运行
39
+
40
+ `biliLive server`
@@ -0,0 +1,55 @@
1
+ 'use strict';
2
+
3
+ var node_util = require('node:util');
4
+ var node_child_process = require('node:child_process');
5
+ var node_url = require('node:url');
6
+
7
+ function chunkify(iterable, chunkSize) {
8
+ if (typeof iterable[Symbol.iterator] !== 'function') {
9
+ throw new TypeError('Expected an `Iterable` in the first argument');
10
+ }
11
+
12
+ if (!(Number.isSafeInteger(chunkSize) && chunkSize > 0)) {
13
+ throw new TypeError(
14
+ `Expected \`chunkSize\` to be a an integer from 1 and up, got \`${chunkSize}\``
15
+ );
16
+ }
17
+
18
+ return {
19
+ * [Symbol.iterator]() {
20
+ if (Array.isArray(iterable)) {
21
+ for (let index = 0; index < iterable.length; index += chunkSize) {
22
+ yield iterable.slice(index, index + chunkSize);
23
+ }
24
+
25
+ return;
26
+ }
27
+
28
+ let chunk = [];
29
+
30
+ for (const value of iterable) {
31
+ chunk.push(value);
32
+
33
+ if (chunk.length === chunkSize) {
34
+ yield chunk;
35
+ chunk = [];
36
+ }
37
+ }
38
+
39
+ if (chunk.length > 0) {
40
+ yield chunk;
41
+ }
42
+ }
43
+ };
44
+ }
45
+
46
+ const pExecFile = node_util.promisify(node_child_process.execFile);
47
+
48
+ async function chunkedExec(binary, paths, maxPaths) {
49
+ for (const chunk of chunkify(paths, maxPaths)) {
50
+ // eslint-disable-next-line no-await-in-loop
51
+ await pExecFile(node_url.fileURLToPath(binary), chunk);
52
+ }
53
+ }
54
+
55
+ exports.chunkedExec = chunkedExec;
@@ -0,0 +1,47 @@
1
+ 'use strict';
2
+
3
+ var require$$0 = require('fs');
4
+ var require$$1 = require('path');
5
+
6
+ function _mergeNamespaces(n, m) {
7
+ m.forEach(function (e) {
8
+ e && typeof e !== 'string' && !Array.isArray(e) && Object.keys(e).forEach(function (k) {
9
+ if (k !== 'default' && !(k in n)) {
10
+ var d = Object.getOwnPropertyDescriptor(e, k);
11
+ Object.defineProperty(n, k, d.get ? d : {
12
+ enumerable: true,
13
+ get: function () { return e[k]; }
14
+ });
15
+ }
16
+ });
17
+ });
18
+ return Object.freeze(n);
19
+ }
20
+
21
+ const fs = require$$0;
22
+ const path = require$$1;
23
+
24
+ const pathFile = path.join(__dirname, 'path.txt');
25
+
26
+ function getElectronPath () {
27
+ let executablePath;
28
+ if (fs.existsSync(pathFile)) {
29
+ executablePath = fs.readFileSync(pathFile, 'utf-8');
30
+ }
31
+ if (process.env.ELECTRON_OVERRIDE_DIST_PATH) {
32
+ return path.join(process.env.ELECTRON_OVERRIDE_DIST_PATH, executablePath || 'electron');
33
+ }
34
+ if (executablePath) {
35
+ return path.join(__dirname, 'dist', executablePath);
36
+ } else {
37
+ throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again');
38
+ }
39
+ }
40
+
41
+ var electron = getElectronPath();
42
+
43
+ var index = /*#__PURE__*/_mergeNamespaces({
44
+ __proto__: null
45
+ }, [electron]);
46
+
47
+ exports.index = index;