try {
return await updateVideoMiniatureFromUrl({ downloadUrl, video, type })
} catch (err) {
- logger.warn('Cannot process thumbnail %s from youtubedl.', downloadUrl, { err })
+ logger.warn('Cannot process thumbnail %s from youtube-dl.', downloadUrl, { err })
}
}
return null
try {
const subtitles = await youtubeDL.getSubtitles()
- logger.info('Will create %s subtitles from youtube import %s.', subtitles.length, targetUrl)
+ logger.info('Found %s subtitles candidates from youtube-dl import %s.', subtitles.length, targetUrl)
for (const subtitle of subtitles) {
if (!await isVTTFileValid(subtitle.path)) {
+ logger.info('%s is not a valid youtube-dl subtitle, skipping', subtitle.path)
await remove(subtitle.path)
continue
}
await sequelizeTypescript.transaction(async t => {
await VideoCaptionModel.insertOrReplaceLanguage(videoCaption, t)
})
+
+ logger.info('Added %s youtube-dl subtitle', subtitle.path)
}
} catch (err) {
logger.warn('Cannot get video subtitles.', { err })