From 87ec328a66f5b0cdb5870e5149d687bb788c810a Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Fri, 16 May 2025 15:07:03 +0000 Subject: [PATCH] refactor(extractor): remove embed part from extractor --- src/embed-extractor/index.ts | 1 - src/{embed-extractor => extractor}/DoodStream.ts | 4 ++-- src/{embed-extractor => extractor}/Dropload.ts | 4 ++-- .../EmbedExtractorRegistry.test.ts | 10 +++++----- .../ExtractorRegistry.ts} | 6 +++--- src/{embed-extractor => extractor}/SuperVideo.ts | 4 ++-- src/extractor/index.ts | 1 + src/{embed-extractor => extractor}/types.ts | 2 +- src/handler/CineHDPlus.test.ts | 4 ++-- src/handler/CineHDPlus.ts | 6 +++--- src/handler/Eurostreaming.test.ts | 4 ++-- src/handler/Eurostreaming.ts | 6 +++--- src/handler/FrenchCloud.test.ts | 4 ++-- src/handler/FrenchCloud.ts | 6 +++--- src/handler/KinoKiste.test.ts | 4 ++-- src/handler/KinoKiste.ts | 6 +++--- src/handler/MeineCloud.test.ts | 4 ++-- src/handler/MeineCloud.ts | 6 +++--- src/handler/MostraGuarda.test.ts | 4 ++-- src/handler/MostraGuarda.ts | 6 +++--- src/handler/VerHdLink.test.ts | 4 ++-- src/handler/VerHdLink.ts | 6 +++--- src/index.ts | 4 ++-- src/utils/StreamResolver.test.ts | 4 ++-- src/utils/manifest.test.ts | 6 +++--- 25 files changed, 58 insertions(+), 58 deletions(-) delete mode 100644 src/embed-extractor/index.ts rename src/{embed-extractor => extractor}/DoodStream.ts (93%) rename src/{embed-extractor => extractor}/Dropload.ts (92%) rename src/{embed-extractor => extractor}/EmbedExtractorRegistry.test.ts (58%) rename src/{embed-extractor/EmbedExtractorRegistry.ts => extractor/ExtractorRegistry.ts} (90%) rename src/{embed-extractor => extractor}/SuperVideo.ts (91%) create mode 100644 src/extractor/index.ts rename src/{embed-extractor => extractor}/types.ts (88%) diff --git a/src/embed-extractor/index.ts b/src/embed-extractor/index.ts deleted file mode 100644 index b057ae4..0000000 --- a/src/embed-extractor/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './EmbedExtractorRegistry'; diff --git a/src/embed-extractor/DoodStream.ts b/src/extractor/DoodStream.ts similarity index 93% rename from src/embed-extractor/DoodStream.ts rename to src/extractor/DoodStream.ts index a966edd..fbf3030 100644 --- a/src/embed-extractor/DoodStream.ts +++ b/src/extractor/DoodStream.ts @@ -1,11 +1,11 @@ import randomstring from 'randomstring'; -import { EmbedExtractor } from './types'; +import { Extractor } from './types'; import { Fetcher } from '../utils'; import { Context } from '../types'; // DoodStream does not return the pass_md5 from some IPs like e.g. Oracle cloud // In such cases a VPN might be needed -export class DoodStream implements EmbedExtractor { +export class DoodStream implements Extractor { readonly id = 'doodstream'; readonly label = 'DoodStream'; diff --git a/src/embed-extractor/Dropload.ts b/src/extractor/Dropload.ts similarity index 92% rename from src/embed-extractor/Dropload.ts rename to src/extractor/Dropload.ts index bdb691e..4a76628 100644 --- a/src/embed-extractor/Dropload.ts +++ b/src/extractor/Dropload.ts @@ -1,9 +1,9 @@ -import { EmbedExtractor } from './types'; +import { Extractor } from './types'; import { extractUrlFromPacked, Fetcher } from '../utils'; import { Context } from '../types'; import bytes from 'bytes'; -export class Dropload implements EmbedExtractor { +export class Dropload implements Extractor { readonly id = 'dropload'; readonly label = 'Dropload'; diff --git a/src/embed-extractor/EmbedExtractorRegistry.test.ts b/src/extractor/EmbedExtractorRegistry.test.ts similarity index 58% rename from src/embed-extractor/EmbedExtractorRegistry.test.ts rename to src/extractor/EmbedExtractorRegistry.test.ts index 7e1f010..6fe6fca 100644 --- a/src/embed-extractor/EmbedExtractorRegistry.test.ts +++ b/src/extractor/EmbedExtractorRegistry.test.ts @@ -1,5 +1,5 @@ import winston from 'winston'; -import { EmbedExtractorRegistry } from './EmbedExtractorRegistry'; +import { ExtractorRegistry } from './ExtractorRegistry'; import { Context } from '../types'; import { Fetcher } from '../utils'; jest.mock('../utils/Fetcher'); @@ -7,20 +7,20 @@ jest.mock('../utils/Fetcher'); const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] }); // @ts-expect-error No constructor args needed const fetcher = new Fetcher(); -const embedExtractors = new EmbedExtractorRegistry(logger, fetcher); +const extractorRegistry = new ExtractorRegistry(logger, fetcher); describe('EmbedExtractorRegistry', () => { const ctx: Context = { ip: '127.0.0.1' }; test('returns undefined when no embed extractor can be found', async () => { - const urlResult = await embedExtractors.handle(ctx, new URL('https://some-url.test'), 'en'); + const urlResult = await extractorRegistry.handle(ctx, new URL('https://some-url.test'), 'en'); expect(urlResult).toBeUndefined(); }); test('returns from memory cache if possible', async () => { - const urlResult1 = await embedExtractors.handle(ctx, new URL('https://dropload.io/lyo2h1snpe5c.html'), 'de'); - const urlResult2 = await embedExtractors.handle(ctx, new URL('https://dropload.io/lyo2h1snpe5c.html'), 'de'); + const urlResult1 = await extractorRegistry.handle(ctx, new URL('https://dropload.io/lyo2h1snpe5c.html'), 'de'); + const urlResult2 = await extractorRegistry.handle(ctx, new URL('https://dropload.io/lyo2h1snpe5c.html'), 'de'); expect(urlResult2).toBe(urlResult1); }); diff --git a/src/embed-extractor/EmbedExtractorRegistry.ts b/src/extractor/ExtractorRegistry.ts similarity index 90% rename from src/embed-extractor/EmbedExtractorRegistry.ts rename to src/extractor/ExtractorRegistry.ts index d47dbbc..cf2935f 100644 --- a/src/embed-extractor/EmbedExtractorRegistry.ts +++ b/src/extractor/ExtractorRegistry.ts @@ -1,15 +1,15 @@ import TTLCache from '@isaacs/ttlcache'; import winston from 'winston'; -import { EmbedExtractor } from './types'; +import { Extractor } from './types'; import { Context, UrlResult } from '../types'; import { Fetcher } from '../utils'; import { DoodStream } from './DoodStream'; import { Dropload } from './Dropload'; import { SuperVideo } from './SuperVideo'; -export class EmbedExtractorRegistry { +export class ExtractorRegistry { private readonly logger: winston.Logger; - private readonly embedExtractors: EmbedExtractor[]; + private readonly embedExtractors: Extractor[]; private readonly urlResultCache: TTLCache; constructor(logger: winston.Logger, fetcher: Fetcher) { diff --git a/src/embed-extractor/SuperVideo.ts b/src/extractor/SuperVideo.ts similarity index 91% rename from src/embed-extractor/SuperVideo.ts rename to src/extractor/SuperVideo.ts index 9a58a5c..e458f90 100644 --- a/src/embed-extractor/SuperVideo.ts +++ b/src/extractor/SuperVideo.ts @@ -1,9 +1,9 @@ import bytes from 'bytes'; -import { EmbedExtractor } from './types'; +import { Extractor } from './types'; import { extractUrlFromPacked, Fetcher } from '../utils'; import { Context } from '../types'; -export class SuperVideo implements EmbedExtractor { +export class SuperVideo implements Extractor { readonly id = 'supervideo'; readonly label = 'SuperVideo'; diff --git a/src/extractor/index.ts b/src/extractor/index.ts new file mode 100644 index 0000000..59fdc80 --- /dev/null +++ b/src/extractor/index.ts @@ -0,0 +1 @@ +export * from './ExtractorRegistry'; diff --git a/src/embed-extractor/types.ts b/src/extractor/types.ts similarity index 88% rename from src/embed-extractor/types.ts rename to src/extractor/types.ts index 382bbe2..e3306b9 100644 --- a/src/embed-extractor/types.ts +++ b/src/extractor/types.ts @@ -1,6 +1,6 @@ import { Context, UrlResult } from '../types'; -export interface EmbedExtractor { +export interface Extractor { readonly id: string; readonly label: string; diff --git a/src/handler/CineHDPlus.test.ts b/src/handler/CineHDPlus.test.ts index 581fd29..09f8399 100644 --- a/src/handler/CineHDPlus.test.ts +++ b/src/handler/CineHDPlus.test.ts @@ -1,6 +1,6 @@ import winston from 'winston'; import { CineHDPlus } from './CineHDPlus'; -import { EmbedExtractorRegistry } from '../embed-extractor'; +import { ExtractorRegistry } from '../extractor'; import { Fetcher } from '../utils'; import { Context } from '../types'; jest.mock('../utils/Fetcher'); @@ -8,7 +8,7 @@ jest.mock('../utils/Fetcher'); const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] }); // @ts-expect-error No constructor args needed const fetcher = new Fetcher(); -const handler = new CineHDPlus(fetcher, new EmbedExtractorRegistry(logger, fetcher)); +const handler = new CineHDPlus(fetcher, new ExtractorRegistry(logger, fetcher)); const ctx: Context = { ip: '127.0.0.1' }; describe('CineHDPlus', () => { diff --git a/src/handler/CineHDPlus.ts b/src/handler/CineHDPlus.ts index ddea690..8fbbb84 100644 --- a/src/handler/CineHDPlus.ts +++ b/src/handler/CineHDPlus.ts @@ -1,7 +1,7 @@ import * as cheerio from 'cheerio'; import { Handler } from './types'; import { Fetcher, ImdbId, parseImdbId } from '../utils'; -import { EmbedExtractorRegistry } from '../embed-extractor'; +import { ExtractorRegistry } from '../extractor'; import { Context } from '../types'; export class CineHDPlus implements Handler { @@ -14,9 +14,9 @@ export class CineHDPlus implements Handler { readonly languages = ['es', 'mx']; private readonly fetcher: Fetcher; - private readonly embedExtractors: EmbedExtractorRegistry; + private readonly embedExtractors: ExtractorRegistry; - constructor(fetcher: Fetcher, embedExtractors: EmbedExtractorRegistry) { + constructor(fetcher: Fetcher, embedExtractors: ExtractorRegistry) { this.fetcher = fetcher; this.embedExtractors = embedExtractors; } diff --git a/src/handler/Eurostreaming.test.ts b/src/handler/Eurostreaming.test.ts index 8abe5ef..4d0703a 100644 --- a/src/handler/Eurostreaming.test.ts +++ b/src/handler/Eurostreaming.test.ts @@ -1,6 +1,6 @@ import winston from 'winston'; import { Eurostreaming } from './Eurostreaming'; -import { EmbedExtractorRegistry } from '../embed-extractor'; +import { ExtractorRegistry } from '../extractor'; import { Fetcher } from '../utils'; import { Context } from '../types'; jest.mock('../utils/Fetcher'); @@ -8,7 +8,7 @@ jest.mock('../utils/Fetcher'); const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] }); // @ts-expect-error No constructor args needed const fetcher = new Fetcher(); -const handler = new Eurostreaming(fetcher, new EmbedExtractorRegistry(logger, fetcher)); +const handler = new Eurostreaming(fetcher, new ExtractorRegistry(logger, fetcher)); const ctx: Context = { ip: '127.0.0.1' }; describe('Eurostreaming', () => { diff --git a/src/handler/Eurostreaming.ts b/src/handler/Eurostreaming.ts index b4d2d5d..9fa0e10 100644 --- a/src/handler/Eurostreaming.ts +++ b/src/handler/Eurostreaming.ts @@ -1,7 +1,7 @@ import * as cheerio from 'cheerio'; import { Handler } from './types'; import { ImdbId, parseImdbId, Fetcher } from '../utils'; -import { EmbedExtractorRegistry } from '../embed-extractor'; +import { ExtractorRegistry } from '../extractor'; import { Context } from '../types'; export class Eurostreaming implements Handler { @@ -14,9 +14,9 @@ export class Eurostreaming implements Handler { readonly languages = ['it']; private readonly fetcher: Fetcher; - private readonly embedExtractors: EmbedExtractorRegistry; + private readonly embedExtractors: ExtractorRegistry; - constructor(fetcher: Fetcher, embedExtractors: EmbedExtractorRegistry) { + constructor(fetcher: Fetcher, embedExtractors: ExtractorRegistry) { this.fetcher = fetcher; this.embedExtractors = embedExtractors; } diff --git a/src/handler/FrenchCloud.test.ts b/src/handler/FrenchCloud.test.ts index 3fec195..b1e8b8a 100644 --- a/src/handler/FrenchCloud.test.ts +++ b/src/handler/FrenchCloud.test.ts @@ -1,14 +1,14 @@ import winston from 'winston'; import { FrenchCloud } from './FrenchCloud'; import { Fetcher } from '../utils'; -import { EmbedExtractorRegistry } from '../embed-extractor'; +import { ExtractorRegistry } from '../extractor'; import { Context } from '../types'; jest.mock('../utils/Fetcher'); const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] }); // @ts-expect-error No constructor args needed const fetcher = new Fetcher(); -const handler = new FrenchCloud(fetcher, new EmbedExtractorRegistry(logger, fetcher)); +const handler = new FrenchCloud(fetcher, new ExtractorRegistry(logger, fetcher)); const ctx: Context = { ip: '127.0.0.1' }; describe('FrenchCloud', () => { diff --git a/src/handler/FrenchCloud.ts b/src/handler/FrenchCloud.ts index a02ff74..79411bb 100644 --- a/src/handler/FrenchCloud.ts +++ b/src/handler/FrenchCloud.ts @@ -1,7 +1,7 @@ import * as cheerio from 'cheerio'; import { Handler } from './types'; import { Fetcher, parseImdbId } from '../utils'; -import { EmbedExtractorRegistry } from '../embed-extractor'; +import { ExtractorRegistry } from '../extractor'; import { Context } from '../types'; export class FrenchCloud implements Handler { @@ -14,9 +14,9 @@ export class FrenchCloud implements Handler { readonly languages = ['fr']; private readonly fetcher: Fetcher; - private readonly embedExtractors: EmbedExtractorRegistry; + private readonly embedExtractors: ExtractorRegistry; - constructor(fetcher: Fetcher, embedExtractors: EmbedExtractorRegistry) { + constructor(fetcher: Fetcher, embedExtractors: ExtractorRegistry) { this.fetcher = fetcher; this.embedExtractors = embedExtractors; } diff --git a/src/handler/KinoKiste.test.ts b/src/handler/KinoKiste.test.ts index 89aa5d5..444149b 100644 --- a/src/handler/KinoKiste.test.ts +++ b/src/handler/KinoKiste.test.ts @@ -1,6 +1,6 @@ import winston from 'winston'; import { KinoKiste } from './KinoKiste'; -import { EmbedExtractorRegistry } from '../embed-extractor'; +import { ExtractorRegistry } from '../extractor'; import { Fetcher } from '../utils'; import { Context } from '../types'; jest.mock('../utils/Fetcher'); @@ -8,7 +8,7 @@ jest.mock('../utils/Fetcher'); const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] }); // @ts-expect-error No constructor args needed const fetcher = new Fetcher(); -const handler = new KinoKiste(fetcher, new EmbedExtractorRegistry(logger, fetcher)); +const handler = new KinoKiste(fetcher, new ExtractorRegistry(logger, fetcher)); const ctx: Context = { ip: '127.0.0.1' }; describe('KinoKiste', () => { diff --git a/src/handler/KinoKiste.ts b/src/handler/KinoKiste.ts index b47eb9f..57df55c 100644 --- a/src/handler/KinoKiste.ts +++ b/src/handler/KinoKiste.ts @@ -1,7 +1,7 @@ import * as cheerio from 'cheerio'; import { Handler } from './types'; import { ImdbId, parseImdbId, Fetcher } from '../utils'; -import { EmbedExtractorRegistry } from '../embed-extractor'; +import { ExtractorRegistry } from '../extractor'; import { Context } from '../types'; export class KinoKiste implements Handler { @@ -14,9 +14,9 @@ export class KinoKiste implements Handler { readonly languages = ['de']; private readonly fetcher: Fetcher; - private readonly embedExtractors: EmbedExtractorRegistry; + private readonly embedExtractors: ExtractorRegistry; - constructor(fetcher: Fetcher, embedExtractors: EmbedExtractorRegistry) { + constructor(fetcher: Fetcher, embedExtractors: ExtractorRegistry) { this.fetcher = fetcher; this.embedExtractors = embedExtractors; } diff --git a/src/handler/MeineCloud.test.ts b/src/handler/MeineCloud.test.ts index db72bf5..ff65fef 100644 --- a/src/handler/MeineCloud.test.ts +++ b/src/handler/MeineCloud.test.ts @@ -1,14 +1,14 @@ import winston from 'winston'; import { MeineCloud } from './MeineCloud'; import { Fetcher } from '../utils'; -import { EmbedExtractorRegistry } from '../embed-extractor'; +import { ExtractorRegistry } from '../extractor'; import { Context } from '../types'; jest.mock('../utils/Fetcher'); const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] }); // @ts-expect-error No constructor args needed const fetcher = new Fetcher(); -const handler = new MeineCloud(fetcher, new EmbedExtractorRegistry(logger, fetcher)); +const handler = new MeineCloud(fetcher, new ExtractorRegistry(logger, fetcher)); const ctx: Context = { ip: '127.0.0.1' }; describe('MeineCloud', () => { diff --git a/src/handler/MeineCloud.ts b/src/handler/MeineCloud.ts index dbd854a..73b5277 100644 --- a/src/handler/MeineCloud.ts +++ b/src/handler/MeineCloud.ts @@ -1,7 +1,7 @@ import * as cheerio from 'cheerio'; import { Handler } from './types'; import { Fetcher, parseImdbId } from '../utils'; -import { EmbedExtractorRegistry } from '../embed-extractor'; +import { ExtractorRegistry } from '../extractor'; import { Context } from '../types'; export class MeineCloud implements Handler { @@ -14,9 +14,9 @@ export class MeineCloud implements Handler { readonly languages = ['de']; private readonly fetcher: Fetcher; - private readonly embedExtractors: EmbedExtractorRegistry; + private readonly embedExtractors: ExtractorRegistry; - constructor(fetcher: Fetcher, embedExtractors: EmbedExtractorRegistry) { + constructor(fetcher: Fetcher, embedExtractors: ExtractorRegistry) { this.fetcher = fetcher; this.embedExtractors = embedExtractors; } diff --git a/src/handler/MostraGuarda.test.ts b/src/handler/MostraGuarda.test.ts index 3b748fc..0b07098 100644 --- a/src/handler/MostraGuarda.test.ts +++ b/src/handler/MostraGuarda.test.ts @@ -1,14 +1,14 @@ import winston from 'winston'; import { MostraGuarda } from './MostraGuarda'; import { Fetcher } from '../utils'; -import { EmbedExtractorRegistry } from '../embed-extractor'; +import { ExtractorRegistry } from '../extractor'; import { Context } from '../types'; jest.mock('../utils/Fetcher'); const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] }); // @ts-expect-error No constructor args needed const fetcher = new Fetcher(); -const handler = new MostraGuarda(fetcher, new EmbedExtractorRegistry(logger, fetcher)); +const handler = new MostraGuarda(fetcher, new ExtractorRegistry(logger, fetcher)); const ctx: Context = { ip: '127.0.0.1' }; describe('MostraGuarda', () => { diff --git a/src/handler/MostraGuarda.ts b/src/handler/MostraGuarda.ts index 561f3a3..9f1f6ff 100644 --- a/src/handler/MostraGuarda.ts +++ b/src/handler/MostraGuarda.ts @@ -1,7 +1,7 @@ import * as cheerio from 'cheerio'; import { Handler } from './types'; import { Fetcher, parseImdbId } from '../utils'; -import { EmbedExtractorRegistry } from '../embed-extractor'; +import { ExtractorRegistry } from '../extractor'; import { Context } from '../types'; export class MostraGuarda implements Handler { @@ -14,9 +14,9 @@ export class MostraGuarda implements Handler { readonly languages = ['it']; private readonly fetcher: Fetcher; - private readonly embedExtractors: EmbedExtractorRegistry; + private readonly embedExtractors: ExtractorRegistry; - constructor(fetcher: Fetcher, embedExtractors: EmbedExtractorRegistry) { + constructor(fetcher: Fetcher, embedExtractors: ExtractorRegistry) { this.fetcher = fetcher; this.embedExtractors = embedExtractors; } diff --git a/src/handler/VerHdLink.test.ts b/src/handler/VerHdLink.test.ts index 7666a56..693defa 100644 --- a/src/handler/VerHdLink.test.ts +++ b/src/handler/VerHdLink.test.ts @@ -1,14 +1,14 @@ import winston from 'winston'; import { VerHdLink } from './VerHdLink'; import { Fetcher } from '../utils'; -import { EmbedExtractorRegistry } from '../embed-extractor'; +import { ExtractorRegistry } from '../extractor'; import { Context } from '../types'; jest.mock('../utils/Fetcher'); const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] }); // @ts-expect-error No constructor args needed const fetcher = new Fetcher(); -const handler = new VerHdLink(fetcher, new EmbedExtractorRegistry(logger, fetcher)); +const handler = new VerHdLink(fetcher, new ExtractorRegistry(logger, fetcher)); const ctx: Context = { ip: '127.0.0.1' }; describe('VerHdLink', () => { diff --git a/src/handler/VerHdLink.ts b/src/handler/VerHdLink.ts index 5b97aca..1754441 100644 --- a/src/handler/VerHdLink.ts +++ b/src/handler/VerHdLink.ts @@ -1,7 +1,7 @@ import * as cheerio from 'cheerio'; import { Handler } from './types'; import { Fetcher, parseImdbId } from '../utils'; -import { EmbedExtractorRegistry } from '../embed-extractor'; +import { ExtractorRegistry } from '../extractor'; import { Context } from '../types'; export class VerHdLink implements Handler { @@ -14,9 +14,9 @@ export class VerHdLink implements Handler { readonly languages = ['es', 'mx']; private readonly fetcher: Fetcher; - private readonly embedExtractors: EmbedExtractorRegistry; + private readonly embedExtractors: ExtractorRegistry; - constructor(fetcher: Fetcher, embedExtractors: EmbedExtractorRegistry) { + constructor(fetcher: Fetcher, embedExtractors: ExtractorRegistry) { this.fetcher = fetcher; this.embedExtractors = embedExtractors; } diff --git a/src/index.ts b/src/index.ts index 549e9f0..9f2398f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -13,7 +13,7 @@ import { MostraGuarda, VerHdLink, } from './handler'; -import { EmbedExtractorRegistry } from './embed-extractor'; +import { ExtractorRegistry } from './extractor'; import { ConfigureController, ManifestController, StreamController } from './controller'; import { Fetcher, StreamResolver } from './utils'; @@ -38,7 +38,7 @@ axiosRetry(axios, { const fetcher = new Fetcher(axios, logger); -const embedExtractors = new EmbedExtractorRegistry(logger, fetcher); +const embedExtractors = new ExtractorRegistry(logger, fetcher); const handlers: Handler[] = [ // ES / MX diff --git a/src/utils/StreamResolver.test.ts b/src/utils/StreamResolver.test.ts index 373b04e..7d21a58 100644 --- a/src/utils/StreamResolver.test.ts +++ b/src/utils/StreamResolver.test.ts @@ -1,5 +1,5 @@ import winston from 'winston'; -import { EmbedExtractorRegistry } from '../embed-extractor'; +import { ExtractorRegistry } from '../extractor'; import { StreamResolver } from './StreamResolver'; import { MeineCloud, MostraGuarda } from '../handler'; import { Fetcher } from './Fetcher'; @@ -12,7 +12,7 @@ const ctx: Context = { ip: '127.0.0.1' }; // @ts-expect-error No constructor args needed const fetcher = new Fetcher(); -const embedExtractorRegistry = new EmbedExtractorRegistry(logger, fetcher); +const embedExtractorRegistry = new ExtractorRegistry(logger, fetcher); const meineCloud = new MeineCloud(fetcher, embedExtractorRegistry); const mostraGuarda = new MostraGuarda(fetcher, embedExtractorRegistry); diff --git a/src/utils/manifest.test.ts b/src/utils/manifest.test.ts index b7d1c41..5b69b9d 100644 --- a/src/utils/manifest.test.ts +++ b/src/utils/manifest.test.ts @@ -2,7 +2,7 @@ import winston from 'winston'; import { buildManifest } from './manifest'; import { KinoKiste } from '../handler'; import { Fetcher } from './Fetcher'; -import { EmbedExtractorRegistry } from '../embed-extractor'; +import { ExtractorRegistry } from '../extractor'; const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] }); // @ts-expect-error No constructor args needed @@ -16,14 +16,14 @@ describe('buildManifest', () => { }); test('has unchecked handler without a config', () => { - const manifest = buildManifest([new KinoKiste(fetcher, new EmbedExtractorRegistry(logger, fetcher))], {}); + const manifest = buildManifest([new KinoKiste(fetcher, new ExtractorRegistry(logger, fetcher))], {}); expect(manifest.config).toHaveLength(1); expect(manifest.config[0]?.default).toBeUndefined(); }); test('has checked handler with appropriate config', () => { - const kinokiste = new KinoKiste(fetcher, new EmbedExtractorRegistry(logger, fetcher)); + const kinokiste = new KinoKiste(fetcher, new ExtractorRegistry(logger, fetcher)); const manifest = buildManifest([kinokiste], { [kinokiste.id]: 'on' }); expect(manifest.config).toHaveLength(1);