mirror of
https://github.com/vega-org/vega-providers.git
synced 2026-04-17 23:51:44 +00:00
Reapply "feat: add extractors bundled in file refactor stream handling in multiple providers"
This reverts commit ef46918fec.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { ProviderContext, Stream } from "../types";
|
||||
import { hubcloudExtractor } from "../extractors/hubcloud";
|
||||
|
||||
const headers = {
|
||||
Accept:
|
||||
@@ -22,8 +23,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[] = [];
|
||||
@@ -43,7 +43,13 @@ export async function getStream({
|
||||
});
|
||||
|
||||
// --- hubcloud extraction ---
|
||||
const hubcloudStreams = await hubcloudExtracter(link, signal);
|
||||
const hubcloudStreams = await hubcloudExtractor(
|
||||
link,
|
||||
signal,
|
||||
axios,
|
||||
cheerio,
|
||||
commonHeaders,
|
||||
);
|
||||
streamLinks.push(...hubcloudStreams);
|
||||
|
||||
return streamLinks;
|
||||
|
||||
Reference in New Issue
Block a user