mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[addon] do not change proxy on non json response
This commit is contained in:
@@ -29,9 +29,9 @@ async function _getInstantAvailable(hashes, apiKey, retries = 3) {
|
|||||||
const RD = new RealDebridClient(apiKey, options);
|
const RD = new RealDebridClient(apiKey, options);
|
||||||
return RD.torrents.instantAvailability(hashes)
|
return RD.torrents.instantAvailability(hashes)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
if (typeof response !== 'object') {
|
if (typeof response !== 'object' && retries > 0) {
|
||||||
console.warn('RD returned non JSON response: ', response);
|
console.warn('RD returned non JSON response: ', response);
|
||||||
return uncacheProxy('moch').then(() => _getInstantAvailable(hashes, apiKey, retries - 1));
|
return _getInstantAvailable(hashes, apiKey, retries - 1);
|
||||||
}
|
}
|
||||||
return response;
|
return response;
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user