- logger.warn('Cannot get video subtitles.', { err })
- }
-
- // Create job to import the video
- const payload = {
- type: 'youtube-dl' as 'youtube-dl',
- videoImportId: videoImport.id,
- fileExt: `.${youtubeDLInfo.ext || 'mp4'}`
- }
- await JobQueue.Instance.createJobWithPromise({ type: 'video-import', payload })
-
- auditLogger.create(getAuditIdFromRes(res), new VideoImportAuditView(videoImport.toFormattedJSON()))
-
- return res.json(videoImport.toFormattedJSON()).end()
-}
-
-function buildVideo (channelId: number, body: VideoImportCreate, importData: YoutubeDLInfo): MVideoThumbnail {
- const videoData = {
- name: body.name || importData.name || 'Unknown name',
- remote: false,
- category: body.category || importData.category,
- licence: body.licence || importData.licence,
- language: body.language || importData.language,
- commentsEnabled: body.commentsEnabled !== false, // If the value is not "false", the default is "true"
- downloadEnabled: body.downloadEnabled !== false,
- waitTranscoding: body.waitTranscoding || false,
- state: VideoState.TO_IMPORT,
- nsfw: body.nsfw || importData.nsfw || false,
- description: body.description || importData.description,
- support: body.support || null,
- privacy: body.privacy || VideoPrivacy.PRIVATE,
- duration: 0, // duration will be set by the import job
- channelId: channelId,
- originallyPublishedAt: body.originallyPublishedAt || importData.originallyPublishedAt