Fix upload script

pull/1902/head
Chocobozzz 2019-06-11 10:39:30 +02:00
parent 4c7f776136
commit fc8c024a1b
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 5 additions and 3 deletions

View File

@ -77,7 +77,7 @@ async function run (url: string, username: string, password: string) {
licence: program['licence'] || undefined, licence: program['licence'] || undefined,
language: program['language'] || undefined, language: program['language'] || undefined,
nsfw: program['nsfw'] !== undefined ? program['nsfw'] : false, nsfw: program['nsfw'] !== undefined ? program['nsfw'] : false,
description: program['videoDescription'] || '', description: program['videoDescription'] || undefined,
tags: program['tags'] || [], tags: program['tags'] || [],
commentsEnabled: program['commentsEnabled'] !== undefined ? program['commentsEnabled'] : true, commentsEnabled: program['commentsEnabled'] !== undefined ? program['commentsEnabled'] : true,
downloadEnabled: program['downloadEnabled'] !== undefined ? program['downloadEnabled'] : true, downloadEnabled: program['downloadEnabled'] !== undefined ? program['downloadEnabled'] : true,
@ -94,7 +94,6 @@ async function run (url: string, username: string, password: string) {
console.log(`Video ${program['videoName']} uploaded.`) console.log(`Video ${program['videoName']} uploaded.`)
process.exit(0) process.exit(0)
} catch (err) { } catch (err) {
console.log('coucou')
console.error(require('util').inspect(err)) console.error(require('util').inspect(err))
process.exit(-1) process.exit(-1)
} }

View File

@ -355,7 +355,6 @@ async function uploadVideo (url: string, accessToken: string, videoAttributesArg
.set('Accept', 'application/json') .set('Accept', 'application/json')
.set('Authorization', 'Bearer ' + accessToken) .set('Authorization', 'Bearer ' + accessToken)
.field('name', attributes.name) .field('name', attributes.name)
.field('support', attributes.support)
.field('nsfw', JSON.stringify(attributes.nsfw)) .field('nsfw', JSON.stringify(attributes.nsfw))
.field('commentsEnabled', JSON.stringify(attributes.commentsEnabled)) .field('commentsEnabled', JSON.stringify(attributes.commentsEnabled))
.field('downloadEnabled', JSON.stringify(attributes.downloadEnabled)) .field('downloadEnabled', JSON.stringify(attributes.downloadEnabled))
@ -363,6 +362,10 @@ async function uploadVideo (url: string, accessToken: string, videoAttributesArg
.field('privacy', attributes.privacy.toString()) .field('privacy', attributes.privacy.toString())
.field('channelId', attributes.channelId) .field('channelId', attributes.channelId)
if (attributes.support !== undefined) {
req.field('support', attributes.support)
}
if (attributes.description !== undefined) { if (attributes.description !== undefined) {
req.field('description', attributes.description) req.field('description', attributes.description)
} }