bililive-cli 1.3.0 → 1.5.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/README.md +5 -6
- package/lib/bili-BLevGPF2.js +76000 -0
- package/lib/bili-CQgv-F-q.js +76007 -0
- package/lib/index-BVMD1wRX.js +43797 -0
- package/lib/{index-BZRzMMRb.js → index-Dkt7D2TB.js} +4 -4
- package/lib/index-vxC6dSfO.js +43797 -0
- package/lib/index.cjs +105 -104613
- package/lib/{linux-BetMzq9g.js → linux-BGjRnnAR.js} +45 -111
- package/lib/linux-C6SziuFt.js +3515 -0
- package/lib/v4-D4KzFnn8.js +67 -0
- package/package.json +6 -5
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
4
|
+
// require the crypto API and do not support built-in fallback to lower quality random number
|
|
5
|
+
// generators (like Math.random()).
|
|
6
|
+
var getRandomValues;
|
|
7
|
+
var rnds8 = new Uint8Array(16);
|
|
8
|
+
function rng() {
|
|
9
|
+
// lazy load so that environments that need to polyfill have a chance to do so
|
|
10
|
+
if (!getRandomValues) {
|
|
11
|
+
// getRandomValues needs to be invoked in a context where "this" is a Crypto implementation. Also,
|
|
12
|
+
// find the complete implementation of crypto (msCrypto) on IE11.
|
|
13
|
+
getRandomValues = typeof crypto !== 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== 'undefined' && typeof msCrypto.getRandomValues === 'function' && msCrypto.getRandomValues.bind(msCrypto);
|
|
14
|
+
|
|
15
|
+
if (!getRandomValues) {
|
|
16
|
+
throw new Error('crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported');
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return getRandomValues(rnds8);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
|
|
24
|
+
|
|
25
|
+
function validate(uuid) {
|
|
26
|
+
return typeof uuid === 'string' && REGEX.test(uuid);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Convert array of 16 byte values to UUID string format of the form:
|
|
31
|
+
* XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
|
|
32
|
+
*/
|
|
33
|
+
|
|
34
|
+
var byteToHex = [];
|
|
35
|
+
|
|
36
|
+
for (var i = 0; i < 256; ++i) {
|
|
37
|
+
byteToHex.push((i + 0x100).toString(16).substr(1));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function stringify(arr) {
|
|
41
|
+
var offset = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
42
|
+
// Note: Be careful editing this code! It's been tuned for performance
|
|
43
|
+
// and works in ways you may not expect. See https://github.com/uuidjs/uuid/pull/434
|
|
44
|
+
var uuid = (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + '-' + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + '-' + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + '-' + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + '-' + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase(); // Consistency check for valid UUID. If this throws, it's likely due to one
|
|
45
|
+
// of the following:
|
|
46
|
+
// - One or more input array values don't map to a hex octet (leading to
|
|
47
|
+
// "undefined" in the uuid)
|
|
48
|
+
// - Invalid input values for the RFC `version` or `variant` fields
|
|
49
|
+
|
|
50
|
+
if (!validate(uuid)) {
|
|
51
|
+
throw TypeError('Stringified UUID is invalid');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return uuid;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function v4(options, buf, offset) {
|
|
58
|
+
options = options || {};
|
|
59
|
+
var rnds = options.random || (options.rng || rng)(); // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
|
|
60
|
+
|
|
61
|
+
rnds[6] = rnds[6] & 0x0f | 0x40;
|
|
62
|
+
rnds[8] = rnds[8] & 0x3f | 0x80; // Copy bytes to buffer, if provided
|
|
63
|
+
|
|
64
|
+
return stringify(rnds);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
exports.v4 = v4;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bililive-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "biliLive-tools的cli程序",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -31,9 +31,9 @@
|
|
|
31
31
|
"tsx": "^4.7.2",
|
|
32
32
|
"cli-progress": "^3.12.0",
|
|
33
33
|
"commander": "^12.0.0",
|
|
34
|
-
"@biliLive-tools/http": "1.
|
|
35
|
-
"@biliLive-tools/shared": "1.
|
|
36
|
-
"@biliLive-tools/types": "1.
|
|
34
|
+
"@biliLive-tools/http": "1.5.0",
|
|
35
|
+
"@biliLive-tools/shared": "1.5.0",
|
|
36
|
+
"@biliLive-tools/types": "1.5.0"
|
|
37
37
|
},
|
|
38
38
|
"scripts": {
|
|
39
39
|
"start": "tsx src/index.ts",
|
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
"build": "rollup --config rollup.config.js",
|
|
43
43
|
"pkg": "pkg ./lib/index.cjs --output ./dist/biliLive",
|
|
44
44
|
"zip:win": "cd dist && bestzip biliLive-cli-win-x64.zip ./biliLive.exe",
|
|
45
|
-
"zip:linux": "cd dist && bestzip biliLive-cli-linux-x64.zip ./biliLive"
|
|
45
|
+
"zip:linux": "cd dist && bestzip biliLive-cli-linux-x64.zip ./biliLive",
|
|
46
|
+
"release": "pnpm run build && pnpm publish --access=public"
|
|
46
47
|
}
|
|
47
48
|
}
|