mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
fix: update getStream function to directly use hubcloudExtracter with axios and cheerio
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { ProviderContext, Stream } from "../types";
|
||||
import { hubcloudExtracter } from "../extractors";
|
||||
|
||||
const headers = {
|
||||
Accept:
|
||||
@@ -32,8 +33,7 @@ export async function getStream({
|
||||
signal: AbortSignal;
|
||||
providerContext: ProviderContext;
|
||||
}) {
|
||||
const { axios, cheerio, extractors } = providerContext;
|
||||
const { hubcloudExtracter } = extractors;
|
||||
const { axios, cheerio } = providerContext;
|
||||
try {
|
||||
const streamLinks: Stream[] = [];
|
||||
console.log("dotlink", link);
|
||||
@@ -106,7 +106,7 @@ export async function getStream({
|
||||
}
|
||||
}
|
||||
|
||||
return await hubcloudExtracter(link, signal);
|
||||
return await hubcloudExtracter(link, signal, { axios, cheerio });
|
||||
} catch (error: any) {
|
||||
console.log("getStream error: ", error);
|
||||
if (error.message.includes("Aborted")) {
|
||||
|
||||
Reference in New Issue
Block a user