diff --git a/src/controller/ConfigureController.ts b/src/controller/ConfigureController.ts index 2a70292..00049d6 100644 --- a/src/controller/ConfigureController.ts +++ b/src/controller/ConfigureController.ts @@ -18,7 +18,7 @@ export class ConfigureController { this.router.get('/:config/configure', this.getConfigure.bind(this)); } - private readonly getConfigure = (req: Request, res: Response) => { + private getConfigure(req: Request, res: Response) { const config: Config = JSON.parse(req.params['config'] || JSON.stringify(getDefaultConfig())); const manifest = buildManifest(this.sources, config); diff --git a/src/controller/ManifestController.ts b/src/controller/ManifestController.ts index 36b63e9..971032a 100644 --- a/src/controller/ManifestController.ts +++ b/src/controller/ManifestController.ts @@ -17,7 +17,7 @@ export class ManifestController { this.router.get('/:config/manifest.json', this.getManifest.bind(this)); } - private readonly getManifest = (req: Request, res: Response) => { + private getManifest(req: Request, res: Response) { const config: Config = JSON.parse(req.params['config'] || JSON.stringify(getDefaultConfig())); const manifest = buildManifest(this.sources, config); diff --git a/src/controller/StreamController.ts b/src/controller/StreamController.ts index 76c57df..5f45109 100644 --- a/src/controller/StreamController.ts +++ b/src/controller/StreamController.ts @@ -22,7 +22,7 @@ export class StreamController { this.router.get('/:config/stream/:type/:id.json', this.getStream.bind(this)); } - private readonly getStream = async (req: Request, res: Response) => { + private async getStream(req: Request, res: Response) { const config: Config = req.params['config'] ? JSON.parse(req.params['config']) : getDefaultConfig(); const type: ContentType = (req.params['type'] || '') as ContentType; const id: string = req.params['id'] || ''; diff --git a/src/extractor/DoodStream.ts b/src/extractor/DoodStream.ts index 25a6a32..273aa17 100644 --- a/src/extractor/DoodStream.ts +++ b/src/extractor/DoodStream.ts @@ -18,15 +18,17 @@ export class DoodStream extends Extractor { this.fetcher = fetcher; } - public readonly supports = (_ctx: Context, url: URL): boolean => null !== url.host.match(/dood|do[0-9]go|dooodster|dooood/); + public supports(_ctx: Context, url: URL): boolean { + return null !== url.host.match(/dood|do[0-9]go|dooodster|dooood/); + }; - public override readonly normalize = (url: URL): URL => { + public override normalize(url: URL): URL { const videoId = url.pathname.split('/').slice(-1)[0] as string; return new URL(`http://dood.to/e/${videoId}`); }; - protected readonly extractInternal = async (ctx: Context, url: URL, countryCode: CountryCode): Promise => { + protected async extractInternal(ctx: Context, url: URL, countryCode: CountryCode): Promise { const html = await this.fetcher.text(ctx, new URL(url)); const passMd5Match = html.match(/\/pass_md5\/[\w-]+\/([\w-]+)/); diff --git a/src/extractor/Dropload.ts b/src/extractor/Dropload.ts index 327f967..59a5cf6 100644 --- a/src/extractor/Dropload.ts +++ b/src/extractor/Dropload.ts @@ -18,11 +18,13 @@ export class Dropload extends Extractor { this.fetcher = fetcher; } - public readonly supports = (_ctx: Context, url: URL): boolean => null !== url.host.match(/dropload/); + public supports(_ctx: Context, url: URL): boolean { + return null !== url.host.match(/dropload/); + } public override readonly normalize = (url: URL): URL => new URL(url.href.replace('/e/', '/').replace('/embed-', '/')); - protected readonly extractInternal = async (ctx: Context, url: URL, countryCode: CountryCode): Promise => { + protected async extractInternal(ctx: Context, url: URL, countryCode: CountryCode): Promise { const html = await this.fetcher.text(ctx, url); if (html.includes('File Not Found')) { diff --git a/src/extractor/ExternalUrl.ts b/src/extractor/ExternalUrl.ts index 4e791ad..7f0f3cc 100644 --- a/src/extractor/ExternalUrl.ts +++ b/src/extractor/ExternalUrl.ts @@ -17,9 +17,11 @@ export class ExternalUrl extends Extractor { this.fetcher = fetcher; } - public readonly supports = (ctx: Context, url: URL): boolean => showExternalUrls(ctx.config) && null !== url.host.match(/.*/); + public supports(ctx: Context, url: URL): boolean { + return showExternalUrls(ctx.config) && null !== url.host.match(/.*/); + } - protected readonly extractInternal = async (ctx: Context, url: URL, countryCode: CountryCode, title: string | undefined): Promise => { + protected async extractInternal(ctx: Context, url: URL, countryCode: CountryCode, title: string | undefined): Promise { try { // Make sure the URL is accessible, but avoid causing noise and delays doing this await this.fetcher.head(ctx, url, { noFlareSolverr: true, timeout: 1000 }); diff --git a/src/extractor/Extractor.ts b/src/extractor/Extractor.ts index f24456d..393756f 100644 --- a/src/extractor/Extractor.ts +++ b/src/extractor/Extractor.ts @@ -8,13 +8,15 @@ export abstract class Extractor { public readonly ttl: number = 900000; // 15m - public abstract readonly supports: (ctx: Context, url: URL) => boolean; + public abstract supports(ctx: Context, url: URL): boolean; - public readonly normalize = (url: URL): URL => url; + public normalize(url: URL): URL { + return url; + }; - protected abstract readonly extractInternal: (ctx: Context, url: URL, countryCode: CountryCode, title?: string | undefined) => Promise; + protected abstract extractInternal(ctx: Context, url: URL, countryCode: CountryCode, title?: string | undefined): Promise; - public readonly extract = async (ctx: Context, url: URL, countryCode: CountryCode, title?: string | undefined): Promise => { + public async extract(ctx: Context, url: URL, countryCode: CountryCode, title?: string | undefined): Promise { try { return await this.extractInternal(ctx, url, countryCode, title); } catch (error) { diff --git a/src/extractor/ExtractorRegistry.ts b/src/extractor/ExtractorRegistry.ts index a9668ba..a97f1d5 100644 --- a/src/extractor/ExtractorRegistry.ts +++ b/src/extractor/ExtractorRegistry.ts @@ -14,7 +14,7 @@ export class ExtractorRegistry { this.urlResultCache = new TTLCache({ max: 1024 }); } - public readonly handle = async (ctx: Context, url: URL, countryCode: CountryCode, title?: string | undefined): Promise => { + public async handle(ctx: Context, url: URL, countryCode: CountryCode, title?: string | undefined): Promise { const extractor = this.extractors.find(extractor => extractor.supports(ctx, url)); if (!extractor) { return []; diff --git a/src/extractor/Fsst.ts b/src/extractor/Fsst.ts index c192aab..bc328d0 100644 --- a/src/extractor/Fsst.ts +++ b/src/extractor/Fsst.ts @@ -16,9 +16,11 @@ export class Fsst extends Extractor { this.fetcher = fetcher; } - public readonly supports = (_ctx: Context, url: URL): boolean => null !== url.host.match(/fsst/); + public supports(_ctx: Context, url: URL): boolean { + return null !== url.host.match(/fsst/); + }; - protected readonly extractInternal = async (ctx: Context, url: URL, countryCode: CountryCode): Promise => { + protected async extractInternal(ctx: Context, url: URL, countryCode: CountryCode): Promise { const html = await this.fetcher.text(ctx, url); const $ = cheerio.load(html); diff --git a/src/extractor/KinoGer.ts b/src/extractor/KinoGer.ts index e02462e..4b032d0 100644 --- a/src/extractor/KinoGer.ts +++ b/src/extractor/KinoGer.ts @@ -17,11 +17,15 @@ export class KinoGer extends Extractor { this.fetcher = fetcher; } - public readonly supports = (_ctx: Context, url: URL): boolean => null !== url.host.match(/kinoger\.re|shiid4u\.upn\.one|moflix\.upns\.xyz|player\.upn\.one|wasuytm\.store|ultrastream\.online/); + public supports(_ctx: Context, url: URL): boolean { + return null !== url.host.match(/kinoger\.re|shiid4u\.upn\.one|moflix\.upns\.xyz|player\.upn\.one|wasuytm\.store|ultrastream\.online/); + } - public override readonly normalize = (url: URL): URL => new URL(`${url.origin}/api/v1/video?id=${url.hash.slice(1)}`); + public override normalize(url: URL): URL { + return new URL(`${url.origin}/api/v1/video?id=${url.hash.slice(1)}`); + } - protected readonly extractInternal = async (ctx: Context, url: URL, countryCode: CountryCode): Promise => { + protected async extractInternal(ctx: Context, url: URL, countryCode: CountryCode): Promise { const hexData = await this.fetcher.text(ctx, url, { headers: { 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/137.0.0.0 Safari/537.36' } }); const encrypted = Buffer.from(hexData, 'hex'); diff --git a/src/extractor/Soaper.ts b/src/extractor/Soaper.ts index 4770f4a..a9b156f 100644 --- a/src/extractor/Soaper.ts +++ b/src/extractor/Soaper.ts @@ -20,9 +20,11 @@ export class Soaper extends Extractor { this.fetcher = fetcher; } - public readonly supports = (_ctx: Context, url: URL): boolean => null !== url.host.match(/soaper/) && null !== url.pathname.match(/^\/(episode|movie)_/); + public supports(_ctx: Context, url: URL): boolean { + return null !== url.host.match(/soaper/) && null !== url.pathname.match(/^\/(episode|movie)_/); + } - protected readonly extractInternal = async (ctx: Context, url: URL, countryCode: CountryCode, title: string | undefined): Promise => { + protected async extractInternal(ctx: Context, url: URL, countryCode: CountryCode, title: string | undefined): Promise { const movieOrEpisodeId = (url.pathname.match(/\/\w+_(\w+)/) as string[])[1] as string; const form = new URLSearchParams(); diff --git a/src/extractor/SuperVideo.ts b/src/extractor/SuperVideo.ts index 68d923d..f182f87 100644 --- a/src/extractor/SuperVideo.ts +++ b/src/extractor/SuperVideo.ts @@ -18,11 +18,15 @@ export class SuperVideo extends Extractor { this.fetcher = fetcher; } - public readonly supports = (_ctx: Context, url: URL): boolean => null !== url.host.match(/supervideo/); + public supports(_ctx: Context, url: URL): boolean { + return null !== url.host.match(/supervideo/); + } - public override readonly normalize = (url: URL): URL => new URL(url.href.replace('/e/', '/').replace('/embed-', '/')); + public override normalize(url: URL): URL { + return new URL(url.href.replace('/e/', '/').replace('/embed-', '/')); + } - protected readonly extractInternal = async (ctx: Context, url: URL, countryCode: CountryCode): Promise => { + protected async extractInternal(ctx: Context, url: URL, countryCode: CountryCode): Promise { const html = await this.fetcher.text(ctx, url); if (html.includes('This video can be watched as embed only')) { diff --git a/src/extractor/VidSrc.ts b/src/extractor/VidSrc.ts index 6722ad9..939f013 100644 --- a/src/extractor/VidSrc.ts +++ b/src/extractor/VidSrc.ts @@ -18,9 +18,11 @@ export class VidSrc extends Extractor { this.fetcher = fetcher; } - public readonly supports = (_ctx: Context, url: URL): boolean => null !== url.host.match(/vidsrc/); + public supports(_ctx: Context, url: URL): boolean { + return null !== url.host.match(/vidsrc/); + } - protected readonly extractInternal = async (ctx: Context, url: URL, countryCode: CountryCode): Promise => { + protected async extractInternal(ctx: Context, url: URL, countryCode: CountryCode): Promise { const html = await this.fetcher.text(ctx, url); const $ = cheerio.load(html); diff --git a/src/source/CineHDPlus.ts b/src/source/CineHDPlus.ts index 3f787de..d4ef7a4 100644 --- a/src/source/CineHDPlus.ts +++ b/src/source/CineHDPlus.ts @@ -19,7 +19,7 @@ export class CineHDPlus implements Source { this.fetcher = fetcher; } - public readonly handle = async (ctx: Context, _type: string, id: Id): Promise => { + public async handle(ctx: Context, _type: string, id: Id): Promise { const imdbId = await getImdbId(ctx, this.fetcher, id); const seriesPageUrl = await this.fetchSeriesPageUrl(ctx, imdbId); diff --git a/src/source/Eurostreaming.ts b/src/source/Eurostreaming.ts index 91bf5f3..c1b871c 100644 --- a/src/source/Eurostreaming.ts +++ b/src/source/Eurostreaming.ts @@ -19,7 +19,7 @@ export class Eurostreaming implements Source { this.fetcher = fetcher; } - public readonly handle = async (ctx: Context, _type: string, id: Id): Promise => { + public async handle(ctx: Context, _type: string, id: Id): Promise { const imdbId = await getImdbId(ctx, this.fetcher, id); const seriesPageUrl = await this.fetchSeriesPageUrl(ctx, imdbId); diff --git a/src/source/Frembed.ts b/src/source/Frembed.ts index 652b586..e1b0b28 100644 --- a/src/source/Frembed.ts +++ b/src/source/Frembed.ts @@ -18,7 +18,7 @@ export class Frembed implements Source { this.fetcher = fetcher; } - public readonly handle = async (ctx: Context, _type: string, id: Id): Promise => { + public async handle(ctx: Context, _type: string, id: Id): Promise { const tmdbId = await getTmdbId(ctx, this.fetcher, id); const apiUrl = new URL(`https://frembed.space/api/series?id=${tmdbId.id}&sa=${tmdbId.season}&epi=${tmdbId.episode}&idType=tmdb`); diff --git a/src/source/FrenchCloud.ts b/src/source/FrenchCloud.ts index f1be68a..84c56ab 100644 --- a/src/source/FrenchCloud.ts +++ b/src/source/FrenchCloud.ts @@ -19,7 +19,7 @@ export class FrenchCloud implements Source { this.fetcher = fetcher; } - public readonly handle = async (ctx: Context, _type: string, id: Id): Promise => { + public async handle(ctx: Context, _type: string, id: Id): Promise { const imdbId = await getImdbId(ctx, this.fetcher, id); const pageUrl = new URL(`https://frenchcloud.cam/movie/${imdbId.id}`); diff --git a/src/source/KinoGer.ts b/src/source/KinoGer.ts index 099aca4..7df47f6 100644 --- a/src/source/KinoGer.ts +++ b/src/source/KinoGer.ts @@ -21,7 +21,7 @@ export class KinoGer implements Source { this.fetcher = fetcher; } - public readonly handle = async (ctx: Context, _type: string, id: Id): Promise => { + public async handle(ctx: Context, _type: string, id: Id): Promise { const tmdbId = await getTmdbId(ctx, this.fetcher, id); const [keyword, year] = await this.getKeywordAndYear(ctx, tmdbId); diff --git a/src/source/MeineCloud.ts b/src/source/MeineCloud.ts index 8f40e44..1886c39 100644 --- a/src/source/MeineCloud.ts +++ b/src/source/MeineCloud.ts @@ -19,7 +19,7 @@ export class MeineCloud implements Source { this.fetcher = fetcher; } - public readonly handle = async (ctx: Context, _type: string, id: Id): Promise => { + public async handle(ctx: Context, _type: string, id: Id): Promise { const imdbId = await getImdbId(ctx, this.fetcher, id); const pageUrl = new URL(`https://meinecloud.click/movie/${imdbId.id}`); diff --git a/src/source/MostraGuarda.ts b/src/source/MostraGuarda.ts index 6eee42e..7953ed7 100644 --- a/src/source/MostraGuarda.ts +++ b/src/source/MostraGuarda.ts @@ -19,7 +19,7 @@ export class MostraGuarda implements Source { this.fetcher = fetcher; } - public readonly handle = async (ctx: Context, _type: string, id: Id): Promise => { + public async handle(ctx: Context, _type: string, id: Id): Promise { const imdbId = await getImdbId(ctx, this.fetcher, id); const pageUrl = new URL(`https://mostraguarda.stream/movie/${imdbId.id}`); diff --git a/src/source/Soaper.ts b/src/source/Soaper.ts index 94c0f61..c433be4 100644 --- a/src/source/Soaper.ts +++ b/src/source/Soaper.ts @@ -21,7 +21,7 @@ export class Soaper implements Source { this.fetcher = fetcher; } - public readonly handle = async (ctx: Context, _type: string, id: Id): Promise => { + public async handle(ctx: Context, _type: string, id: Id): Promise { const tmdbId = await getTmdbId(ctx, this.fetcher, id); const [keyword, year, hrefPrefix] = await this.getKeywordYearAndHrefPrefix(ctx, tmdbId); diff --git a/src/source/StreamKiste.ts b/src/source/StreamKiste.ts index 58ee1fb..7320ca6 100644 --- a/src/source/StreamKiste.ts +++ b/src/source/StreamKiste.ts @@ -19,7 +19,7 @@ export class StreamKiste implements Source { this.fetcher = fetcher; } - public readonly handle = async (ctx: Context, _type: string, id: Id): Promise => { + public async handle(ctx: Context, _type: string, id: Id): Promise { const imdbId = await getImdbId(ctx, this.fetcher, id); const seriesPageUrl = await this.fetchSeriesPageUrl(ctx, imdbId); diff --git a/src/source/VerHdLink.ts b/src/source/VerHdLink.ts index 6a5538e..1e0f85c 100644 --- a/src/source/VerHdLink.ts +++ b/src/source/VerHdLink.ts @@ -19,7 +19,7 @@ export class VerHdLink implements Source { this.fetcher = fetcher; } - public readonly handle = async (ctx: Context, _type: string, id: Id): Promise => { + public async handle(ctx: Context, _type: string, id: Id): Promise { const imdbId = await getImdbId(ctx, this.fetcher, id); const pageUrl = new URL(`https://verhdlink.cam/movie/${imdbId.id}`); diff --git a/src/source/VidSrc.ts b/src/source/VidSrc.ts index 77120c6..ba9f8ca 100644 --- a/src/source/VidSrc.ts +++ b/src/source/VidSrc.ts @@ -20,7 +20,7 @@ export class VidSrc implements Source { this.fetcher = fetcher; } - public readonly handle = async (ctx: Context, _type: string, id: Id): Promise => { + public async handle(ctx: Context, _type: string, id: Id): Promise { const imdbId = await getImdbId(ctx, this.fetcher, id); const url = imdbId.season diff --git a/src/source/types.ts b/src/source/types.ts index b93c6af..9a324e9 100644 --- a/src/source/types.ts +++ b/src/source/types.ts @@ -18,5 +18,5 @@ export interface Source { readonly countryCodes: CountryCode[]; - readonly handle: (ctx: Context, type: ContentType, id: Id) => Promise<(SourceResult[])>; + handle(ctx: Context, type: ContentType, id: Id): Promise<(SourceResult[])>; } diff --git a/src/utils/Fetcher.ts b/src/utils/Fetcher.ts index 3b53e47..56cd93f 100644 --- a/src/utils/Fetcher.ts +++ b/src/utils/Fetcher.ts @@ -64,19 +64,19 @@ export class Fetcher { this.httpCache = new TTLCache(); } - public readonly text = async (ctx: Context, url: URL, init?: CustomRequestInit): Promise => { + public async text(ctx: Context, url: URL, init?: CustomRequestInit): Promise { return (await this.cachedFetch(ctx, url, init)).body; }; - public readonly textPost = async (ctx: Context, url: URL, body: string, init?: CustomRequestInit): Promise => { + public async textPost(ctx: Context, url: URL, body: string, init?: CustomRequestInit): Promise { return (await this.cachedFetch(ctx, url, { ...init, method: 'POST', body })).body; }; - public readonly head = async (ctx: Context, url: URL, init?: CustomRequestInit): Promise => { + public async head(ctx: Context, url: URL, init?: CustomRequestInit): Promise { return (await this.cachedFetch(ctx, url, { ...init, method: 'HEAD' })).policy.responseHeaders(); }; - public readonly getInit = (ctx: Context, url: URL, init?: CustomRequestInit): CustomRequestInit => { + public getInit(ctx: Context, url: URL, init?: CustomRequestInit): CustomRequestInit { const cookieString = this.cookieJar.getCookieStringSync(url.href); const noReferer = init?.noReferer ?? false; @@ -99,7 +99,7 @@ export class Fetcher { }; }; - private readonly handleHttpCacheItem = async (ctx: Context, httpCacheItem: HttpCacheItem, url: URL, init?: CustomRequestInit): Promise => { + private async handleHttpCacheItem(ctx: Context, httpCacheItem: HttpCacheItem, url: URL, init?: CustomRequestInit): Promise { if (httpCacheItem.status && httpCacheItem.status >= 200 && httpCacheItem.status <= 299) { return httpCacheItem; } @@ -162,7 +162,7 @@ export class Fetcher { throw new HttpError(httpCacheItem.status, httpCacheItem.statusText, responseHeaders); }; - private readonly determineTtl = (httpCacheItem: HttpCacheItem): number => { + private determineTtl(httpCacheItem: HttpCacheItem): number { if (httpCacheItem.status === 200) { return Math.max(httpCacheItem.policy.timeToLive(), 900000); // 15m at least } @@ -170,7 +170,7 @@ export class Fetcher { return httpCacheItem.policy.timeToLive(); }; - private readonly headersToObject = (headers: Headers): Record => { + private headersToObject(headers: Headers): Record { const obj: Record = {}; headers.forEach((value, name) => { @@ -180,7 +180,7 @@ export class Fetcher { return obj; }; - private readonly cachedFetch = async (ctx: Context, url: URL, init?: CustomRequestInit): Promise => { + private async cachedFetch(ctx: Context, url: URL, init?: CustomRequestInit): Promise { const newInit = this.getInit(ctx, url, init); const request: CachePolicy.Request = { url: url.href, method: newInit.method ?? 'GET', headers: {} }; @@ -206,7 +206,7 @@ export class Fetcher { return this.handleHttpCacheItem(ctx, httpCacheItem, url, init); }; - private readonly fetchWithTimeout = async (ctx: Context, url: URL, init?: CustomRequestInit): Promise => { + private async fetchWithTimeout(ctx: Context, url: URL, init?: CustomRequestInit): Promise { this.logger.info(`Fetch ${init?.method ?? 'GET'} ${url}`, ctx); const controller = new AbortController(); @@ -222,9 +222,11 @@ export class Fetcher { return response; }; - private readonly getHostQueueCount = (host: string): number => this.hostQueueCount.get(host) ?? 0; + private getHostQueueCount(host: string): number { + return this.hostQueueCount.get(host) ?? 0; + } - private readonly lockFetchSlot = async (host: string, queueErrorLimit: number) => { + private async lockFetchSlot(host: string, queueErrorLimit: number) { await this.countMutex.runExclusive(() => { if (this.getHostQueueCount(host) > queueErrorLimit) { throw new QueueIsFullError(); @@ -234,13 +236,13 @@ export class Fetcher { }); }; - private readonly unlockFetchSlot = async (host: string) => { + private async unlockFetchSlot(host: string) { await this.countMutex.runExclusive(() => { this.hostQueueCount.set(host, Math.max(0, this.getHostQueueCount(host) - 1)); }); }; - private readonly waitForHostQueueCount = async (host: string, queueLimit: number, queueErrorLimit: number): Promise => { + private async waitForHostQueueCount(host: string, queueLimit: number, queueErrorLimit: number): Promise { while (this.getHostQueueCount(host) > queueLimit) { if (this.getHostQueueCount(host) > queueErrorLimit) { // Very unlikely to happen.. @@ -251,7 +253,7 @@ export class Fetcher { } }; - private readonly queuedFetch = async (ctx: Context, url: URL, init?: CustomRequestInit): Promise => { + private async queuedFetch(ctx: Context, url: URL, init?: CustomRequestInit): Promise { const queueLimit = init?.queueLimit ?? 5; const queueErrorLimit = init?.queueErrorLimit ?? 10; diff --git a/src/utils/StreamResolver.ts b/src/utils/StreamResolver.ts index 5bbffcf..9980820 100644 --- a/src/utils/StreamResolver.ts +++ b/src/utils/StreamResolver.ts @@ -24,7 +24,7 @@ export class StreamResolver { this.extractorRegistry = extractorRegistry; } - public readonly resolve = async (ctx: Context, sources: Source[], type: ContentType, id: Id): Promise => { + public async resolve(ctx: Context, sources: Source[], type: ContentType, id: Id): Promise { if (sources.length === 0) { return { streams: [ @@ -120,7 +120,7 @@ export class StreamResolver { }; }; - private readonly determineTtl = (urlResults: UrlResult[]): number | undefined => { + private determineTtl(urlResults: UrlResult[]): number | undefined { if (!urlResults.length) { return 900000; // 15m } @@ -132,7 +132,7 @@ export class StreamResolver { return Math.min(...urlResults.map(urlResult => urlResult.ttl as number)); }; - private readonly buildUrl = (ctx: Context, urlResult: UrlResult): { externalUrl: string } | { url: string } | { ytId: string } => { + private buildUrl(ctx: Context, urlResult: UrlResult): { externalUrl: string } | { url: string } | { ytId: string } { if (!urlResult.isExternal) { return { url: urlResult.url.href }; } @@ -144,7 +144,7 @@ export class StreamResolver { return { ytId: 'E4WlUXrJgy4' }; }; - private readonly buildName = (ctx: Context, urlResult: UrlResult): string => { + private buildName(ctx: Context, urlResult: UrlResult): string { let name = envGetAppName(); name += urlResult.meta.height ? ` ${urlResult.meta.height}P` : ' N/A'; @@ -156,7 +156,7 @@ export class StreamResolver { return name; }; - private readonly logErrorAndReturnNiceString = (ctx: Context, source: string, error: unknown): string => { + private logErrorAndReturnNiceString(ctx: Context, source: string, error: unknown): string { if (error instanceof BlockedError) { if (error.reason === 'cloudflare_challenge') { this.logger.warn(`${source}: Request was blocked via Cloudflare challenge.`, ctx); @@ -190,7 +190,7 @@ export class StreamResolver { return `❌ Request failed. Request-id: ${ctx.id}.`; }; - private readonly buildTitle = (ctx: Context, urlResult: UrlResult): string => { + private buildTitle(ctx: Context, urlResult: UrlResult): string { const titleLines = []; if (urlResult.meta.title) {