- const remoteStaticPath = videoCaption.getCaptionStaticPath()
- const destPath = join(FILES_CACHE.VIDEO_CAPTIONS.DIRECTORY, videoCaption.getCaptionName())
+ const remoteUrl = videoCaption.getFileUrl(video)
+ const destPath = join(FILES_CACHE.VIDEO_CAPTIONS.DIRECTORY, videoCaption.filename)
+
+ try {
+ await doRequestAndSaveToFile(remoteUrl, destPath)
+
+ return { isOwned: false, path: destPath }
+ } catch (err) {
+ logger.info('Cannot fetch remote caption file %s.', remoteUrl, { err })