[addon] removes moch url resolving from addon
This commit is contained in:
@@ -4,7 +4,6 @@ const addonInterface = require('./addon');
|
||||
const { manifest } = require('./lib/manifest');
|
||||
const parseConfiguration = require('./lib/configuration');
|
||||
const landingTemplate = require('./lib/landingTemplate');
|
||||
const realDebrid = require('./moch/realdebrid');
|
||||
|
||||
const router = getRouter(addonInterface);
|
||||
const limiter = rateLimit({
|
||||
@@ -69,22 +68,6 @@ router.get('/:configuration/:resource/:type/:id.json', (req, res, next) => {
|
||||
});
|
||||
});
|
||||
|
||||
router.get('/realdebrid/:apiKey/:infoHash/:cachedFileIds/:fileIndex?', (req, res) => {
|
||||
const { apiKey, infoHash, cachedFileIds, fileIndex } = req.params;
|
||||
console.log(`Unrestricting ${infoHash} [${fileIndex}]`);
|
||||
realDebrid.unrestrict(apiKey, infoHash, cachedFileIds, isNaN(fileIndex) ? undefined : parseInt(fileIndex))
|
||||
.then(url => {
|
||||
console.log(`Unrestricted ${infoHash} [${fileIndex}] to ${url}`);
|
||||
res.writeHead(301, { Location: url });
|
||||
res.end();
|
||||
})
|
||||
.catch(error => {
|
||||
console.log(error);
|
||||
res.statusCode = 404;
|
||||
res.end();
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = function (req, res) {
|
||||
router(req, res, function () {
|
||||
res.statusCode = 404;
|
||||
|
||||
Reference in New Issue
Block a user