From: Andrew Morgan Date: Fri, 28 Sep 2018 19:33:48 +0000 (+0200) Subject: Allow specification of Channel ID in peertube-upload.js X-Git-Tag: v1.0.0-rc.1~30 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=c01cfce40b8d47f5ccb689dd128e51b589cbc610;p=github%2FChocobozzz%2FPeerTube.git Allow specification of Channel ID in peertube-upload.js --- diff --git a/server/tools/peertube-upload.ts b/server/tools/peertube-upload.ts index 927564b14..4034b7e38 100644 --- a/server/tools/peertube-upload.ts +++ b/server/tools/peertube-upload.ts @@ -15,6 +15,7 @@ program .option('-P, --privacy ', 'Privacy') .option('-N, --nsfw', 'Video is Not Safe For Work') .option('-c, --category ', 'Category number') + .option('-C, --channel-id ', 'Channel ID') .option('-m, --comments-enabled', 'Enable comments') .option('-l, --licence ', 'Licence number') .option('-L, --language ', '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.`)