aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools
diff options
context:
space:
mode:
authorAndrew Morgan <andrew@amorgan.xyz>2018-09-28 21:33:48 +0200
committerChocobozzz <me@florianbigard.com>2018-10-01 14:14:49 +0200
commitc01cfce40b8d47f5ccb689dd128e51b589cbc610 (patch)
tree886c6ca973fdc702f7776d09f5f576248a983d56 /server/tools
parent9e3e248109ffe5fc208c23081cbcffdb9a682ff4 (diff)
downloadPeerTube-c01cfce40b8d47f5ccb689dd128e51b589cbc610.tar.gz
PeerTube-c01cfce40b8d47f5ccb689dd128e51b589cbc610.tar.zst
PeerTube-c01cfce40b8d47f5ccb689dd128e51b589cbc610.zip
Allow specification of Channel ID in peertube-upload.js
Diffstat (limited to 'server/tools')
-rw-r--r--server/tools/peertube-upload.ts7
1 files changed, 6 insertions, 1 deletions
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
15 .option('-P, --privacy <privacy_number>', 'Privacy') 15 .option('-P, --privacy <privacy_number>', 'Privacy')
16 .option('-N, --nsfw', 'Video is Not Safe For Work') 16 .option('-N, --nsfw', 'Video is Not Safe For Work')
17 .option('-c, --category <category_number>', 'Category number') 17 .option('-c, --category <category_number>', 'Category number')
18 .option('-C, --channel-id <channel_id>', 'Channel ID')
18 .option('-m, --comments-enabled', 'Enable comments') 19 .option('-m, --comments-enabled', 'Enable comments')
19 .option('-l, --licence <licence_number>', 'Licence number') 20 .option('-l, --licence <licence_number>', 'Licence number')
20 .option('-L, --language <language_code>', 'Language ISO 639 code (fr or en...)') 21 .option('-L, --language <language_code>', 'Language ISO 639 code (fr or en...)')
@@ -105,7 +106,7 @@ async function run () {
105 106
106 console.log('Uploading %s video...', program[ 'videoName' ]) 107 console.log('Uploading %s video...', program[ 'videoName' ])
107 108
108 const videoAttributes = { 109 let videoAttributes:any = {
109 name: program['videoName'], 110 name: program['videoName'],
110 category: program['category'], 111 category: program['category'],
111 licence: program['licence'], 112 licence: program['licence'],
@@ -122,6 +123,10 @@ async function run () {
122 support: undefined 123 support: undefined
123 } 124 }
124 125
126 if (program['channelId']) {
127 videoAttributes.channelId = program['channelId']
128 }
129
125 await uploadVideo(program[ 'url' ], accessToken, videoAttributes) 130 await uploadVideo(program[ 'url' ], accessToken, videoAttributes)
126 131
127 console.log(`Video ${program['videoName']} uploaded.`) 132 console.log(`Video ${program['videoName']} uploaded.`)