feat: add extractors bundled in file refactor stream handling in multiple providers

This commit is contained in:
Himanshu
2026-02-02 23:24:38 +05:30
parent 2183412dc8
commit 13d41f9da6
220 changed files with 1300 additions and 771 deletions

View File

@@ -1,4 +1,5 @@
import { ProviderContext, Stream } from "../types";
import { hubcloudExtractor } from "../extractors/hubcloud";
const headers = {
Accept:
@@ -31,8 +32,7 @@ export async function getStream({
signal: AbortSignal;
providerContext: ProviderContext;
}) {
const { axios, cheerio, extractors } = providerContext;
const { hubcloudExtracter } = extractors;
const { axios, cheerio, commonHeaders } = providerContext;
try {
const streamLinks: Stream[] = [];
console.log("dotlink", link);
@@ -49,7 +49,7 @@ export async function getStream({
try {
const $ = cheerio.load(dotlinkText);
const filepressLink = $(
'.btn.btn-sm.btn-outline[style="background:linear-gradient(135deg,rgb(252,185,0) 0%,rgb(0,0,0)); color: #fdf8f2;"]'
'.btn.btn-sm.btn-outline[style="background:linear-gradient(135deg,rgb(252,185,0) 0%,rgb(0,0,0)); color: #fdf8f2;"]',
)
.parent()
.attr("href");
@@ -73,7 +73,7 @@ export async function getStream({
"Content-Type": "application/json",
Referer: filepressBaseUrl,
},
}
},
);
// console.log('filepressTokenRes', filepressTokenRes.data);
if (filepressTokenRes.data?.status) {
@@ -90,7 +90,7 @@ export async function getStream({
"Content-Type": "application/json",
Referer: filepressBaseUrl,
},
}
},
);
// console.log('filepressStreamLink', filepressStreamLink.data);
streamLinks.push({
@@ -105,7 +105,7 @@ export async function getStream({
}
}
return await hubcloudExtracter(link, signal);
return await hubcloudExtractor(link, signal, axios, cheerio, commonHeaders);
} catch (error: any) {
console.log("getStream error: ", error);
if (error.message.includes("Aborted")) {