- await access(program[ 'file' ], constants.F_OK)
-
- console.log('Uploading %s video...', program[ 'videoName' ])
-
- const videoAttributes = {
- name: program[ 'videoName' ],
- category: program[ 'category' ] || undefined,
- channelId: program[ 'channelId' ],
- licence: program[ 'licence' ] || undefined,
- language: program[ 'language' ] || undefined,
- nsfw: program[ 'nsfw' ] !== undefined ? program[ 'nsfw' ] : false,
- description: program[ 'videoDescription' ] || undefined,
- tags: program[ 'tags' ] || [],
- commentsEnabled: program[ 'commentsEnabled' ] !== undefined ? program[ 'commentsEnabled' ] : true,
- downloadEnabled: program[ 'downloadEnabled' ] !== undefined ? program[ 'downloadEnabled' ] : true,
- fixture: program[ 'file' ],
- thumbnailfile: program[ 'thumbnail' ],
- previewfile: program[ 'preview' ],
- waitTranscoding: true,
- privacy: program[ 'privacy' ] || VideoPrivacy.PUBLIC,
- support: undefined
- }
+ const videoAttributes = await buildVideoAttributesFromCommander(url, program)
+
+ Object.assign(videoAttributes, {
+ fixture: options.file,
+ thumbnailfile: options.thumbnail,
+ previewfile: options.preview
+ })