]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Allow specification of Channel ID in peertube-upload.js
authorAndrew Morgan <andrew@amorgan.xyz>
Fri, 28 Sep 2018 19:33:48 +0000 (21:33 +0200)
committerChocobozzz <me@florianbigard.com>
Mon, 1 Oct 2018 12:14:49 +0000 (14:14 +0200)
server/tools/peertube-upload.ts

index 927564b142c147f5aef8605ddf0d369ec07e3fa5..4034b7e38051102ff4aeacdc6c74ca3270bb4c92 100644 (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.`)