refactor: more consistent import style

This commit is contained in:
WebStreamr 2025-07-02 09:19:40 +00:00
parent 2515a34874
commit 5c7b3fb7f2
No known key found for this signature in database
71 changed files with 1787 additions and 168 deletions

View file

@ -1,9 +1,12 @@
import eslint from '@eslint/js';
import stylistic from '@stylistic/eslint-plugin';
import importPlugin from 'eslint-plugin-import';
import tseslint from 'typescript-eslint';
export default tseslint.config(
eslint.configs.recommended,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
tseslint.configs.strict,
tseslint.configs.stylistic,
stylistic.configs.customize({
@ -16,6 +19,8 @@ export default tseslint.config(
{
rules: {
'@typescript-eslint/explicit-member-accessibility': 'error',
'import/no-unresolved': ['error', { ignore: ['typescript-eslint', 'stremio-addon-sdk'] }],
'import/order': ['error', { 'alphabetize': { order: 'asc', caseInsensitive: true }, 'named': { enabled: true }, 'newlines-between': 'never' }],
},
},
);

1613
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -61,6 +61,7 @@
"@types/stremio-addon-sdk": "^1.6.11",
"babel-jest": "^30.0.0",
"eslint": "^9.26.0",
"eslint-plugin-import": "^2.32.0",
"fetch-mock": "^12.5.2",
"jest": "^30.0.0",
"nodemon": "^3.1.10",

View file

@ -1,8 +1,8 @@
import { Request, Response, Router } from 'express';
import { landingTemplate } from '../landingTemplate';
import { buildManifest, getDefaultConfig } from '../utils';
import { Source } from '../source';
import { Config } from '../types';
import { buildManifest, getDefaultConfig } from '../utils';
export class ConfigureController {
public readonly router: Router;

View file

@ -1,7 +1,7 @@
import { Request, Response, Router } from 'express';
import { buildManifest, getDefaultConfig } from '../utils';
import { Source } from '../source';
import { Config } from '../types';
import { buildManifest, getDefaultConfig } from '../utils';
export class ManifestController {
public readonly router: Router;

View file

@ -1,9 +1,9 @@
import { Request, Response, Router } from 'express';
import { ContentType } from 'stremio-addon-sdk';
import winston from 'winston';
import { Source } from '../source';
import { Config, Context } from '../types';
import { envIsProd, getDefaultConfig, ImdbId, StreamResolver } from '../utils';
import { ContentType } from 'stremio-addon-sdk';
export class StreamController {
public readonly router: Router;

View file

@ -1,9 +1,9 @@
import winston from 'winston';
import { FetcherMock } from '../utils';
import { CountryCode } from '../types';
import { ExtractorRegistry } from './ExtractorRegistry';
import { DoodStream } from './DoodStream';
import { createTestContext } from '../test';
import { CountryCode } from '../types';
import { FetcherMock } from '../utils';
import { DoodStream } from './DoodStream';
import { ExtractorRegistry } from './ExtractorRegistry';
const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] });
const extractorRegistry = new ExtractorRegistry(logger, [new DoodStream(new FetcherMock(`${__dirname}/__fixtures__/DoodStream`))]);

View file

@ -1,9 +1,9 @@
import randomstring from 'randomstring';
import * as cheerio from 'cheerio';
import { Extractor } from './Extractor';
import { Fetcher } from '../utils';
import { Context, CountryCode, Format, UrlResult } from '../types';
import randomstring from 'randomstring';
import { NotFoundError } from '../error';
import { Context, CountryCode, Format, UrlResult } from '../types';
import { Fetcher } from '../utils';
import { Extractor } from './Extractor';
export class DoodStream extends Extractor {
public readonly id = 'doodstream';

View file

@ -1,9 +1,9 @@
import winston from 'winston';
import { FetcherMock } from '../utils';
import { CountryCode } from '../types';
import { ExtractorRegistry } from './ExtractorRegistry';
import { Dropload } from './Dropload';
import { createTestContext } from '../test';
import { CountryCode } from '../types';
import { FetcherMock } from '../utils';
import { Dropload } from './Dropload';
import { ExtractorRegistry } from './ExtractorRegistry';
const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] });
const extractorRegistry = new ExtractorRegistry(logger, [new Dropload(new FetcherMock(`${__dirname}/__fixtures__/Dropload`))]);

View file

@ -1,9 +1,9 @@
import bytes from 'bytes';
import * as cheerio from 'cheerio';
import { Extractor } from './Extractor';
import { extractUrlFromPacked, Fetcher } from '../utils';
import { Context, CountryCode, Format, UrlResult } from '../types';
import { NotFoundError } from '../error';
import { Context, CountryCode, Format, UrlResult } from '../types';
import { extractUrlFromPacked, Fetcher } from '../utils';
import { Extractor } from './Extractor';
export class Dropload extends Extractor {
public readonly id = 'dropload';

View file

@ -1,9 +1,9 @@
import winston from 'winston';
import { FetcherMock } from '../utils';
import { CountryCode } from '../types';
import { ExtractorRegistry } from './ExtractorRegistry';
import { ExternalUrl } from './ExternalUrl';
import { createTestContext } from '../test';
import { CountryCode } from '../types';
import { FetcherMock } from '../utils';
import { ExternalUrl } from './ExternalUrl';
import { ExtractorRegistry } from './ExtractorRegistry';
const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] });
const extractorRegistry = new ExtractorRegistry(logger, [new ExternalUrl(new FetcherMock(`${__dirname}/__fixtures__/ExternalUrl`))]);

