[addon] passed cached file ids in the urls

This commit is contained in:
TheBeastLT
2020-03-17 22:34:33 +01:00
parent a1d6e5fa80
commit 6490b2fbe8
2 changed files with 31 additions and 22 deletions

View File

@@ -69,10 +69,10 @@ router.get('/:configuration/:resource/:type/:id.json', (req, res, next) => {
});
});
router.get('/realdebrid/:apiKey/:infoHash/:fileIndex?', (req, res) => {
const { apiKey, infoHash, fileIndex } = req.params;
router.get('/realdebrid/:apiKey/:infoHash/:cachedFileIds/:fileIndex?', (req, res) => {
const { apiKey, infoHash, cachedFileIds, fileIndex } = req.params;
console.time(infoHash);
realDebrid.unrestrict(apiKey, infoHash, isNaN(fileIndex) ? undefined : parseInt(fileIndex))
realDebrid.unrestrict(apiKey, infoHash, cachedFileIds, isNaN(fileIndex) ? undefined : parseInt(fileIndex))
.then(url => {
console.timeEnd(infoHash);
res.writeHead(301, { Location: url });