Allow specification of Channel ID in peertube-upload.js
This commit is contained in:
parent
9e3e248109
commit
c01cfce40b
1 changed files with 6 additions and 1 deletions
|
@ -15,6 +15,7 @@ program
|
||||||
.option('-P, --privacy <privacy_number>', 'Privacy')
|
.option('-P, --privacy <privacy_number>', 'Privacy')
|
||||||
.option('-N, --nsfw', 'Video is Not Safe For Work')
|
.option('-N, --nsfw', 'Video is Not Safe For Work')
|
||||||
.option('-c, --category <category_number>', 'Category number')
|
.option('-c, --category <category_number>', 'Category number')
|
||||||
|
.option('-C, --channel-id <channel_id>', 'Channel ID')
|
||||||
.option('-m, --comments-enabled', 'Enable comments')
|
.option('-m, --comments-enabled', 'Enable comments')
|
||||||
.option('-l, --licence <licence_number>', 'Licence number')
|
.option('-l, --licence <licence_number>', 'Licence number')
|
||||||
.option('-L, --language <language_code>', 'Language ISO 639 code (fr or en...)')
|
.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' ])
|
console.log('Uploading %s video...', program[ 'videoName' ])
|
||||||
|
|
||||||
const videoAttributes = {
|
let videoAttributes:any = {
|
||||||
name: program['videoName'],
|
name: program['videoName'],
|
||||||
category: program['category'],
|
category: program['category'],
|
||||||
licence: program['licence'],
|
licence: program['licence'],
|
||||||
|
@ -122,6 +123,10 @@ async function run () {
|
||||||
support: undefined
|
support: undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (program['channelId']) {
|
||||||
|
videoAttributes.channelId = program['channelId']
|
||||||
|
}
|
||||||
|
|
||||||
await uploadVideo(program[ 'url' ], accessToken, videoAttributes)
|
await uploadVideo(program[ 'url' ], accessToken, videoAttributes)
|
||||||
|
|
||||||
console.log(`Video ${program['videoName']} uploaded.`)
|
console.log(`Video ${program['videoName']} uploaded.`)
|
||||||
|
|
Loading…
Reference in a new issue