From 39fef831bc6ae4e5e0130e45c0022c0b421b41e0 Mon Sep 17 00:00:00 2001 From: Aetherinox Date: Sat, 31 May 2025 08:43:38 -0700 Subject: [PATCH] fix: add moveonjoy regex fix `fl2.moveonjoy` to `fl6.moveonjoy` --- tvapp2/index.js | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/tvapp2/index.js b/tvapp2/index.js index 589af0a9..991ae7a1 100755 --- a/tvapp2/index.js +++ b/tvapp2/index.js @@ -1522,11 +1522,34 @@ async function serveM3U( res, req ) const updatedContent = formattedContent .replace( /(https?:\/\/[^\s]*thetvapp[^\s]*)/g, ( fullUrl ) => { + Log.debug( `.m3u`, chalk.yellow( `[rewriter]` ), chalk.white( `⚙️` ), + chalk.blueBright( `` ), chalk.gray( `Rewriting url for keyword` ), + chalk.blueBright( `` ), chalk.gray( `*thetvapp` ), + chalk.blueBright( `` ), chalk.gray( `${ fullUrl }` ), + chalk.blueBright( `` ), chalk.gray( `${ baseUrl }/channel?url=${ encodeURIComponent( fullUrl ) }` ) ); + return `${ baseUrl }/channel?url=${ encodeURIComponent( fullUrl ) }`; }) .replace( /(https?:\/\/[^\s]*tvpass[^\s]*)/g, ( fullUrl ) => { + Log.debug( `.m3u`, chalk.yellow( `[rewriter]` ), chalk.white( `⚙️` ), + chalk.blueBright( `` ), chalk.gray( `Rewriting url for keyword` ), + chalk.blueBright( `` ), chalk.gray( `*tvpass` ), + chalk.blueBright( `` ), chalk.gray( `${ fullUrl }` ), + chalk.blueBright( `` ), chalk.gray( `${ baseUrl }/channel?url=${ encodeURIComponent( fullUrl ) }` ) ); + return `${ baseUrl }/channel?url=${ encodeURIComponent( fullUrl ) }`; + }) + .replace( /(https?:\/\/[^\s]*fl2.moveonjoy[^\s]*)/g, ( fullUrl ) => + { + const urlRewrite = fullUrl.replace( 'fl2.moveonjoy', 'fl6.moveonjoy' ); + Log.debug( `.m3u`, chalk.yellow( `[rewriter]` ), chalk.white( `⚙️` ), + chalk.blueBright( `` ), chalk.gray( `Rewriting url for keyword` ), + chalk.blueBright( `` ), chalk.gray( `*fl2.moveonjoy` ), + chalk.blueBright( `` ), chalk.gray( `${ fullUrl }` ), + chalk.blueBright( `` ), chalk.gray( `${ urlRewrite }` ) ); + + return `${ urlRewrite }`; }); res.writeHead( 200, {