fix(debrid): use toUrlSafeBase64 for encoding fileInfo in playback URL

closes #433
This commit is contained in:
Viren070
2025-10-14 12:45:26 +01:00
parent 017fd03e27
commit 69d24f2876
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -7,6 +7,7 @@ import {
Cache,
getSimpleTextHash,
encryptString,
toUrlSafeBase64,
} from '../utils/index.js';
import {
DebridFile,
@@ -363,5 +364,5 @@ export function generatePlaybackUrl(
title?: string,
filename?: string
): string {
return `${Env.BASE_URL}/api/v1/debrid/playback/${encryptedStoreAuth}/${Buffer.from(JSON.stringify(fileInfo)).toString('base64')}/${metadataId}/${encodeURIComponent(filename ?? title ?? 'unknown')}`;
return `${Env.BASE_URL}/api/v1/debrid/playback/${encryptedStoreAuth}/${toUrlSafeBase64(JSON.stringify(fileInfo))}/${metadataId}/${encodeURIComponent(filename ?? title ?? 'unknown')}`;
}
+1 -1
View File
@@ -51,7 +51,7 @@ router.get(
}
const fileInfo = FileInfoSchema.parse(
JSON.parse(Buffer.from(encodedFileInfo, 'base64').toString('utf-8'))
JSON.parse(fromUrlSafeBase64(encodedFileInfo))
);
const decryptedStoreAuth = decryptString(encryptedStoreAuth);