diff --git a/src/types.ts b/src/types.ts index 3d46582..c32e857 100644 --- a/src/types.ts +++ b/src/types.ts @@ -17,7 +17,7 @@ export type CustomManifest = Manifest & { }; }; -export type Config = Partial & Record<`disableExtractor_${string}`, string>>; +export type Config = Partial & Record<`disableExtractor_${string}`, string>>; export enum CountryCode { multi = 'multi', diff --git a/src/utils/Fetcher.ts b/src/utils/Fetcher.ts index b1acc27..b65bc4c 100644 --- a/src/utils/Fetcher.ts +++ b/src/utils/Fetcher.ts @@ -281,7 +281,7 @@ export class Fetcher { }; protected async fetchWithTimeout(ctx: Context, url: URL, init?: CustomRequestInit, tryCount = 0): Promise { - const proxyUrl = getProxyForUrl(ctx, url); + const proxyUrl = getProxyForUrl(url); const headers = init?.headers as Record | undefined; let message = `Fetch ${init?.method ?? 'GET'} ${url}`; diff --git a/src/utils/__snapshots__/manifest.test.ts.snap b/src/utils/__snapshots__/manifest.test.ts.snap index 085d9cd..50c637e 100644 --- a/src/utils/__snapshots__/manifest.test.ts.snap +++ b/src/utils/__snapshots__/manifest.test.ts.snap @@ -76,12 +76,6 @@ exports[`buildManifest default manifest 1`] = ` "title": "MediaFlow Proxy Password", "type": "password", }, - { - "default": "", - "key": "proxyConfig", - "title": "Proxy Config", - "type": "text", - }, ], "description": "Provides HTTP URLs from streaming websites. Configure add-on for additional languages. Add MediaFlow proxy for more URLs. @@ -136,12 +130,6 @@ exports[`buildManifest disable extractors 1`] = ` "title": "MediaFlow Proxy Password", "type": "password", }, - { - "default": "", - "key": "proxyConfig", - "title": "Proxy Config", - "type": "text", - }, { "default": "checked", "key": "disableExtractor_doodstream", @@ -181,12 +169,6 @@ exports[`buildManifest has checked includeExternalUrls 1`] = ` "title": "MediaFlow Proxy Password", "type": "password", }, - { - "default": "", - "key": "proxyConfig", - "title": "Proxy Config", - "type": "text", - }, ] `; @@ -215,12 +197,6 @@ exports[`buildManifest has checked showErrors 1`] = ` "title": "MediaFlow Proxy Password", "type": "password", }, - { - "default": "", - "key": "proxyConfig", - "title": "Proxy Config", - "type": "text", - }, ] `; @@ -265,12 +241,6 @@ exports[`buildManifest has checked source with appropriate config 1`] = ` "title": "MediaFlow Proxy Password", "type": "password", }, - { - "default": "", - "key": "proxyConfig", - "title": "Proxy Config", - "type": "text", - }, ] `; @@ -323,12 +293,6 @@ exports[`buildManifest has unchecked source without a config 1`] = ` "title": "MediaFlow Proxy Password", "type": "password", }, - { - "default": "", - "key": "proxyConfig", - "title": "Proxy Config", - "type": "text", - }, ] `; @@ -356,11 +320,5 @@ exports[`buildManifest showErrors and includeExternalUrls are unchecked by defau "title": "MediaFlow Proxy Password", "type": "password", }, - { - "default": "", - "key": "proxyConfig", - "title": "Proxy Config", - "type": "text", - }, ] `; diff --git a/src/utils/dispatcher.ts b/src/utils/dispatcher.ts index fe877f5..fe7bed0 100644 --- a/src/utils/dispatcher.ts +++ b/src/utils/dispatcher.ts @@ -1,10 +1,9 @@ import { socksDispatcher } from 'fetch-socks'; import { minimatch } from 'minimatch'; import { Dispatcher, ProxyAgent } from 'undici'; -import { Context } from '../types'; -export const getProxyForUrl = (ctx: Context, url: URL): URL | undefined => { - const proxyConfig = ctx.config['proxyConfig'] || process.env['PROXY_CONFIG']; +export const getProxyForUrl = (url: URL): URL | undefined => { + const proxyConfig = process.env['PROXY_CONFIG']; if (proxyConfig) { for (const rule of proxyConfig.split(',')) { diff --git a/src/utils/manifest.ts b/src/utils/manifest.ts index 475e918..56ae004 100644 --- a/src/utils/manifest.ts +++ b/src/utils/manifest.ts @@ -90,13 +90,6 @@ export const buildManifest = (sources: Source[], extractors: Extractor[], config default: config['mediaFlowProxyPassword'] ?? '', }); - manifest.config.push({ - key: 'proxyConfig', - type: 'text', - title: 'Proxy Config', - default: config['proxyConfig'] ?? '', - }); - extractors.forEach((extractor) => { if (extractor.id === 'external') { return;