X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftools%2Fpeertube-upload.ts;h=114fe8a290da599583d91fdb760b1e32d378a7b8;hb=f67ac646a2c081e02b28a7ab1dc856db6ee20e2f;hp=597137e4c5c61d155a0078b96fd85eaa0ba4dd0a;hpb=d23dd9fbfc4d26026352c10f81d2795ceaf2908a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tools/peertube-upload.ts b/server/tools/peertube-upload.ts index 597137e4c..114fe8a29 100644 --- a/server/tools/peertube-upload.ts +++ b/server/tools/peertube-upload.ts @@ -1,6 +1,3 @@ -import { registerTSPaths } from '../helpers/register-ts-paths' -registerTSPaths() - import { program } from 'commander' import { access, constants } from 'fs-extra' import { isAbsolute } from 'path' @@ -62,11 +59,17 @@ async function run (url: string, username: string, password: string) { } try { - await server.videosCommand.upload({ attributes }) + await server.videos.upload({ attributes }) console.log(`Video ${options.videoName} uploaded.`) process.exit(0) } catch (err) { - console.error(require('util').inspect(err)) + const message = err.message || '' + if (message.includes('413')) { + console.error('Aborted: user quota is exceeded or video file is too big for this PeerTube instance.') + } else { + console.error(require('util').inspect(err)) + } + process.exit(-1) } }