diff options
-rw-r--r-- | server/tools/peertube-import-videos.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/server/tools/peertube-import-videos.ts b/server/tools/peertube-import-videos.ts index 1fe0a9348..2874a2131 100644 --- a/server/tools/peertube-import-videos.ts +++ b/server/tools/peertube-import-videos.ts | |||
@@ -58,6 +58,7 @@ getSettings() | |||
58 | settings.remotes[settings.default] : | 58 | settings.remotes[settings.default] : |
59 | settings.remotes[0] | 59 | settings.remotes[0] |
60 | } | 60 | } |
61 | |||
61 | if (!program['username']) program['username'] = netrc.machines[program['url']].login | 62 | if (!program['username']) program['username'] = netrc.machines[program['url']].login |
62 | if (!program['password']) program['password'] = netrc.machines[program['url']].password | 63 | if (!program['password']) program['password'] = netrc.machines[program['url']].password |
63 | } | 64 | } |
@@ -69,6 +70,9 @@ getSettings() | |||
69 | process.exit(-1) | 70 | process.exit(-1) |
70 | } | 71 | } |
71 | 72 | ||
73 | removeEndSlashes(program['url']) | ||
74 | removeEndSlashes(program['targetUrl']) | ||
75 | |||
72 | const user = { | 76 | const user = { |
73 | username: program['username'], | 77 | username: program['username'], |
74 | password: program['password'] | 78 | password: program['password'] |
@@ -321,3 +325,9 @@ function isNSFW (info: any) { | |||
321 | 325 | ||
322 | return false | 326 | return false |
323 | } | 327 | } |
328 | |||
329 | function removeEndSlashes (url: string) { | ||
330 | while (url.endsWith('/')) { | ||
331 | url.slice(0, -1) | ||
332 | } | ||
333 | } | ||