From 31f6a7e8518f98a734456967129566b09f87912a Mon Sep 17 00:00:00 2001 From: Adrian Castro <22133246+castdrian@users.noreply.github.com> Date: Tue, 20 Feb 2024 16:18:59 +0100 Subject: [PATCH] chore: cleanup --- packages/provider-utils/src/video.ts | 100 --------------------------- 1 file changed, 100 deletions(-) diff --git a/packages/provider-utils/src/video.ts b/packages/provider-utils/src/video.ts index a0899a6..44117fe 100644 --- a/packages/provider-utils/src/video.ts +++ b/packages/provider-utils/src/video.ts @@ -116,106 +116,6 @@ export async function getVideoStreamFromEmbed({ return embedResult; } -// export async function getVideoStream({ -// sourceId, -// media, -// forceVTT, -// onEvent, -// }: { -// sourceId?: string; -// media: ScrapeMedia; -// forceVTT?: boolean; -// onEvent?: (event: RunnerEvent) => void; -// }): Promise { -// const providers = makeProviders({ -// fetcher: makeStandardFetcher(fetch), -// target: targets.NATIVE, -// consistentIpForRequests: true, -// }); - -// const options: RunnerOptions = { -// media, -// events: { -// init: onEvent, -// update: onEvent, -// discoverEmbeds: onEvent, -// start: onEvent, -// }, -// }; - -// let stream: Stream | null = null; - -// if (sourceId) { -// onEvent && onEvent({ sourceIds: [sourceId] }); - -// let embedOutput: EmbedOutput | undefined; - -// const sourceResult = await providers -// .runSourceScraper({ -// id: sourceId, -// media, -// events: {}, -// }) -// .catch((error: Error) => { -// onEvent && -// onEvent({ id: sourceId, percentage: 0, status: "failure", error }); -// return undefined; -// }); - -// if (sourceResult) { -// onEvent && onEvent({ id: sourceId, percentage: 50, status: "pending" }); - -// for (const embed of sourceResult.embeds) { -// const embedResult = await providers -// .runEmbedScraper({ -// id: embed.embedId, -// url: embed.url, -// }) -// .catch(() => undefined); - -// if (embedResult) { -// embedOutput = embedResult; -// onEvent && -// onEvent({ id: embed.embedId, percentage: 100, status: "success" }); -// } -// } -// } - -// if (embedOutput) { -// stream = embedOutput.stream[0] ?? null; -// } else if (sourceResult) { -// stream = sourceResult.stream?.[0] ?? null; -// } - -// if (stream) { -// onEvent && onEvent({ id: sourceId, percentage: 100, status: "success" }); -// } else { -// onEvent && onEvent({ id: sourceId, percentage: 100, status: "notfound" }); -// } -// } else { -// stream = await providers -// .runAll(options) -// .then((result) => result?.stream ?? null); -// } - -// if (!stream) return null; - -// if (forceVTT) { -// if (stream.captions && stream.captions.length > 0) { -// for (const caption of stream.captions) { -// if (caption.type === "srt") { -// const response = await fetch(caption.url); -// const srtSubtitle = await response.blob(); -// const vttSubtitleUrl = await toWebVTT(srtSubtitle); -// caption.url = vttSubtitleUrl; -// caption.type = "vtt"; -// } -// } -// } -// } -// return stream; -// } - export function findHighestQuality( stream: FileBasedStream, ): Qualities | undefined {