skystream-cli 1.4.1 → 1.4.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/dist/index.js +15 -5
- package/package.json +3 -1
package/dist/index.js
CHANGED
|
@@ -7,11 +7,12 @@ import fs from 'fs-extra';
|
|
|
7
7
|
import { z } from 'zod';
|
|
8
8
|
import archiver from 'archiver';
|
|
9
9
|
import axios from 'axios';
|
|
10
|
+
import { JSDOM } from 'jsdom';
|
|
10
11
|
const program = new Command();
|
|
11
12
|
program
|
|
12
13
|
.name('skystream')
|
|
13
14
|
.description('SkyStream Plugin Development Kit CLI (Sky Gen 2)')
|
|
14
|
-
.version('1.4.
|
|
15
|
+
.version('1.4.3');
|
|
15
16
|
// Schemas
|
|
16
17
|
const pluginSchema = z.object({
|
|
17
18
|
packageName: z.string().min(5).regex(/^[a-z0-9._-]+$/),
|
|
@@ -197,7 +198,7 @@ const JS_TEMPLATE = `(function() {
|
|
|
197
198
|
data: [
|
|
198
199
|
new StreamResult({
|
|
199
200
|
url: "https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8",
|
|
200
|
-
|
|
201
|
+
source: "Server [1080p]", // (optional)
|
|
201
202
|
headers: { "Referer": \`\${manifest.baseUrl}\` }, // (optional)
|
|
202
203
|
subtitles: [
|
|
203
204
|
{ url: \`\${manifest.baseUrl}/sub.vtt\`, label: "English", lang: "en" } // (optional)
|
|
@@ -559,9 +560,9 @@ program.command('test')
|
|
|
559
560
|
}
|
|
560
561
|
|
|
561
562
|
class StreamResult {
|
|
562
|
-
constructor({ url, quality, headers, subtitles, drmKid, drmKey, licenseUrl }) {
|
|
563
|
+
constructor({ url, source, quality, headers, subtitles, drmKid, drmKey, licenseUrl }) {
|
|
563
564
|
this.url = url;
|
|
564
|
-
this.
|
|
565
|
+
this.source = source || quality || 'Auto';
|
|
565
566
|
this.headers = headers;
|
|
566
567
|
this.subtitles = subtitles;
|
|
567
568
|
this.drmKid = drmKid;
|
|
@@ -575,13 +576,22 @@ program.command('test')
|
|
|
575
576
|
const sandbox = Object.create(null);
|
|
576
577
|
Object.assign(sandbox, context);
|
|
577
578
|
// Ensure Node globals are present
|
|
578
|
-
sandbox.
|
|
579
|
+
sandbox.atob = (str) => Buffer.from(str, 'base64').toString('binary');
|
|
580
|
+
sandbox.btoa = (str) => Buffer.from(str, 'binary').toString('base64');
|
|
581
|
+
sandbox.URL = URL;
|
|
582
|
+
sandbox.console = {
|
|
583
|
+
log: (...args) => console.log('[JS LOG]', ...args),
|
|
584
|
+
error: (...args) => console.error('[JS ERROR]', ...args),
|
|
585
|
+
warn: (...args) => console.warn('[JS WARN]', ...args),
|
|
586
|
+
};
|
|
579
587
|
sandbox.axios = axios;
|
|
580
588
|
sandbox.Buffer = Buffer;
|
|
581
589
|
sandbox.setTimeout = setTimeout;
|
|
582
590
|
sandbox.clearTimeout = clearTimeout;
|
|
583
591
|
sandbox.setInterval = setInterval;
|
|
584
592
|
sandbox.clearInterval = clearInterval;
|
|
593
|
+
sandbox.JSDOM = JSDOM;
|
|
594
|
+
sandbox.URL = URL;
|
|
585
595
|
sandbox.globalThis = sandbox;
|
|
586
596
|
// Inject the classes from entityDefs into the sandbox
|
|
587
597
|
const vmContext = vm.createContext(sandbox);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skystream-cli",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "SkyStream Plugin Development Kit & Repository Manager",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -33,6 +33,7 @@
|
|
|
33
33
|
"esbuild": "^0.27.3",
|
|
34
34
|
"fs-extra": "^11.3.4",
|
|
35
35
|
"inquirer": "^12.11.1",
|
|
36
|
+
"jsdom": "^25.0.1",
|
|
36
37
|
"zod": "^4.3.6"
|
|
37
38
|
},
|
|
38
39
|
"devDependencies": {
|
|
@@ -40,6 +41,7 @@
|
|
|
40
41
|
"@types/archiver": "^7.0.0",
|
|
41
42
|
"@types/fs-extra": "^11.0.4",
|
|
42
43
|
"@types/inquirer": "^9.0.9",
|
|
44
|
+
"@types/jsdom": "^28.0.0",
|
|
43
45
|
"@types/node": "^25.4.0",
|
|
44
46
|
"typescript": "^5.9.3"
|
|
45
47
|
}
|