mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[addon] fix debrid link logging
This commit is contained in:
@@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user