aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--server/tools/peertube-import-videos.ts14
-rw-r--r--support/doc/tools.md3
2 files changed, 13 insertions, 4 deletions
diff --git a/server/tools/peertube-import-videos.ts b/server/tools/peertube-import-videos.ts
index 2874a2131..f50aafc35 100644
--- a/server/tools/peertube-import-videos.ts
+++ b/server/tools/peertube-import-videos.ts
@@ -78,7 +78,11 @@ getSettings()
78 password: program['password'] 78 password: program['password']
79 } 79 }
80 80
81 run(user, program['url']).catch(err => console.error(err)) 81 run(user, program['url'])
82 .catch(err => {
83 console.error(err)
84 process.exit(-1)
85 })
82}) 86})
83 87
84async function promptPassword () { 88async function promptPassword () {
@@ -112,8 +116,12 @@ async function run (user, url: string) {
112 secret: res.body.client_secret 116 secret: res.body.client_secret
113 } 117 }
114 118
115 const res2 = await login(url, client, user) 119 try {
116 accessToken = res2.body.access_token 120 const res = await login(program[ 'url' ], client, user)
121 accessToken = res.body.access_token
122 } catch (err) {
123 throw new Error('Cannot authenticate. Please check your username/password.')
124 }
117 125
118 const youtubeDL = await safeGetYoutubeDL() 126 const youtubeDL = await safeGetYoutubeDL()
119 127
diff --git a/support/doc/tools.md b/support/doc/tools.md
index 4f806a9db..1a9ba7d2b 100644
--- a/support/doc/tools.md
+++ b/support/doc/tools.md
@@ -59,7 +59,8 @@ $ npm run build:server
59 59
60### CLI wrapper 60### CLI wrapper
61 61
62The wrapper provides a convenient interface to the following scripts. You can access it as `peertube` via an alias in your `.bashrc` like `alias peertube="node /your/peertube/directory/dist/server/tools/peertube.js"`: 62The wrapper provides a convenient interface to the following scripts.
63You can access it as `peertube` via an alias in your `.bashrc` like `alias peertube="cd /your/peertube/directory/ && node ./dist/server/tools/peertube.js"` (you have to keep the `cd` command):
63 64
64``` 65```
65 Usage: peertube [command] [options] 66 Usage: peertube [command] [options]