View file

@ -1,6 +1,6 @@
import { Extractor } from './Extractor';
import { Fetcher, showExternalUrls } from '../utils';
import { Context, CountryCode, Format, UrlResult } from '../types';
import { Fetcher, showExternalUrls } from '../utils';
import { Extractor } from './Extractor';
export class ExternalUrl extends Extractor {
public readonly id = 'external';

View file

@ -1,5 +1,5 @@
import { Context, CountryCode, Format, UrlResult } from '../types';
import { NotFoundError } from '../error';
import { Context, CountryCode, Format, UrlResult } from '../types';
import { guessHeightFromTitle } from '../utils';
export abstract class Extractor {

View file

@ -1,9 +1,9 @@
import winston from 'winston';
import { ExtractorRegistry } from './ExtractorRegistry';
import { createTestContext } from '../test';
import { CountryCode } from '../types';
import { FetcherMock } from '../utils';
import { ExtractorRegistry } from './ExtractorRegistry';
import { createExtractors } from './index';
import { createTestContext } from '../test';
const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] });
const extractorRegistry = new ExtractorRegistry(logger, createExtractors(new FetcherMock(`${__dirname}/__fixtures__/ExtractorRegistry`)));

View file

@ -1,7 +1,7 @@
import TTLCache from '@isaacs/ttlcache';
import winston from 'winston';
import { Extractor } from './Extractor';
import { Context, CountryCode, UrlResult } from '../types';
import { Extractor } from './Extractor';
export class ExtractorRegistry {
private readonly logger: winston.Logger;

View file

@ -1,9 +1,9 @@
import winston from 'winston';
import { FetcherMock } from '../utils';
import { createTestContext } from '../test';
import { CountryCode } from '../types';
import { FetcherMock } from '../utils';
import { ExtractorRegistry } from './ExtractorRegistry';
import { Fsst } from './Fsst';
import { createTestContext } from '../test';
const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] });
const extractorRegistry = new ExtractorRegistry(logger, [new Fsst(new FetcherMock(`${__dirname}/__fixtures__/Fsst`))]);

View file

@ -1,7 +1,7 @@
import * as cheerio from 'cheerio';
import { Extractor } from './Extractor';
import { Fetcher } from '../utils';
import { Context, CountryCode, Format, UrlResult } from '../types';
import { Fetcher } from '../utils';
import { Extractor } from './Extractor';
export class Fsst extends Extractor {
public readonly id = 'fsst';

View file

@ -1,9 +1,9 @@
import winston from 'winston';
import { FetcherMock } from '../utils';
import { createTestContext } from '../test';
import { CountryCode } from '../types';
import { FetcherMock } from '../utils';
import { ExtractorRegistry } from './ExtractorRegistry';
import { KinoGer } from './KinoGer';
import { createTestContext } from '../test';
const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] });
const extractorRegistry = new ExtractorRegistry(logger, [new KinoGer(new FetcherMock(`${__dirname}/__fixtures__/KinoGer`))]);

View file

@ -1,7 +1,7 @@
import crypto from 'crypto';
import { Extractor } from './Extractor';
import { Fetcher } from '../utils';
import { Context, CountryCode, Format, UrlResult } from '../types';
import { Fetcher } from '../utils';
import { Extractor } from './Extractor';
/** @see https://github.com/Gujal00/ResolveURL/blob/master/script.module.resolveurl/lib/resolveurl/plugins/kinoger.py */
export class KinoGer extends Extractor {

View file

@ -1,9 +1,9 @@
import winston from 'winston';
import { FetcherMock } from '../utils';
import { createTestContext } from '../test';
import { CountryCode } from '../types';
import { FetcherMock } from '../utils';
import { ExtractorRegistry } from './ExtractorRegistry';
import { Mixdrop } from './Mixdrop';
import { createTestContext } from '../test';
const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] });
const extractorRegistry = new ExtractorRegistry(logger, [new Mixdrop(new FetcherMock(`${__dirname}/__fixtures__/Mixdrop`))]);

