From 135d90a2334e9598d5cc93d1973db417ef97c253 Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Mon, 22 Dec 2025 13:34:55 +0000 Subject: [PATCH] fix(extractor): use last FileMoon iframe url matcher --- src/extractor/FileMoon.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/extractor/FileMoon.ts b/src/extractor/FileMoon.ts index afc686f..d8bc8b4 100644 --- a/src/extractor/FileMoon.ts +++ b/src/extractor/FileMoon.ts @@ -57,9 +57,10 @@ export class FileMoon extends Extractor { const $ = cheerio.load(html); const title = $('h3').text().trim(); - const iframeUrlMatch = html.match(/iframe.*?src=["'](.*?)["']/); - if (iframeUrlMatch && iframeUrlMatch[1]) { - return await this.extractInternal(ctx, new URL(iframeUrlMatch[1]), { title, ...meta }, url); + const iframeUrlMatches = Array.from(html.matchAll(/iframe.*?src=["'](.*?)["']/g)); + if (iframeUrlMatches.length) { + // Use last match because there can be fake adblock catcher urls before + return await this.extractInternal(ctx, new URL((iframeUrlMatches[iframeUrlMatches.length - 1] as RegExpExecArray)[1] as string), { title, ...meta }, url); } const playlistUrl = await buildMediaFlowProxyExtractorStreamUrl(ctx, this.fetcher, 'FileMoon', originalUrl as URL, headers);