mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
retry downloading single file when no link found or only torrent rar available
This commit is contained in:
@@ -283,7 +283,8 @@ async function _unrestrictLink(RD, torrent, fileIndex, isBrowser) {
|
|||||||
: torrent.links[selectedFiles.indexOf(targetFile)];
|
: torrent.links[selectedFiles.indexOf(targetFile)];
|
||||||
|
|
||||||
if (!fileLink || !fileLink.length) {
|
if (!fileLink || !fileLink.length) {
|
||||||
return Promise.reject(`No RealDebrid links found for ${torrent.hash} [${fileIndex}]: ${JSON.stringify(torrent)}`);
|
console.log(`No RealDebrid links found for ${torrent.hash} [${fileIndex}]`);
|
||||||
|
return _retryCreateTorrent(RD, torrent.hash, fileIndex)
|
||||||
}
|
}
|
||||||
|
|
||||||
return _unrestrictFileLink(RD, fileLink, torrent, fileIndex, isBrowser);
|
return _unrestrictFileLink(RD, fileLink, torrent, fileIndex, isBrowser);
|
||||||
@@ -293,6 +294,9 @@ async function _unrestrictFileLink(RD, fileLink, torrent, fileIndex, isBrowser)
|
|||||||
return RD.unrestrict.link(fileLink)
|
return RD.unrestrict.link(fileLink)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (isArchive(response.download)) {
|
if (isArchive(response.download)) {
|
||||||
|
if (torrent.files.filter(file => file.selected).length > 1) {
|
||||||
|
return _retryCreateTorrent(RD, torrent.hash, fileIndex)
|
||||||
|
}
|
||||||
return StaticResponse.FAILED_RAR;
|
return StaticResponse.FAILED_RAR;
|
||||||
}
|
}
|
||||||
// if (isBrowser && response.streamable) {
|
// if (isBrowser && response.streamable) {
|
||||||
|
|||||||
Reference in New Issue
Block a user