import * as program from 'commander'
import { access, constants } from 'fs-extra'
import { isAbsolute } from 'path'
-import { getClient, login } from '../tests/utils'
-import { uploadVideo } from '../tests/utils/index'
+import { getClient, login } from '../../shared/utils'
+import { uploadVideo } from '../../shared/utils/'
import { VideoPrivacy } from '../../shared/models/videos'
import { netrc, getSettings } from './cli'
console.log('Uploading %s video...', program[ 'videoName' ])
- let videoAttributes:any = {
+ const videoAttributes = {
name: program['videoName'],
category: program['category'],
+ channelId: program['channelId'],
licence: program['licence'],
language: program['language'],
nsfw: program['nsfw'],
support: undefined
}
- if (program['channelId']) {
- videoAttributes.channelId = program['channelId']
- }
-
await uploadVideo(program[ 'url' ], accessToken, videoAttributes)
console.log(`Video ${program['videoName']} uploaded.`)