Fix downloading private/internal video

This commit is contained in:
Chocobozzz 2024-10-07 08:33:39 +02:00
parent ef8e5cad58
commit 0484b82fe3
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 5 additions and 2 deletions

View File

@ -382,14 +382,17 @@ export class VideoService {
generateDownloadUrl (options: {
video: Video
files: VideoFile[]
videoFileToken?: string
}) {
const { video, files } = options
const { video, files, videoFileToken } = options
if (files.length === 0) throw new Error('Cannot generate download URL without files')
let url = `${VideoService.BASE_VIDEO_DOWNLOAD_URL}/${video.uuid}?`
url += files.map(f => 'videoFileIds=' + f.id).join('&')
if (videoFileToken) url += `&videoFileToken=${videoFileToken}`
return url
}

View File

@ -104,7 +104,7 @@ export class VideoGenerateDownloadComponent implements OnInit {
files.push(this.findAudioFileOnly())
}
return this.videoService.generateDownloadUrl({ video: this.video, files })
return this.videoService.generateDownloadUrl({ video: this.video, videoFileToken: this.videoFileToken, files })
}
// ---------------------------------------------------------------------------