1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-03 17:59:37 +02:00

Fix downloading video files from object storage

With title that contains non ISO 8859 characters
This commit is contained in:
Chocobozzz 2023-12-19 07:26:09 +01:00
parent c72d5ead39
commit c93b7088c2
No known key found for this signature in database
GPG key ID: 583A612D890159BE

View file

@ -18,7 +18,7 @@ export async function generateWebVideoPresignedUrl (options: {
const command = new GetObjectCommand({ const command = new GetObjectCommand({
Bucket: CONFIG.OBJECT_STORAGE.WEB_VIDEOS.BUCKET_NAME, Bucket: CONFIG.OBJECT_STORAGE.WEB_VIDEOS.BUCKET_NAME,
Key: buildKey(key, CONFIG.OBJECT_STORAGE.WEB_VIDEOS), Key: buildKey(key, CONFIG.OBJECT_STORAGE.WEB_VIDEOS),
ResponseContentDisposition: `attachment; filename=${downloadFilename}` ResponseContentDisposition: `attachment; filename=${encodeURI(downloadFilename)}`
}) })
const url = await getSignedUrl(await getClient(), command, { expiresIn: 3600 * 24 }) const url = await getSignedUrl(await getClient(), command, { expiresIn: 3600 * 24 })
@ -41,7 +41,7 @@ export async function generateHLSFilePresignedUrl (options: {
const command = new GetObjectCommand({ const command = new GetObjectCommand({
Bucket: CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS.BUCKET_NAME, Bucket: CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS.BUCKET_NAME,
Key: buildKey(key, CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS), Key: buildKey(key, CONFIG.OBJECT_STORAGE.STREAMING_PLAYLISTS),
ResponseContentDisposition: `attachment; filename=${downloadFilename}` ResponseContentDisposition: `attachment; filename=${encodeURI(downloadFilename)}`
}) })
const url = await getSignedUrl(await getClient(), command, { expiresIn: 3600 * 24 }) const url = await getSignedUrl(await getClient(), command, { expiresIn: 3600 * 24 })