mirror of
https://github.com/Viren070/AIOStreams.git
synced 2025-12-01 23:14:04 +01:00
fix(debrid): use toUrlSafeBase64 for encoding fileInfo in playback URL
closes #433
This commit is contained in:
@@ -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')}`;
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user