From 8ae31eaca49ef2b930ec5578ab1e0737dce3e4a4 Mon Sep 17 00:00:00 2001 From: TheBeastLT Date: Wed, 2 Jul 2025 09:49:25 +0300 Subject: [PATCH] update resolve endpoint path --- addon/moch/moch.js | 4 ++-- addon/serverless.js | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/addon/moch/moch.js b/addon/moch/moch.js index e3af154..f2f226c 100644 --- a/addon/moch/moch.js +++ b/addon/moch/moch.js @@ -188,7 +188,7 @@ function populateCachedLinks(streams, mochResult, config) { return { name: `[${mochResult.moch.shortName}+] ${stream.name}`, title: stream.title, - url: `${config.host}/${mochResult.moch.key}/${cachedEntry.url}/${streamFilename(stream)}`, + url: `${config.host}/resolve/${mochResult.moch.key}/${cachedEntry.url}/${streamFilename(stream)}`, behaviorHints: stream.behaviorHints }; } @@ -208,7 +208,7 @@ function populateDownloadLinks(streams, results, config) { streams.push({ name: `[${mochResult.moch.shortName} download] ${stream.name}`, title: stream.title, - url: `${config.host}/${mochResult.moch.key}/${cachedEntry.url}/${streamFilename(stream)}`, + url: `${config.host}/resolve/${mochResult.moch.key}/${cachedEntry.url}/${streamFilename(stream)}`, behaviorHints: stream.behaviorHints }) } diff --git a/addon/serverless.js b/addon/serverless.js index 5b4ed8e..89e68fe 100644 --- a/addon/serverless.js +++ b/addon/serverless.js @@ -82,7 +82,12 @@ router.get('/:configuration?/:resource/:type/:id/:extra?.json', limiter, (req, r }); }); -router.get('/:moch/:apiKey/:infoHash/:cachedEntryInfo/:fileIndex/:filename?', (req, res) => { +router.get( + [ + '/:moch/:apiKey/:infoHash/:cachedEntryInfo/:fileIndex/:filename?', + '/resolve/:moch/:apiKey/:infoHash/:cachedEntryInfo/:fileIndex/:filename?' + ], + (req, res) => { const userAgent = req.headers['user-agent'] || ''; const parameters = { mochKey: req.params.moch,