diff --git a/packages/core/src/debrid/altmount.ts b/packages/core/src/debrid/altmount.ts index 4cdaa346..19ab6fa2 100644 --- a/packages/core/src/debrid/altmount.ts +++ b/packages/core/src/debrid/altmount.ts @@ -39,6 +39,7 @@ export class AltmountService extends UsenetStreamService { webdavPassword: parsedConfig.webdavPassword, apiUrl: `${parsedConfig.altmountUrl}/sabnzbd/api`, apiKey: parsedConfig.altmountApiKey, + aiostreamsAuth: parsedConfig.aiostreamsAuth, }; super(config, auth, 'altmount'); diff --git a/packages/core/src/debrid/nzbdav.ts b/packages/core/src/debrid/nzbdav.ts index a40cc005..4a75db22 100644 --- a/packages/core/src/debrid/nzbdav.ts +++ b/packages/core/src/debrid/nzbdav.ts @@ -41,6 +41,7 @@ export class NzbDAVService extends UsenetStreamService { webdavPassword: parsedConfig.webdavPassword, apiUrl: `${parsedConfig.nzbdavUrl}/api`, apiKey: parsedConfig.nzbdavApiKey, + aiostreamsAuth: parsedConfig.aiostreamsAuth, }; super(config, auth, 'nzbdav'); diff --git a/packages/core/src/debrid/usenet-stream-base.ts b/packages/core/src/debrid/usenet-stream-base.ts index 153e8db3..6b0cc940 100644 --- a/packages/core/src/debrid/usenet-stream-base.ts +++ b/packages/core/src/debrid/usenet-stream-base.ts @@ -387,6 +387,7 @@ export interface UsenetStreamServiceConfig { webdavPassword: string; apiUrl: string; apiKey: string; + aiostreamsAuth?: string; } /** @@ -566,6 +567,21 @@ export abstract class UsenetStreamService implements DebridService { } public async checkNzbs(hashes: string[]): Promise { + // if aiostreamsAuth is present, validate it. + if (this.auth.aiostreamsAuth) { + try { + BuiltinProxy.validateAuth(this.auth.aiostreamsAuth); + } catch (error) { + throw new DebridError('Invalid AIOStreams Proxy Auth', { + statusCode: 401, + statusText: 'Unauthorized', + code: 'UNAUTHORIZED', + headers: {}, + body: null, + type: 'api_error', + }); + } + } // All NZBs are "cached" since it's streaming-based return hashes.map((h, index) => ({ id: index,