organized/fixed streams

This commit is contained in:
2026-10-31 12:37:24 -07:00
parent 95f4991914
commit 7473c0fa15
51 changed files with 2920 additions and 3059 deletions

View File

@@ -9,7 +9,7 @@ async function safeImport(moduleName) {
}
export async function getStream(args) {
const { id, s, e, clientIP, sdk } = args;
const { id, s, e, clientIP, sdk } = args || {};
const isTv = s != null && e != null;
const type = isTv ? 'tv' : 'movie';
const allUrls = [];
@@ -64,5 +64,11 @@ export async function getStream(args) {
})
);
return allUrls.length ? { allUrls } : null;
if (!allUrls.length) return null;
return {
url: allUrls[0].url,
headers: allUrls[0].headers,
allUrls,
};
}