chore: remove proxyConfig option

This commit is contained in:
WebStreamr 2025-10-24 14:33:39 +00:00
parent e6d8d5076c
commit 6203863523
No known key found for this signature in database
5 changed files with 4 additions and 54 deletions

View file

@ -17,7 +17,7 @@ export type CustomManifest = Manifest & {
};
};
export type Config = Partial<Record<CountryCode | 'showErrors' | 'includeExternalUrls' | 'mediaFlowProxyUrl' | 'mediaFlowProxyPassword' | 'proxyConfig', string> & Record<`disableExtractor_${string}`, string>>;
export type Config = Partial<Record<CountryCode | 'showErrors' | 'includeExternalUrls' | 'mediaFlowProxyUrl' | 'mediaFlowProxyPassword', string> & Record<`disableExtractor_${string}`, string>>;
export enum CountryCode {
multi = 'multi',

View file

@ -281,7 +281,7 @@ export class Fetcher {
};
protected async fetchWithTimeout(ctx: Context, url: URL, init?: CustomRequestInit, tryCount = 0): Promise<Response> {
const proxyUrl = getProxyForUrl(ctx, url);
const proxyUrl = getProxyForUrl(url);
const headers = init?.headers as Record<string, string> | undefined;
let message = `Fetch ${init?.method ?? 'GET'} ${url}`;

View file

@ -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",
},
]
`;

View file

@ -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(',')) {

View file

@ -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;