import * as prompt from 'prompt'
import { remove } from 'fs-extra'
import { sha256 } from '../helpers/core-utils'
-import { safeGetYoutubeDL } from '../helpers/youtube-dl'
+import { safeGetYoutubeDL, buildOriginallyPublishedAt } from '../helpers/youtube-dl'
import { getSettings, netrc } from './cli'
let accessToken: string
}, thumbnailfile)
}
+ const originallyPublishedAt = buildOriginallyPublishedAt(videoInfo)
+
const videoAttributes = {
name: truncate(videoInfo.title, {
'length': CONSTRAINTS_FIELDS.VIDEOS.NAME.max,
privacy: VideoPrivacy.PUBLIC,
fixture: videoPath,
thumbnailfile,
- previewfile: thumbnailfile
+ previewfile: thumbnailfile,
+ originallyPublishedAt: originallyPublishedAt ? originallyPublishedAt.toISOString() : null
}
console.log('\nUploading on PeerTube video "%s".', videoAttributes.name)