shifro 1.1.0 → 1.1.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.
- package/README.md +6 -2
- package/dist/cli.mjs +1 -1
- package/package.json +10 -15
- package/dist/index.cjs +0 -42
- package/dist/index.d.ts +0 -28
- /package/dist/{index.d.cts → index.d.mts} +0 -0
- /package/dist/{index.js → index.mjs} +0 -0
package/README.md
CHANGED
|
@@ -8,13 +8,17 @@ This tool is a small wrapper around the [Mediabunny](https://github.com/Vanilagy
|
|
|
8
8
|
|
|
9
9
|
### CLI
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
> [Node.js](https://nodejs.org/en/download) is required (or any other runtime that has compatibility with Node.js API, like [Bun](https://bun.com/)).
|
|
12
|
+
|
|
13
|
+
Run `npm install -g shifro` to install the command-line tool globally.
|
|
12
14
|
|
|
13
15
|
```bash
|
|
14
16
|
shifro --key eb676abbcb345e96bbcf616630f1a3da:100b6c20940f779a4589152b57d2dacb ./input.mp4 ./output.mp4
|
|
15
17
|
```
|
|
16
18
|
|
|
17
|
-
|
|
19
|
+
>You can also use `npx shifro ...` to run the CLI tool without installing it globally
|
|
20
|
+
|
|
21
|
+
This CLI can be used as an alternative to the [mp4decrypt](https://www.bento4.com/documentation/mp4decrypt/) or [shaka-packager](https://shaka-project.github.io/shaka-packager/html/documentation.html#raw-key-encryption-options).
|
|
18
22
|
|
|
19
23
|
### Library
|
|
20
24
|
|
package/dist/cli.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { parseArgs } from "node:util";
|
|
|
3
3
|
import { ALL_FORMATS, Conversion, FilePathSource, FilePathTarget, Input, Mp4OutputFormat, Output } from "mediabunny";
|
|
4
4
|
//#region package.json
|
|
5
5
|
var name = "shifro";
|
|
6
|
-
var version = "1.1.
|
|
6
|
+
var version = "1.1.2";
|
|
7
7
|
var author = "Vitaly Gashkov <vitalygashkov@vk.com>";
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/index.ts
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "shifro",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "A lightweight library for decrypting MP4 files
|
|
3
|
+
"version": "1.1.2",
|
|
4
|
+
"description": "A lightweight library and command-line tool for decrypting MP4 files",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
7
7
|
],
|
|
@@ -9,18 +9,13 @@
|
|
|
9
9
|
"shifro": "./dist/cli.mjs"
|
|
10
10
|
},
|
|
11
11
|
"type": "module",
|
|
12
|
-
"main": "./dist/index.
|
|
13
|
-
"types": "./dist/index.d.
|
|
12
|
+
"main": "./dist/index.mjs",
|
|
13
|
+
"types": "./dist/index.d.mts",
|
|
14
14
|
"exports": {
|
|
15
15
|
".": {
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
},
|
|
20
|
-
"import": {
|
|
21
|
-
"types": "./dist/index.d.ts",
|
|
22
|
-
"default": "./dist/index.js"
|
|
23
|
-
}
|
|
16
|
+
"types": "./dist/index.d.mts",
|
|
17
|
+
"module-sync": "./dist/index.mjs",
|
|
18
|
+
"default": "./dist/index.mjs"
|
|
24
19
|
}
|
|
25
20
|
},
|
|
26
21
|
"repository": {
|
|
@@ -57,10 +52,10 @@
|
|
|
57
52
|
}
|
|
58
53
|
],
|
|
59
54
|
"engines": {
|
|
60
|
-
"node": ">=22"
|
|
55
|
+
"node": ">=22.18"
|
|
61
56
|
},
|
|
62
57
|
"dependencies": {
|
|
63
|
-
"mediabunny": "^1.42.0
|
|
58
|
+
"mediabunny": "^1.42.0"
|
|
64
59
|
},
|
|
65
60
|
"devDependencies": {
|
|
66
61
|
"@types/node": "^24.5.2",
|
|
@@ -74,7 +69,7 @@
|
|
|
74
69
|
"start": "node ./dist/cli.mjs",
|
|
75
70
|
"web": "vite",
|
|
76
71
|
"build": "pnpm run bundle:lib && pnpm run bundle:cli",
|
|
77
|
-
"bundle:lib": "tsdown ./src/index.ts --format
|
|
72
|
+
"bundle:lib": "tsdown ./src/index.ts --format esm --dts --platform neutral --fixed-extension",
|
|
78
73
|
"bundle:cli": "tsdown ./src/cli.ts --format esm --no-clean",
|
|
79
74
|
"build:cli": "pnpm run build:cli:mac && pnpm run build:cli:linux && pnpm run build:cli:win",
|
|
80
75
|
"build:cli:mac": "bun build --compile --minify --bytecode --target=bun-darwin-arm64 ./src/cli.ts --outfile shifro-windows.exe",
|
package/dist/index.cjs
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
let mediabunny = require("mediabunny");
|
|
3
|
-
//#region src/index.ts
|
|
4
|
-
var Input = class extends mediabunny.Input {
|
|
5
|
-
constructor({ keys, handleEncryptionInfo, ...options }) {
|
|
6
|
-
super({
|
|
7
|
-
...options,
|
|
8
|
-
formats: mediabunny.ALL_FORMATS,
|
|
9
|
-
formatOptions: { isobmff: { resolveKeyId: ({ keyId, psshBoxes }) => {
|
|
10
|
-
handleEncryptionInfo?.({
|
|
11
|
-
keyId,
|
|
12
|
-
psshBoxes
|
|
13
|
-
});
|
|
14
|
-
const key = keys.get(keyId);
|
|
15
|
-
if (!key) throw new Error("Unknown key ID.");
|
|
16
|
-
return key;
|
|
17
|
-
} } }
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
var Output = class extends mediabunny.Output {
|
|
22
|
-
constructor({ ...options }) {
|
|
23
|
-
super({
|
|
24
|
-
...options,
|
|
25
|
-
format: options.format ?? new mediabunny.Mp4OutputFormat()
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
//#endregion
|
|
30
|
-
exports.Decryption = mediabunny.Conversion;
|
|
31
|
-
exports.FilePathSource = mediabunny.FilePathSource;
|
|
32
|
-
exports.FilePathTarget = mediabunny.FilePathTarget;
|
|
33
|
-
exports.Input = Input;
|
|
34
|
-
exports.MkvOutputFormat = mediabunny.MkvOutputFormat;
|
|
35
|
-
exports.MovOutputFormat = mediabunny.MovOutputFormat;
|
|
36
|
-
exports.Mp3OutputFormat = mediabunny.Mp3OutputFormat;
|
|
37
|
-
exports.Mp4OutputFormat = mediabunny.Mp4OutputFormat;
|
|
38
|
-
exports.Output = Output;
|
|
39
|
-
exports.ReadableStreamSource = mediabunny.ReadableStreamSource;
|
|
40
|
-
exports.StreamSource = mediabunny.StreamSource;
|
|
41
|
-
exports.StreamTarget = mediabunny.StreamTarget;
|
|
42
|
-
exports.UrlSource = mediabunny.UrlSource;
|
package/dist/index.d.ts
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Conversion, FilePathSource, FilePathTarget, Input as Input$1, InputOptions, MkvOutputFormat, MovOutputFormat, Mp3OutputFormat, Mp4OutputFormat, Output as Output$1, OutputFormat, OutputOptions, PsshBox, ReadableStreamSource, StreamSource, StreamSourceOptions, StreamTarget, StreamTargetOptions, UrlSource } from "mediabunny";
|
|
2
|
-
|
|
3
|
-
//#region src/index.d.ts
|
|
4
|
-
type KeyId = string;
|
|
5
|
-
type Key = string;
|
|
6
|
-
type KeyMap = Map<KeyId, Key>;
|
|
7
|
-
declare class Input extends Input$1 {
|
|
8
|
-
constructor({
|
|
9
|
-
keys,
|
|
10
|
-
handleEncryptionInfo,
|
|
11
|
-
...options
|
|
12
|
-
}: Omit<InputOptions, 'formats' | 'formatOptions'> & {
|
|
13
|
-
keys: KeyMap;
|
|
14
|
-
handleEncryptionInfo?: (options: {
|
|
15
|
-
keyId: string;
|
|
16
|
-
psshBoxes: PsshBox[];
|
|
17
|
-
}) => void;
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
declare class Output extends Output$1 {
|
|
21
|
-
constructor({
|
|
22
|
-
...options
|
|
23
|
-
}: Omit<OutputOptions, 'format'> & {
|
|
24
|
-
format?: OutputFormat;
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
//#endregion
|
|
28
|
-
export { Conversion as Decryption, FilePathSource, FilePathTarget, Input, type InputOptions, type Key, type KeyId, type KeyMap, MkvOutputFormat, MovOutputFormat, Mp3OutputFormat, Mp4OutputFormat, Output, type OutputFormat, type OutputOptions, ReadableStreamSource, StreamSource, type StreamSourceOptions, StreamTarget, type StreamTargetOptions, UrlSource };
|
|
File without changes
|
|
File without changes
|