View file

@ -1,9 +1,9 @@
import bytes from 'bytes';
import * as cheerio from 'cheerio';
import { Extractor } from './Extractor';
import { buildMediaFlowProxyExtractorRedirectUrl, Fetcher, supportsMediaFlowProxy } from '../utils';
import { Context, CountryCode, Format, UrlResult } from '../types';
import { NotFoundError } from '../error';
import { Context, CountryCode, Format, UrlResult } from '../types';
import { buildMediaFlowProxyExtractorRedirectUrl, Fetcher, supportsMediaFlowProxy } from '../utils';
import { Extractor } from './Extractor';
export class Mixdrop extends Extractor {
public readonly id = 'mixdrop';

View file

@ -1,9 +1,9 @@
import winston from 'winston';
import { FetcherMock } from '../utils';
import { createTestContext } from '../test';
import { CountryCode } from '../types';
import { FetcherMock } from '../utils';
import { ExtractorRegistry } from './ExtractorRegistry';
import { Soaper } from './Soaper';
import { createTestContext } from '../test';
const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] });
const extractorRegistry = new ExtractorRegistry(logger, [new Soaper(new FetcherMock(`${__dirname}/__fixtures__/Soaper`))]);

View file

@ -1,6 +1,6 @@
import { Extractor } from './Extractor';
import { Fetcher, guessHeightFromPlaylist } from '../utils';
import { Context, CountryCode, Format, UrlResult } from '../types';
import { Fetcher, guessHeightFromPlaylist } from '../utils';
import { Extractor } from './Extractor';
interface SoaperInfoResponsePartial {
val: string;

View file

@ -1,9 +1,9 @@
import winston from 'winston';
import { FetcherMock } from '../utils';
import { createTestContext } from '../test';
import { CountryCode } from '../types';
import { FetcherMock } from '../utils';
import { ExtractorRegistry } from './ExtractorRegistry';
import { Streamtape } from './Streamtape';
import { createTestContext } from '../test';
const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] });
const extractorRegistry = new ExtractorRegistry(logger, [new Streamtape(new FetcherMock(`${__dirname}/__fixtures__/Streamtape`))]);

View file

@ -1,11 +1,11 @@
import * as cheerio from 'cheerio';
import { Extractor } from './Extractor';
import { Context, CountryCode, Format, UrlResult } from '../types';
import {
buildMediaFlowProxyExtractorRedirectUrl,
Fetcher,
supportsMediaFlowProxy,
} from '../utils';
import { Context, CountryCode, Format, UrlResult } from '../types';
import { Extractor } from './Extractor';
export class Streamtape extends Extractor {
public readonly id = 'streamtape';

View file

@ -1,9 +1,9 @@
import winston from 'winston';
import { FetcherMock } from '../utils';
import { createTestContext } from '../test';
import { CountryCode } from '../types';
import { FetcherMock } from '../utils';
import { ExtractorRegistry } from './ExtractorRegistry';
import { SuperVideo } from './SuperVideo';
import { createTestContext } from '../test';
const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] });
const extractorRegistry = new ExtractorRegistry(logger, [new SuperVideo(new FetcherMock(`${__dirname}/__fixtures__/SuperVideo`))]);

View file

@ -1,9 +1,9 @@
import bytes from 'bytes';
import * as cheerio from 'cheerio';
import { Extractor } from './Extractor';
import { extractUrlFromPacked, Fetcher } from '../utils';
import { Context, CountryCode, Format, UrlResult } from '../types';
import { NotFoundError } from '../error';
import { Context, CountryCode, Format, UrlResult } from '../types';
import { extractUrlFromPacked, Fetcher } from '../utils';
import { Extractor } from './Extractor';
export class SuperVideo extends Extractor {
public readonly id = 'supervideo';

View file

@ -1,9 +1,9 @@
import winston from 'winston';
import { FetcherMock } from '../utils';
import { createTestContext } from '../test';
import { CountryCode } from '../types';
import { FetcherMock } from '../utils';
import { ExtractorRegistry } from './ExtractorRegistry';
import { Uqload } from './Uqload';
import { createTestContext } from '../test';
const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] });
const extractorRegistry = new ExtractorRegistry(logger, [new Uqload(new FetcherMock(`${__dirname}/__fixtures__/Uqload`))]);

