mirror of
https://github.com/TheBeastLT/torrentio-scraper.git
synced 2026-01-11 22:40:22 +00:00
fix offcloud error handling
This commit is contained in:
parent
cf83b4f17b
commit
96c8b300aa
1 changed files with 2 additions and 2 deletions
|
|
@ -15,7 +15,7 @@ async function getCachedStreams(streams, apiKey) {
|
|||
.then(results => results.map(result => result.cachedItems))
|
||||
.then(results => results.reduce((all, result) => all.concat(result), []))
|
||||
.catch(error => {
|
||||
if (error === 'badToken') {
|
||||
if (error && error.error === 'NOAUTH') {
|
||||
return Promise.reject(BadTokenError);
|
||||
}
|
||||
console.warn('Failed Offcloud cached torrent availability request:', error);
|
||||
|
|
@ -150,7 +150,7 @@ function statusReady(torrent) {
|
|||
}
|
||||
|
||||
function errorExpiredSubscriptionError(error) {
|
||||
return error['not_available'] != null;
|
||||
return error && (error.includes('not_available') || error.includes('NOAUTH'));
|
||||
}
|
||||
|
||||
module.exports = { getCachedStreams, resolve, getCatalog, getItemMeta };
|
||||
Loading…
Reference in a new issue