mirror of
https://github.com/Viren070/AIOStreams.git
synced 2025-12-01 23:14:04 +01:00
@@ -332,7 +332,12 @@ export abstract class BaseDebridAddon<T extends BaseDebridConfig> {
|
||||
encryptedStoreAuths,
|
||||
metadataId
|
||||
);
|
||||
if (result.service?.id === 'nzbdav' && nzbdavAuth) {
|
||||
if (
|
||||
result.service?.id === 'nzbdav' &&
|
||||
nzbdavAuth &&
|
||||
nzbdavAuth.webdavUser &&
|
||||
nzbdavAuth.webdavPassword
|
||||
) {
|
||||
stream.behaviorHints = {
|
||||
...stream.behaviorHints,
|
||||
notWebReady: true,
|
||||
@@ -374,13 +379,16 @@ export abstract class BaseDebridAddon<T extends BaseDebridConfig> {
|
||||
.map((stream) => ({
|
||||
url: stream.url!,
|
||||
filename: stream.behaviorHints?.filename ?? undefined,
|
||||
headers: {
|
||||
request: {
|
||||
Authorization: `Basic ${Buffer.from(
|
||||
`${nzbdavAuth.webdavUser}:${nzbdavAuth.webdavPassword}`
|
||||
).toString('base64')}`,
|
||||
},
|
||||
},
|
||||
headers:
|
||||
nzbdavAuth.webdavUser && nzbdavAuth.webdavPassword
|
||||
? {
|
||||
request: {
|
||||
Authorization: `Basic ${Buffer.from(
|
||||
`${nzbdavAuth.webdavUser}:${nzbdavAuth.webdavPassword}`
|
||||
).toString('base64')}`,
|
||||
},
|
||||
}
|
||||
: undefined,
|
||||
}))
|
||||
);
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ export const NzbDavConfig = z.object({
|
||||
.optional()
|
||||
.transform((s) => s?.trim().replace(/^\/+/, '').replace(/\/+$/, '')),
|
||||
nzbdavApiKey: z.string(),
|
||||
webdavUser: z.string(),
|
||||
webdavPassword: z.string(),
|
||||
webdavUser: z.string().optional(),
|
||||
webdavPassword: z.string().optional(),
|
||||
aiostreamsAuth: z.string().optional(),
|
||||
});
|
||||
|
||||
|
||||
@@ -383,8 +383,8 @@ export class SABnzbdApi {
|
||||
export interface UsenetStreamServiceConfig {
|
||||
webdavUrl: string;
|
||||
publicWebdavUrl: string;
|
||||
webdavUser: string;
|
||||
webdavPassword: string;
|
||||
webdavUser?: string;
|
||||
webdavPassword?: string;
|
||||
apiUrl: string;
|
||||
apiKey: string;
|
||||
aiostreamsAuth?: string;
|
||||
@@ -806,8 +806,10 @@ export abstract class UsenetStreamService implements DebridService {
|
||||
|
||||
protected getPublicWebdavUrlWithAuth(): string {
|
||||
let url = new URL(this.auth.publicWebdavUrl);
|
||||
url.username = encodeURIComponent(this.auth.webdavUser);
|
||||
url.password = encodeURIComponent(this.auth.webdavPassword);
|
||||
if (this.auth.webdavUser && this.auth.webdavPassword) {
|
||||
url.username = encodeURIComponent(this.auth.webdavUser);
|
||||
url.password = encodeURIComponent(this.auth.webdavPassword);
|
||||
}
|
||||
return url.toString().replace(/\/+$/, ''); // Remove trailing slash
|
||||
}
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@ const SERVICE_DETAILS: Record<
|
||||
description:
|
||||
'Your Nzb DAV WebDAV Username. Found in the WebDAV section in settings.',
|
||||
type: 'string',
|
||||
required: true,
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
id: 'password',
|
||||
@@ -439,7 +439,7 @@ const SERVICE_DETAILS: Record<
|
||||
description:
|
||||
'Your NzbDAV WebDAV Password. Found in the WebDAV section in settings.',
|
||||
type: 'password',
|
||||
required: true,
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
id: 'aiostreamsAuth',
|
||||
|
||||
Reference in New Issue
Block a user