1
0
Fork 0

Allow specification of Channel ID in peertube-upload.js

This commit is contained in:
Andrew Morgan 2018-09-28 21:33:48 +02:00 committed by Chocobozzz
parent 9e3e248109
commit c01cfce40b
1 changed files with 6 additions and 1 deletions

View File

@ -15,6 +15,7 @@ program
.option('-P, --privacy <privacy_number>', 'Privacy')
.option('-N, --nsfw', 'Video is Not Safe For Work')
.option('-c, --category <category_number>', 'Category number')
.option('-C, --channel-id <channel_id>', 'Channel ID')
.option('-m, --comments-enabled', 'Enable comments')
.option('-l, --licence <licence_number>', 'Licence number')
.option('-L, --language <language_code>', 'Language ISO 639 code (fr or en...)')
@ -105,7 +106,7 @@ async function run () {
console.log('Uploading %s video...', program[ 'videoName' ])
const videoAttributes = {
let videoAttributes:any = {
name: program['videoName'],
category: program['category'],
licence: program['licence'],
@ -122,6 +123,10 @@ async function run () {
support: undefined
}
if (program['channelId']) {
videoAttributes.channelId = program['channelId']
}
await uploadVideo(program[ 'url' ], accessToken, videoAttributes)
console.log(`Video ${program['videoName']} uploaded.`)