Fix downloading private/internal video
This commit is contained in:
parent
ef8e5cad58
commit
0484b82fe3
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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 })
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue