mirror of
https://github.com/knightcrawler-stremio/knightcrawler.git
synced 2024-12-20 03:29:51 +00:00
[addon] fixes proxy blacklisting
This commit is contained in:
@@ -123,7 +123,7 @@ function statusReady(statusCode) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function errorExpiredSubscriptionError(error) {
|
function errorExpiredSubscriptionError(error) {
|
||||||
return ['MUST_BE_PREMIUM', 'MAGNET_MUST_BE_PREMIUM'].includes(error.code);
|
return ['MUST_BE_PREMIUM', 'MAGNET_MUST_BE_PREMIUM', 'FREE_TRIAL_LIMIT_REACHED'].includes(error.code);
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = { getCachedStreams, resolve };
|
module.exports = { getCachedStreams, resolve };
|
||||||
@@ -37,7 +37,7 @@ async function _getInstantAvailable(hashes, apiKey, retries = 3) {
|
|||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
if (retries > 0 && ['ENOTFOUND', 'ETIMEDOUT'].some(v => error.message && error.message.includes(v))) {
|
if (retries > 0 && ['ENOTFOUND', 'ETIMEDOUT'].some(v => error.message && error.message.includes(v))) {
|
||||||
blacklistProxy(options.proxy);
|
blacklistProxy(options.agent.proxy.host);
|
||||||
return uncacheProxy('moch').then(() => _getInstantAvailable(hashes, apiKey, retries - 1));
|
return uncacheProxy('moch').then(() => _getInstantAvailable(hashes, apiKey, retries - 1));
|
||||||
}
|
}
|
||||||
if (retries > 0 && ['ESOCKETTIMEDOUT'].some(v => error.message && error.message.includes(v))) {
|
if (retries > 0 && ['ESOCKETTIMEDOUT'].some(v => error.message && error.message.includes(v))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user