feat: allow to disable extractors via env var
This commit is contained in:
parent
f89d90619a
commit
737bf6aa94
1 changed files with 25 additions and 21 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { Fetcher } from '../utils';
|
||||
import { envGet, Fetcher } from '../utils';
|
||||
import { DoodStream } from './DoodStream';
|
||||
import { Dropload } from './Dropload';
|
||||
import { ExternalUrl } from './ExternalUrl';
|
||||
|
|
@ -22,23 +22,27 @@ import { YouTube } from './YouTube';
|
|||
export * from './Extractor';
|
||||
export * from './ExtractorRegistry';
|
||||
|
||||
export const createExtractors = (fetcher: Fetcher): Extractor[] => [
|
||||
new DoodStream(fetcher),
|
||||
new Dropload(fetcher),
|
||||
new Fastream(fetcher),
|
||||
new FileLions(fetcher),
|
||||
new HubCloud(fetcher),
|
||||
new KinoGer(fetcher),
|
||||
new Mixdrop(fetcher),
|
||||
new SaveFiles(fetcher),
|
||||
new Soaper(fetcher),
|
||||
new StreamEmbed(fetcher),
|
||||
new Streamtape(fetcher),
|
||||
new SuperVideo(fetcher),
|
||||
new Uqload(fetcher),
|
||||
new VidSrc(fetcher, ['in', 'net', 'xyz', 'io', 'vc']), // https://vidsrc.domains/
|
||||
new VixSrc(fetcher),
|
||||
new XPrime(fetcher),
|
||||
new YouTube(fetcher),
|
||||
new ExternalUrl(fetcher), // fallback extractor which must come last
|
||||
];
|
||||
export const createExtractors = (fetcher: Fetcher): Extractor[] => {
|
||||
const disabledExtractors = envGet('DISABLED_EXTRACTORS')?.split(',') ?? [];
|
||||
|
||||
return [
|
||||
new DoodStream(fetcher),
|
||||
new Dropload(fetcher),
|
||||
new Fastream(fetcher),
|
||||
new FileLions(fetcher),
|
||||
new HubCloud(fetcher),
|
||||
new KinoGer(fetcher),
|
||||
new Mixdrop(fetcher),
|
||||
new SaveFiles(fetcher),
|
||||
new Soaper(fetcher),
|
||||
new StreamEmbed(fetcher),
|
||||
new Streamtape(fetcher),
|
||||
new SuperVideo(fetcher),
|
||||
new Uqload(fetcher),
|
||||
new VidSrc(fetcher, ['in', 'net', 'xyz', 'io', 'vc']), // https://vidsrc.domains/
|
||||
new VixSrc(fetcher),
|
||||
new XPrime(fetcher),
|
||||
new YouTube(fetcher),
|
||||
new ExternalUrl(fetcher), // fallback extractor which must come last
|
||||
].filter(extractor => !disabledExtractors.includes(extractor.id));
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue