mirror of
https://github.com/TheBeastLT/torrentio-scraper.git
synced 2026-01-11 22:40:22 +00:00
tb logging improvement
Some checks failed
Some checks failed
This commit is contained in:
parent
942b208811
commit
ffe1a3382d
1 changed files with 5 additions and 2 deletions
|
|
@ -3,7 +3,7 @@ import { Type } from '../lib/types.js';
|
|||
import { isVideo } from '../lib/extension.js';
|
||||
import StaticResponse from './static.js';
|
||||
import { getMagnetLink } from '../lib/magnetHelper.js';
|
||||
import { chunkArray, BadTokenError, sameFilename, streamFilename } from './mochHelper.js';
|
||||
import { chunkArray, sameFilename, streamFilename, BadTokenError, AccessDeniedError } from './mochHelper.js';
|
||||
|
||||
const KEY = 'torbox';
|
||||
const timeout = 30000;
|
||||
|
|
@ -21,7 +21,7 @@ export async function getCachedStreams(streams, apiKey, ip) {
|
|||
return Promise.reject(error);
|
||||
}
|
||||
const message = error.message || error;
|
||||
console.warn('Failed TorBox cached torrent availability request:', message);
|
||||
console.log('Failed TorBox cached torrent availability request: ', JSON.stringify(message));
|
||||
return undefined;
|
||||
});
|
||||
return available && streams
|
||||
|
|
@ -266,6 +266,9 @@ export function toCommonError(data) {
|
|||
if (['AUTH_ERROR', 'BAD_TOKEN'].includes(error?.error)) {
|
||||
return BadTokenError;
|
||||
}
|
||||
if (isAccessDeniedError(error)) {
|
||||
return AccessDeniedError;
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue