refactor: simplify getStream function by integrating hubcloudExtracter from context

This commit is contained in:
Himanshu
2025-12-14 17:18:46 +05:30
parent cc3b16d326
commit a087f22eb1
2 changed files with 4 additions and 4 deletions

View File

@@ -1,5 +1,4 @@
import { ProviderContext, Stream } from "../types";
import { hubcloudExtracter } from "../extractors";
const headers = {
Accept:
@@ -33,7 +32,8 @@ export async function getStream({
signal: AbortSignal;
providerContext: ProviderContext;
}) {
const { axios, cheerio } = providerContext;
const { axios, cheerio, extractors } = providerContext;
const { hubcloudExtracter } = extractors;
try {
const streamLinks: Stream[] = [];
console.log("dotlink", link);
@@ -106,7 +106,7 @@ export async function getStream({
}
}
return await hubcloudExtracter(link, signal, { axios, cheerio });
return await hubcloudExtracter(link, signal);
} catch (error: any) {
console.log("getStream error: ", error);
if (error.message.includes("Aborted")) {