Add temporary option proxyStreams in ProviderMakerOptions

This commit is contained in:
TPN 2024-06-30 13:09:40 +05:30
parent c47034466b
commit 6737c7a68f
No known key found for this signature in database
GPG key ID: 40AE091637892B91
2 changed files with 12 additions and 0 deletions

View file

@ -14,6 +14,7 @@ export interface ProviderControlsInput {
features: FeatureMap;
sources: Sourcerer[];
embeds: Embed[];
proxyStreams?: boolean; // temporary
}
export interface RunnerOptions {
@ -30,6 +31,8 @@ export interface RunnerOptions {
// the media you want to see sources from
media: ScrapeMedia;
proxyStreams?: boolean; // temporary
}
export interface SourceRunnerOptions {
@ -41,6 +44,8 @@ export interface SourceRunnerOptions {
// id of the source scraper you want to scrape from
id: string;
proxyStreams?: boolean; // temporary
}
export interface EmbedRunnerOptions {
@ -52,6 +57,8 @@ export interface EmbedRunnerOptions {
// id of the embed scraper you want to scrape from
id: string;
proxyStreams?: boolean; // temporary
}
export interface ProviderControls {
@ -85,6 +92,7 @@ export function makeControls(ops: ProviderControlsInput): ProviderControls {
features: ops.features,
fetcher: makeFetcher(ops.fetcher),
proxiedFetcher: makeFetcher(ops.proxiedFetcher ?? ops.fetcher),
proxyStreams: ops.proxyStreams,
};
return {

View file

@ -18,6 +18,9 @@ export interface ProviderMakerOptions {
// Set this to true, if the requests will have the same IP as
// the device that the stream will be played on
consistentIpForRequests?: boolean;
// This is temporary
proxyStreams?: boolean;
}
export function makeProviders(ops: ProviderMakerOptions) {
@ -33,5 +36,6 @@ export function makeProviders(ops: ProviderMakerOptions) {
features,
fetcher: ops.fetcher,
proxiedFetcher: ops.proxiedFetcher,
proxyStreams: ops.proxyStreams,
});
}