Fix downloading private/internal video
This commit is contained in:
parent
ef8e5cad58
commit
0484b82fe3
|
@ -382,14 +382,17 @@ export class VideoService {
|
||||||
generateDownloadUrl (options: {
|
generateDownloadUrl (options: {
|
||||||
video: Video
|
video: Video
|
||||||
files: VideoFile[]
|
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')
|
if (files.length === 0) throw new Error('Cannot generate download URL without files')
|
||||||
|
|
||||||
let url = `${VideoService.BASE_VIDEO_DOWNLOAD_URL}/${video.uuid}?`
|
let url = `${VideoService.BASE_VIDEO_DOWNLOAD_URL}/${video.uuid}?`
|
||||||
url += files.map(f => 'videoFileIds=' + f.id).join('&')
|
url += files.map(f => 'videoFileIds=' + f.id).join('&')
|
||||||
|
|
||||||
|
if (videoFileToken) url += `&videoFileToken=${videoFileToken}`
|
||||||
|
|
||||||
return url
|
return url
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -104,7 +104,7 @@ export class VideoGenerateDownloadComponent implements OnInit {
|
||||||
files.push(this.findAudioFileOnly())
|
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