update resolve endpoint path
Some checks failed
Deploy Addon / build (SSH_HOST_2, SSH_KEY_2) (push) Has been cancelled
Deploy Addon / build (SSH_HOST_3, SSH_KEY_3) (push) Has been cancelled
Deploy Addon / build (SSH_HOST_4, SSH_KEY_4) (push) Has been cancelled

This commit is contained in:
TheBeastLT 2025-07-02 09:49:25 +03:00
parent 033438f413
commit 8ae31eaca4
2 changed files with 8 additions and 3 deletions

View file

@ -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
})
}

View file

@ -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,