[addon] fix debrid link logging

This commit is contained in:
TheBeastLT
2021-03-10 10:08:31 +01:00
parent 678e05b7af
commit e5223c0c98
2 changed files with 3 additions and 3 deletions

View File

@@ -118,13 +118,13 @@ async function _unrestrictLink(DL, torrent, fileIndex) {
: torrent.files.filter(file => file.downloadPercent === 100).sort((a, b) => b.size - a.size)[0]; : torrent.files.filter(file => file.downloadPercent === 100).sort((a, b) => b.size - a.size)[0];
if (!targetFile && isArchive(targetFile.downloadUrl)) { if (!targetFile && isArchive(targetFile.downloadUrl)) {
console.log(`Only DebridLink archive is available for [${torrent.hash}] ${fileIndex}`) console.log(`Only DebridLink archive is available for [${torrent.hashString}] ${fileIndex}`)
return StaticResponse.FAILED_RAR; return StaticResponse.FAILED_RAR;
} }
if (!targetFile || !targetFile.downloadUrl) { if (!targetFile || !targetFile.downloadUrl) {
return Promise.reject(`No DebridLink links found for index ${fileIndex} in: ${JSON.stringify(torrent)}`); return Promise.reject(`No DebridLink links found for index ${fileIndex} in: ${JSON.stringify(torrent)}`);
} }
console.log(`Unrestricted DebridLink ${torrent.hash} [${fileIndex}] to ${targetFile.downloadUrl}`); console.log(`Unrestricted DebridLink ${torrent.hashString} [${fileIndex}] to ${targetFile.downloadUrl}`);
return targetFile.downloadUrl; return targetFile.downloadUrl;
} }

View File

@@ -80,7 +80,7 @@ router.get('/:moch/:apiKey/:infoHash/:cachedEntryInfo/:fileIndex?', (req, res) =
const parameters = { const parameters = {
mochKey: req.params.moch, mochKey: req.params.moch,
apiKey: req.params.apiKey, apiKey: req.params.apiKey,
infoHash: req.params.infoHash, infoHash: req.params.infoHash.toLowerCase(),
fileIndex: isNaN(req.params.fileIndex) ? undefined : parseInt(req.params.fileIndex), fileIndex: isNaN(req.params.fileIndex) ? undefined : parseInt(req.params.fileIndex),
cachedEntryInfo: req.params.cachedEntryInfo, cachedEntryInfo: req.params.cachedEntryInfo,
ip: requestIp.getClientIp(req) ip: requestIp.getClientIp(req)