View file

@ -1,7 +1,7 @@
import * as cheerio from 'cheerio';
import { Extractor } from './Extractor';
import { buildMediaFlowProxyExtractorRedirectUrl, Fetcher, supportsMediaFlowProxy } from '../utils';
import { Context, CountryCode, Format, UrlResult } from '../types';
import { buildMediaFlowProxyExtractorRedirectUrl, Fetcher, supportsMediaFlowProxy } from '../utils';
import { Extractor } from './Extractor';
export class Uqload extends Extractor {
public readonly id = 'uqload';

View file

@ -1,9 +1,9 @@
import winston from 'winston';
import { FetcherMock } from '../utils';
import { createTestContext } from '../test';
import { CountryCode } from '../types';
import { FetcherMock } from '../utils';
import { ExtractorRegistry } from './ExtractorRegistry';
import { VidSrc } from './VidSrc';
import { createTestContext } from '../test';
const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] });
const extractorRegistry = new ExtractorRegistry(logger, [new VidSrc(new FetcherMock(`${__dirname}/__fixtures__/VidSrc`))]);

View file

@ -1,9 +1,9 @@
import * as cheerio from 'cheerio';
import slugify from 'slugify';
import { Extractor } from './Extractor';
import { Fetcher, guessHeightFromPlaylist } from '../utils';
import { Context, CountryCode, Format, UrlResult } from '../types';
import { NotFoundError } from '../error';
import { Context, CountryCode, Format, UrlResult } from '../types';
import { Fetcher, guessHeightFromPlaylist } from '../utils';
import { Extractor } from './Extractor';
export class VidSrc extends Extractor {
public readonly id = 'vidsrc';

View file

@ -1,9 +1,9 @@
import winston from 'winston';
import { FetcherMock } from '../utils';
import { createTestContext } from '../test';
import { CountryCode } from '../types';
import { FetcherMock } from '../utils';
import { ExtractorRegistry } from './ExtractorRegistry';
import { VixSrc } from './VixSrc';
import { createTestContext } from '../test';
const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] });
const extractorRegistry = new ExtractorRegistry(logger, [new VixSrc(new FetcherMock(`${__dirname}/__fixtures__/VixSrc`))]);

View file

