tb logging improvement
Some checks failed
Deploy Addon / build (SSH_HOST_2, SSH_KEY_2) (push) Has been cancelled
Deploy Addon / build (SSH_HOST_3, SSH_KEY_3) (push) Has been cancelled
Deploy Addon / build (SSH_HOST_4, SSH_KEY_4) (push) Has been cancelled
Deploy Catalogs / build (push) Has been cancelled

This commit is contained in:
TheBeastLT 2025-04-24 19:15:11 +03:00
parent 942b208811
commit ffe1a3382d

View file

@ -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;
}