skystream-cli 1.2.9 → 1.3.5
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 +84 -27
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ const program = new Command();
|
|
|
9
9
|
program
|
|
10
10
|
.name('skystream')
|
|
11
11
|
.description('SkyStream Plugin Development Kit CLI (Sky Gen 2)')
|
|
12
|
-
.version('1.
|
|
12
|
+
.version('1.3.5');
|
|
13
13
|
// Schemas
|
|
14
14
|
const pluginSchema = z.object({
|
|
15
15
|
packageName: z.string().min(5).regex(/^[a-z0-9._-]+$/),
|
|
@@ -49,25 +49,54 @@ const JS_TEMPLATE = `(function() {
|
|
|
49
49
|
*/
|
|
50
50
|
async function getHome(cb) {
|
|
51
51
|
try {
|
|
52
|
-
//
|
|
52
|
+
// Dashboard Layout:
|
|
53
|
+
// - "Trending" is a reserved category promoted to the Hero Carousel.
|
|
54
|
+
// - Other categories appear as horizontal thumbnail rows.
|
|
55
|
+
// - If "Trending" is missing, the first category is used for the carousel.
|
|
53
56
|
cb({
|
|
54
57
|
success: true,
|
|
55
58
|
data: {
|
|
56
59
|
"Trending": [
|
|
57
60
|
new MultimediaItem({
|
|
58
|
-
title: "Example Movie",
|
|
61
|
+
title: "Example Movie (Carousel)",
|
|
59
62
|
url: \`\${manifest.baseUrl}/movie\`,
|
|
60
|
-
posterUrl:
|
|
63
|
+
posterUrl: \`https://placehold.co/400x600.png?text=Trending+Movie\`,
|
|
61
64
|
type: "movie", // Valid types: movie, series, anime, livestream
|
|
62
|
-
bannerUrl:
|
|
65
|
+
bannerUrl: \`https://placehold.co/1280x720.png?text=Trending+Banner\`, // (optional)
|
|
63
66
|
description: "Plot summary here...", // (optional)
|
|
64
67
|
headers: { "Referer": \`\${manifest.baseUrl}\` } // (optional)
|
|
65
68
|
})
|
|
66
|
-
]
|
|
69
|
+
],
|
|
70
|
+
"Latest Series": [
|
|
71
|
+
new MultimediaItem({
|
|
72
|
+
title: "Example Series (Thumb)",
|
|
73
|
+
url: \`\${manifest.baseUrl}/series\`,
|
|
74
|
+
posterUrl: \`https://placehold.co/400x600.png?text=Series+Poster\`,
|
|
75
|
+
type: "series", // Valid types: movie, series, anime, livestream
|
|
76
|
+
description: "This category appears as a thumbnail row.", // (optional)
|
|
77
|
+
headers: { "Referer": \`\${manifest.baseUrl}\` }, // (optional)
|
|
78
|
+
episodes: [
|
|
79
|
+
new Episode({
|
|
80
|
+
name: "Episode 1",
|
|
81
|
+
url: \`\${manifest.baseUrl}/series/1\`,
|
|
82
|
+
season: 1,
|
|
83
|
+
episode: 1,
|
|
84
|
+
posterUrl: \`https://placehold.co/400x600.png?text=EP1+Poster\`
|
|
85
|
+
}),
|
|
86
|
+
new Episode({
|
|
87
|
+
name: "Episode 2",
|
|
88
|
+
url: \`\${manifest.baseUrl}/series/2\`,
|
|
89
|
+
season: 1,
|
|
90
|
+
episode: 2,
|
|
91
|
+
posterUrl: \`https://placehold.co/400x600.png?text=EP2+Poster\`
|
|
92
|
+
})
|
|
93
|
+
]
|
|
94
|
+
})
|
|
95
|
+
]
|
|
67
96
|
}
|
|
68
97
|
});
|
|
69
98
|
} catch (e) {
|
|
70
|
-
cb({ success: false, errorCode: "PARSE_ERROR", message:
|
|
99
|
+
cb({ success: false, errorCode: "PARSE_ERROR", message: e.stack });
|
|
71
100
|
}
|
|
72
101
|
}
|
|
73
102
|
|
|
@@ -79,22 +108,31 @@ const JS_TEMPLATE = `(function() {
|
|
|
79
108
|
async function search(query, cb) {
|
|
80
109
|
try {
|
|
81
110
|
// Standard: Return a List of items
|
|
111
|
+
// Samples show both a movie and a series
|
|
82
112
|
cb({
|
|
83
113
|
success: true,
|
|
84
114
|
data: [
|
|
85
115
|
new MultimediaItem({
|
|
86
|
-
title: "Example Movie",
|
|
116
|
+
title: "Example Movie (Search Result)",
|
|
87
117
|
url: \`\${manifest.baseUrl}/movie\`,
|
|
88
|
-
posterUrl:
|
|
89
|
-
type: "movie",
|
|
90
|
-
bannerUrl:
|
|
91
|
-
description: "Plot summary here...",
|
|
92
|
-
headers: { "Referer": \`\${manifest.baseUrl}\` }
|
|
118
|
+
posterUrl: \`https://placehold.co/400x600.png?text=Search+Movie\`,
|
|
119
|
+
type: "movie",
|
|
120
|
+
bannerUrl: \`https://placehold.co/1280x720.png?text=Search+Banner\`,
|
|
121
|
+
description: "Plot summary here...",
|
|
122
|
+
headers: { "Referer": \`\${manifest.baseUrl}\` }
|
|
123
|
+
}),
|
|
124
|
+
new MultimediaItem({
|
|
125
|
+
title: "Example Series (Search Result)",
|
|
126
|
+
url: \`\${manifest.baseUrl}/series\`,
|
|
127
|
+
posterUrl: \`https://placehold.co/400x600.png?text=Search+Series\`,
|
|
128
|
+
type: "series",
|
|
129
|
+
description: "A series found in search.",
|
|
130
|
+
headers: { "Referer": \`\${manifest.baseUrl}\` }
|
|
93
131
|
})
|
|
94
132
|
]
|
|
95
133
|
});
|
|
96
134
|
} catch (e) {
|
|
97
|
-
cb({ success: false, errorCode: "SEARCH_ERROR", message:
|
|
135
|
+
cb({ success: false, errorCode: "SEARCH_ERROR", message: e.stack });
|
|
98
136
|
}
|
|
99
137
|
}
|
|
100
138
|
|
|
@@ -106,31 +144,41 @@ const JS_TEMPLATE = `(function() {
|
|
|
106
144
|
async function load(url, cb) {
|
|
107
145
|
try {
|
|
108
146
|
// Standard: Return a single item with full metadata
|
|
147
|
+
// Sample shows a series with episodes
|
|
109
148
|
cb({
|
|
110
149
|
success: true,
|
|
111
150
|
data: new MultimediaItem({
|
|
112
|
-
title: "Example
|
|
151
|
+
title: "Example Series Full Details",
|
|
113
152
|
url: url,
|
|
114
|
-
posterUrl:
|
|
115
|
-
type: "
|
|
116
|
-
bannerUrl:
|
|
117
|
-
description: "This is a detailed description of the
|
|
118
|
-
headers: { "Referer": \`\${manifest.baseUrl}\` },
|
|
153
|
+
posterUrl: \`https://placehold.co/400x600.png?text=Series+Details\`,
|
|
154
|
+
type: "series",
|
|
155
|
+
bannerUrl: \`https://placehold.co/1280x720.png?text=Series+Banner\`,
|
|
156
|
+
description: "This is a detailed description of the media.",
|
|
157
|
+
headers: { "Referer": \`\${manifest.baseUrl}\` },
|
|
119
158
|
episodes: [
|
|
120
159
|
new Episode({
|
|
121
160
|
name: "Episode 1",
|
|
122
161
|
url: \`\${manifest.baseUrl}/watch/1\`,
|
|
123
|
-
season: 1,
|
|
124
|
-
episode: 1,
|
|
125
|
-
description: "Episode summary...",
|
|
126
|
-
posterUrl:
|
|
127
|
-
headers: { "Referer": \`\${manifest.baseUrl}\` }
|
|
162
|
+
season: 1,
|
|
163
|
+
episode: 1,
|
|
164
|
+
description: "Episode summary...",
|
|
165
|
+
posterUrl: \`https://placehold.co/400x600.png?text=Episode+Poster\`,
|
|
166
|
+
headers: { "Referer": \`\${manifest.baseUrl}\` }
|
|
167
|
+
}),
|
|
168
|
+
new Episode({
|
|
169
|
+
name: "Episode 2",
|
|
170
|
+
url: \`\${manifest.baseUrl}/watch/2\`,
|
|
171
|
+
season: 1,
|
|
172
|
+
episode: 2,
|
|
173
|
+
description: "Next episode summary...",
|
|
174
|
+
posterUrl: \`https://placehold.co/400x600.png?text=Episode+Poster\`,
|
|
175
|
+
headers: { "Referer": \`\${manifest.baseUrl}\` }
|
|
128
176
|
})
|
|
129
177
|
]
|
|
130
178
|
})
|
|
131
179
|
});
|
|
132
180
|
} catch (e) {
|
|
133
|
-
cb({ success: false, errorCode: "LOAD_ERROR", message:
|
|
181
|
+
cb({ success: false, errorCode: "LOAD_ERROR", message: e.stack });
|
|
134
182
|
}
|
|
135
183
|
}
|
|
136
184
|
|
|
@@ -479,7 +527,16 @@ program.command('test')
|
|
|
479
527
|
globalThis.Episode = Episode;
|
|
480
528
|
globalThis.StreamResult = StreamResult;
|
|
481
529
|
`;
|
|
482
|
-
|
|
530
|
+
// Wrap the plugin code and classes in a combined block to ensure scope visibility
|
|
531
|
+
const combinedScript = `
|
|
532
|
+
${entityDefs}
|
|
533
|
+
try {
|
|
534
|
+
${jsContent}
|
|
535
|
+
} catch (e) {
|
|
536
|
+
console.error("Critical Runtime Error: " + e.stack);
|
|
537
|
+
}
|
|
538
|
+
`;
|
|
539
|
+
const runtime = new Function('manifest', 'console', 'http_get', 'http_post', '_fetch', 'fetch', 'btoa', 'atob', 'globalThis', combinedScript);
|
|
483
540
|
runtime(context.manifest, context.console, context.http_get, context.http_post, context._fetch, context.fetch, context.btoa, context.atob, context.globalThis);
|
|
484
541
|
const fn = context.globalThis[options.function];
|
|
485
542
|
if (typeof fn !== 'function') {
|