@ -1,5 +1,5 @@
import bytes from 'bytes';
import { Extractor } from './Extractor';
import { Context, CountryCode, Format, UrlResult } from '../types';
import {
buildMediaFlowProxyExtractorStreamUrl,
Fetcher,
@ -7,7 +7,7 @@ import {
iso639FromCountryCode,
supportsMediaFlowProxy,
} from '../utils';
import { Context, CountryCode, Format, UrlResult } from '../types';
import { Extractor } from './Extractor';
export class VixSrc extends Extractor {
public readonly id = 'vixsrc';

View file

@ -1,8 +1,8 @@
import { Fetcher } from '../utils';
import { DoodStream } from './DoodStream';
import { Dropload } from './Dropload';
import { ExternalUrl } from './ExternalUrl';
import { Extractor } from './Extractor';
import { Fetcher } from '../utils';
import { KinoGer } from './KinoGer';
import { Mixdrop } from './Mixdrop';
import { Soaper } from './Soaper';

View file

@ -1,9 +1,9 @@
import express, { NextFunction, Request, Response } from 'express';
import { v4 as uuidv4 } from 'uuid';
import winston from 'winston';
import { CineHDPlus, Cuevana, Eurostreaming, Frembed, FrenchCloud, Source, KinoGer, MeineCloud, MostraGuarda, Soaper, StreamKiste, VerHdLink, VidSrc, VixSrc } from './source';
import { createExtractors, ExtractorRegistry } from './extractor';
import { ConfigureController, ManifestController, StreamController } from './controller';
import { createExtractors, ExtractorRegistry } from './extractor';
import { CineHDPlus, Cuevana, Eurostreaming, Frembed, FrenchCloud, KinoGer, MeineCloud, MostraGuarda, Soaper, Source, StreamKiste, VerHdLink, VidSrc, VixSrc } from './source';
import { envGet, envIsProd, Fetcher, StreamResolver } from './utils';
const logger = winston.createLogger({

View file

@ -1,6 +1,6 @@
import { CineHDPlus } from './CineHDPlus';
import { FetcherMock, ImdbId } from '../utils';
import { createTestContext } from '../test';
import { FetcherMock, ImdbId } from '../utils';
import { CineHDPlus } from './CineHDPlus';
const ctx = createTestContext({ es: 'on', mx: 'on' });

View file

@ -1,8 +1,8 @@
import { ContentType } from 'stremio-addon-sdk';
import * as cheerio from 'cheerio';
import { Source, SourceResult } from './types';
import { Fetcher, getImdbId, Id, ImdbId } from '../utils';
import { ContentType } from 'stremio-addon-sdk';
import { Context, CountryCode } from '../types';
import { Fetcher, getImdbId, Id, ImdbId } from '../utils';
import { Source, SourceResult } from './types';
export class CineHDPlus implements Source {
public readonly id = 'cinehdplus';

View file

@ -1,6 +1,6 @@
import { Cuevana } from './Cuevana';
import { FetcherMock, TmdbId } from '../utils';
import { createTestContext } from '../test';
import { FetcherMock, TmdbId } from '../utils';
import { Cuevana } from './Cuevana';
const ctx = createTestContext({ es: 'on', mx: 'on' });

View file

@ -1,8 +1,8 @@
import { ContentType } from 'stremio-addon-sdk';
import * as cheerio from 'cheerio';
import { Source, SourceResult } from './types';
import { Fetcher, getTmdbId, getTmdbMovieDetails, getTmdbTvDetails, Id, TmdbId } from '../utils';
import { ContentType } from 'stremio-addon-sdk';
import { Context, CountryCode } from '../types';
import { Fetcher, getTmdbId, getTmdbMovieDetails, getTmdbTvDetails, Id, TmdbId } from '../utils';
import { Source, SourceResult } from './types';
export class Cuevana implements Source {
public readonly id = 'cuevana';

View file

@ -1,6 +1,6 @@
import { Eurostreaming } from './Eurostreaming';
import { FetcherMock, TmdbId } from '../utils';
import { createTestContext } from '../test';
import { FetcherMock, TmdbId } from '../utils';
import { Eurostreaming } from './Eurostreaming';
const ctx = createTestContext({ it: 'on' });

View file

@ -1,8 +1,8 @@
import { ContentType } from 'stremio-addon-sdk';
import * as cheerio from 'cheerio';
import { Source, SourceResult } from './types';
import { Fetcher, getTmdbId, getTmdbTvDetails, Id } from '../utils';
import { ContentType } from 'stremio-addon-sdk';
import { Context, CountryCode } from '../types';
import { Fetcher, getTmdbId, getTmdbTvDetails, Id } from '../utils';
import { Source, SourceResult } from './types';
export class Eurostreaming implements Source {
public readonly id = 'eurostreaming';

View file

@ -1,6 +1,6 @@
import { Frembed } from './Frembed';
import { FetcherMock, ImdbId, TmdbId } from '../utils';
import { createTestContext } from '../test';
import { FetcherMock, ImdbId, TmdbId } from '../utils';
import { Frembed } from './Frembed';
const ctx = createTestContext({ fr: 'on' });

View file

@ -1,7 +1,7 @@
import { ContentType } from 'stremio-addon-sdk';
import { Source, SourceResult } from './types';
import { Fetcher, getTmdbId, Id } from '../utils';
import { Context, CountryCode } from '../types';
import { Fetcher, getTmdbId, Id } from '../utils';
import { Source, SourceResult } from './types';
export class Frembed implements Source {
public readonly id = 'frembed';

View file

@ -1,6 +1,6 @@
import { FrenchCloud } from './FrenchCloud';
import { FetcherMock, ImdbId } from '../utils';
import { createTestContext } from '../test';
import { FetcherMock, ImdbId } from '../utils';
import { FrenchCloud } from './FrenchCloud';
const ctx = createTestContext({ fr: 'on' });

View file

@ -1,8 +1,8 @@
import { ContentType } from 'stremio-addon-sdk';
import * as cheerio from 'cheerio';
import { Source, SourceResult } from './types';
import { Fetcher, getImdbId, Id } from '../utils';
import { ContentType } from 'stremio-addon-sdk';
import { Context, CountryCode } from '../types';
import { Fetcher, getImdbId, Id } from '../utils';
import { Source, SourceResult } from './types';
export class FrenchCloud implements Source {
public readonly id = 'frenchcloud';

View file

@ -1,6 +1,6 @@
import { KinoGer } from './KinoGer';
import { FetcherMock, ImdbId } from '../utils';
import { createTestContext } from '../test';
import { FetcherMock, ImdbId } from '../utils';
import { KinoGer } from './KinoGer';
const ctx = createTestContext({ de: 'on' });

View file

@ -1,8 +1,8 @@
import { ContentType } from 'stremio-addon-sdk';
import * as cheerio from 'cheerio';
import { Source, SourceResult } from './types';
import { Fetcher, getTmdbId, getTmdbMovieDetails, getTmdbTvDetails, Id, TmdbId } from '../utils';
import { ContentType } from 'stremio-addon-sdk';
import { Context, CountryCode } from '../types';
import { Fetcher, getTmdbId, getTmdbMovieDetails, getTmdbTvDetails, Id, TmdbId } from '../utils';
import { Source, SourceResult } from './types';
export class KinoGer implements Source {
public readonly id = 'kinoger';

View file

@ -1,6 +1,6 @@
import { MeineCloud } from './MeineCloud';
import { FetcherMock, ImdbId } from '../utils';
import { createTestContext } from '../test';
import { FetcherMock, ImdbId } from '../utils';
import { MeineCloud } from './MeineCloud';
const ctx = createTestContext({ de: 'on' });

View file

@ -1,8 +1,8 @@
import { ContentType } from 'stremio-addon-sdk';
import * as cheerio from 'cheerio';
import { Source, SourceResult } from './types';
import { Fetcher, getImdbId, Id } from '../utils';
import { ContentType } from 'stremio-addon-sdk';
import { Context, CountryCode } from '../types';
import { Fetcher, getImdbId, Id } from '../utils';
import { Source, SourceResult } from './types';
export class MeineCloud implements Source {
public readonly id = 'meinecloud';

View file

@ -1,6 +1,6 @@
import { MostraGuarda } from './MostraGuarda';
import { FetcherMock, ImdbId } from '../utils';
import { createTestContext } from '../test';
import { FetcherMock, ImdbId } from '../utils';
import { MostraGuarda } from './MostraGuarda';
const ctx = createTestContext({ it: 'on' });

View file

@ -1,8 +1,8 @@
import { ContentType } from 'stremio-addon-sdk';
import * as cheerio from 'cheerio';
import { Source, SourceResult } from './types';
import { Fetcher, getImdbId, Id } from '../utils';
import { ContentType } from 'stremio-addon-sdk';
import { Context, CountryCode } from '../types';
import { Fetcher, getImdbId, Id } from '../utils';
import { Source, SourceResult } from './types';
export class MostraGuarda implements Source {
public readonly id = 'mostraguarda';

View file

@ -1,6 +1,6 @@
import { Soaper } from './Soaper';
import { FetcherMock, ImdbId, TmdbId } from '../utils';
import { createTestContext } from '../test';
import { FetcherMock, ImdbId, TmdbId } from '../utils';
import { Soaper } from './Soaper';
const ctx = createTestContext();

View file

@ -1,8 +1,8 @@
import { ContentType } from 'stremio-addon-sdk';
import * as cheerio from 'cheerio';
import { Source, SourceResult } from './types';
import { Fetcher, getTmdbId, getTmdbMovieDetails, getTmdbTvDetails, Id, TmdbId } from '../utils';
import { ContentType } from 'stremio-addon-sdk';
import { Context, CountryCode } from '../types';
import { Fetcher, getTmdbId, getTmdbMovieDetails, getTmdbTvDetails, Id, TmdbId } from '../utils';
import { Source, SourceResult } from './types';
export class Soaper implements Source {
public readonly id = 'soaper';

View file

@ -1,6 +1,6 @@
import { StreamKiste } from './StreamKiste';
import { FetcherMock, ImdbId } from '../utils';
import { createTestContext } from '../test';
import { FetcherMock, ImdbId } from '../utils';
import { StreamKiste } from './StreamKiste';
const ctx = createTestContext({ de: 'on' });

View file

@ -1,8 +1,8 @@
import { ContentType } from 'stremio-addon-sdk';
import * as cheerio from 'cheerio';
import { Source, SourceResult } from './types';
import { ImdbId, Fetcher, getImdbId, Id } from '../utils';
import { ContentType } from 'stremio-addon-sdk';
import { Context, CountryCode } from '../types';
import { Fetcher, getImdbId, Id, ImdbId } from '../utils';
import { Source, SourceResult } from './types';
export class StreamKiste implements Source {
public readonly id = 'streamkiste';

View file

@ -1,6 +1,6 @@
import { VerHdLink } from './VerHdLink';
import { FetcherMock, ImdbId } from '../utils';
import { createTestContext } from '../test';
import { FetcherMock, ImdbId } from '../utils';
import { VerHdLink } from './VerHdLink';
const ctx = createTestContext({ es: 'on', mx: 'on' });

View file

@ -1,8 +1,8 @@
import { ContentType } from 'stremio-addon-sdk';
import * as cheerio from 'cheerio';
import { Source, SourceResult } from './types';
import { Fetcher, getImdbId, Id } from '../utils';
import { ContentType } from 'stremio-addon-sdk';
import { Context, CountryCode } from '../types';
import { Fetcher, getImdbId, Id } from '../utils';
import { Source, SourceResult } from './types';
export class VerHdLink implements Source {
public readonly id = 'verhdlink';

View file

@ -1,6 +1,6 @@
import { VidSrc } from './VidSrc';
import { FetcherMock, ImdbId } from '../utils';
import { createTestContext } from '../test';
import { FetcherMock, ImdbId } from '../utils';
import { VidSrc } from './VidSrc';
const ctx = createTestContext();

View file

@ -1,7 +1,7 @@
import { ContentType } from 'stremio-addon-sdk';
import { Source, SourceResult } from './types';
import { Fetcher, getImdbId, Id } from '../utils';
import { Context, CountryCode } from '../types';
import { Fetcher, getImdbId, Id } from '../utils';
import { Source, SourceResult } from './types';
export class VidSrc implements Source {
public readonly id = 'vidsrc';

View file

@ -1,6 +1,6 @@
import { VixSrc } from './VixSrc';
import { FetcherMock, ImdbId } from '../utils';
import { createTestContext } from '../test';
import { FetcherMock, ImdbId } from '../utils';
import { VixSrc } from './VixSrc';
const ctx = createTestContext();

View file

@ -1,7 +1,7 @@
import { ContentType } from 'stremio-addon-sdk';
import { Source, SourceResult } from './types';
import { Fetcher, getTmdbId, Id } from '../utils';
import { Context, CountryCode } from '../types';
import { Fetcher, getTmdbId, Id } from '../utils';
import { Source, SourceResult } from './types';
export class VixSrc implements Source {
public readonly id = 'vixsrc';

View file

@ -1,10 +1,10 @@
import fetchMock from 'fetch-mock';
import { Agent, ProxyAgent } from 'undici';
import winston from 'winston';
import fetchMock from 'fetch-mock';
import { Fetcher } from './Fetcher';
import { BlockedError, HttpError, NotFoundError, QueueIsFullError, TimeoutError, TooManyRequestsError, TooManyTimeoutsError } from '../error';
import { createTestContext } from '../test';
import { BlockedReason } from '../types';
import { Fetcher } from './Fetcher';
fetchMock.mockGlobal();
const fetcher = new Fetcher(winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] }));

View file

@ -1,15 +1,15 @@
import { Dispatcher, ProxyAgent } from 'undici';
import { clearTimeout } from 'node:timers';
import { gunzipSync, gzipSync } from 'zlib';
import TTLCache from '@isaacs/ttlcache';
import { Mutex, Semaphore, SemaphoreInterface, withTimeout } from 'async-mutex';
import { socksDispatcher } from 'fetch-socks';
import CachePolicy from 'http-cache-semantics';
import { gzipSync, gunzipSync } from 'zlib';
import { LRUCache } from 'lru-cache';
import TTLCache from '@isaacs/ttlcache';
import winston from 'winston';
import { Mutex, Semaphore, SemaphoreInterface, withTimeout } from 'async-mutex';
import { Cookie, CookieJar } from 'tough-cookie';
import { Dispatcher, ProxyAgent } from 'undici';
import winston from 'winston';
import { BlockedError, HttpError, NotFoundError, QueueIsFullError, TimeoutError, TooManyRequestsError, TooManyTimeoutsError } from '../error';
import { BlockedReason, Context } from '../types';
import { BlockedError, HttpError, NotFoundError, QueueIsFullError, TimeoutError, TooManyTimeoutsError, TooManyRequestsError } from '../error';
import { clearTimeout } from 'node:timers';
import { envGet } from './env';
interface HttpCacheItem {

View file

@ -1,9 +1,9 @@
/* istanbul ignore file */
import crypto from 'crypto';
import fs from 'node:fs';
import CachePolicy from 'http-cache-semantics';
import slugify from 'slugify';
import winston from 'winston';
import crypto from 'crypto';
import CachePolicy from 'http-cache-semantics';
import { Context } from '../types';
import { envGet } from './env';
import { Fetcher } from './Fetcher';

View file

@ -1,13 +1,13 @@
import { ContentType } from 'stremio-addon-sdk';
import winston from 'winston';
import { createExtractors, Extractor, ExtractorRegistry } from '../extractor';
import { StreamResolver } from './StreamResolver';
import { MeineCloud, MostraGuarda, Source, SourceResult } from '../source';
import { BlockedReason, CountryCode, Format, UrlResult } from '../types';
import { BlockedError, HttpError, NotFoundError, QueueIsFullError, TimeoutError, TooManyRequestsError, TooManyTimeoutsError } from '../error';
import { ImdbId } from './id';
import { FetcherMock } from './FetcherMock';
import { createExtractors, Extractor, ExtractorRegistry } from '../extractor';
import { MeineCloud, MostraGuarda, Source, SourceResult } from '../source';
import { createTestContext } from '../test';
import { BlockedReason, CountryCode, Format, UrlResult } from '../types';
import { FetcherMock } from './FetcherMock';
import { ImdbId } from './id';
import { StreamResolver } from './StreamResolver';
const logger = winston.createLogger({ transports: [new winston.transports.Console({ level: 'nope' })] });
const fetcher = new FetcherMock(`${__dirname}/__fixtures__/StreamResolver`);

View file

@ -1,8 +1,6 @@
import bytes from 'bytes';
import { ContentType, Stream } from 'stremio-addon-sdk';
import winston from 'winston';
import bytes from 'bytes';
import { BlockedReason, Context, Format, UrlResult } from '../types';
import { Source } from '../source';
import {
BlockedError,
HttpError,
@ -12,11 +10,13 @@ import {
TooManyRequestsError,
TooManyTimeoutsError,
} from '../error';
import { flagFromCountryCode } from './language';
import { ExtractorRegistry } from '../extractor';
import { Source } from '../source';
import { BlockedReason, Context, Format, UrlResult } from '../types';
import { showExternalUrls } from './config';
import { envGetAppName } from './env';
import { Id } from './id';
import { ExtractorRegistry } from '../extractor';
import { showExternalUrls } from './config';
import { flagFromCountryCode } from './language';
interface ResolveResponse {
streams: Stream[];

View file

@ -1,5 +1,5 @@
import { CustomRequestInit, Fetcher } from './Fetcher';
import { Context } from '../types';
import { CustomRequestInit, Fetcher } from './Fetcher';
export const guessHeightFromTitle = (title: string): number | undefined => {
const heightMatch = title.match(/([0-9]+)p/);

View file

@ -1,8 +1,8 @@
import { Context } from '../../types';
import { Fetcher } from '../Fetcher';
import { getImdbIdFromTmdbId, getTmdbIdFromImdbId } from '../tmdb';
import { ImdbId } from './ImdbId';
import { TmdbId } from './TmdbId';
import { getImdbIdFromTmdbId, getTmdbIdFromImdbId } from '../tmdb';
import { Fetcher } from '../Fetcher';
import { Context } from '../../types';
export * from './ImdbId';
export * from './TmdbId';

View file

@ -1,6 +1,6 @@
import { buildManifest } from './manifest';
import { StreamKiste, MeineCloud, VerHdLink, VixSrc } from '../source';
import { MeineCloud, StreamKiste, VerHdLink, VixSrc } from '../source';
import { FetcherMock } from './FetcherMock';
import { buildManifest } from './manifest';
const fetcher = new FetcherMock('/dev/null');

View file

@ -1,7 +1,7 @@
import { getImdbIdFromTmdbId, getTmdbIdFromImdbId } from './tmdb';
import { ImdbId, TmdbId } from './id';
import { FetcherMock } from './FetcherMock';
import { createTestContext } from '../test';
import { FetcherMock } from './FetcherMock';
import { ImdbId, TmdbId } from './id';
import { getImdbIdFromTmdbId, getTmdbIdFromImdbId } from './tmdb';
const fetcher = new FetcherMock(`${__dirname}/__fixtures__/tmdb`);
const ctx = createTestContext();

View file

@ -1,8 +1,8 @@
import { ImdbId, TmdbId } from './id';
import { Context } from '../types';
import { CustomRequestInit, Fetcher } from './Fetcher';
import { envGet } from './env';
import { NotFoundError } from '../error';
import { Context } from '../types';
import { envGet } from './env';
import { CustomRequestInit, Fetcher } from './Fetcher';
import { ImdbId, TmdbId } from './id';
interface FindResponsePartial {
movie_results: {