From c01cfce40b8d47f5ccb689dd128e51b589cbc610 Mon Sep 17 00:00:00 2001 From: Andrew Morgan Date: Fri, 28 Sep 2018 21:33:48 +0200 Subject: [PATCH] Allow specification of Channel ID in peertube-upload.js --- server/tools/peertube-upload.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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.`) -- 2.41.0