aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/object-storage/pre-signed-urls.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/object-storage/pre-signed-urls.ts')
-rw-r--r--server/lib/object-storage/pre-signed-urls.ts13
1 files changed, 9 insertions, 4 deletions
diff --git a/server/lib/object-storage/pre-signed-urls.ts b/server/lib/object-storage/pre-signed-urls.ts
index 46a0750a1..d8473d01e 100644
--- a/server/lib/object-storage/pre-signed-urls.ts
+++ b/server/lib/object-storage/pre-signed-urls.ts
@@ -4,8 +4,9 @@ import { CONFIG } from '@server/initializers/config'
4import { MStreamingPlaylistVideo, MVideoFile } from '@server/types/models' 4import { MStreamingPlaylistVideo, MVideoFile } from '@server/types/models'
5import { generateHLSObjectStorageKey, generateWebTorrentObjectStorageKey } from './keys' 5import { generateHLSObjectStorageKey, generateWebTorrentObjectStorageKey } from './keys'
6import { buildKey, getClient } from './shared' 6import { buildKey, getClient } from './shared'
7import { getHLSPublicFileUrl, getWebTorrentPublicFileUrl } from './urls'
7 8
8export function generateWebVideoPresignedUrl (options: { 9export async function generateWebVideoPresignedUrl (options: {
9 file: MVideoFile 10 file: MVideoFile
10 downloadFilename: string 11 downloadFilename: string
11}) { 12}) {
@@ -19,10 +20,12 @@ export function generateWebVideoPresignedUrl (options: {
19 ResponseContentDisposition: `attachment; filename=${downloadFilename}` 20 ResponseContentDisposition: `attachment; filename=${downloadFilename}`
20 }) 21 })
21 22
22 return getSignedUrl(getClient(), command, { expiresIn: 3600 * 24 }) 23 const url = await getSignedUrl(getClient(), command, { expiresIn: 3600 * 24 })
24
25 return getWebTorrentPublicFileUrl(url)
23} 26}
24 27
25export function generateHLSFilePresignedUrl (options: { 28export async function generateHLSFilePresignedUrl (options: {
26 streamingPlaylist: MStreamingPlaylistVideo 29 streamingPlaylist: MStreamingPlaylistVideo
27 file: MVideoFile 30 file: MVideoFile
28 downloadFilename: string 31 downloadFilename: string
@@ -37,5 +40,7 @@ export function generateHLSFilePresignedUrl (options: {
37 ResponseContentDisposition: `attachment; filename=${downloadFilename}` 40 ResponseContentDisposition: `attachment; filename=${downloadFilename}`
38 }) 41 })
39 42
40 return getSignedUrl(getClient(), command, { expiresIn: 3600 * 24 }) 43 const url = await getSignedUrl(getClient(), command, { expiresIn: 3600 * 24 })
44
45 return getHLSPublicFileUrl(url)
41} 46}