aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tools/peertube-import-videos.ts
diff options
context:
space:
mode:
authorHesioZ <HesioZ.Gamer@gmail.com>2018-12-15 01:43:04 +0100
committerRigel Kent <par@rigelk.eu>2018-12-15 01:43:04 +0100
commitab4dbe36579f6d92511e78cae2762c49a97001fe (patch)
treeb0ddd14ada6d6b4218d09f69aa3e0783d2d5faad /server/tools/peertube-import-videos.ts
parent7f3d712d5e5031b5d60c40468634a1a6d99c8c93 (diff)
downloadPeerTube-ab4dbe36579f6d92511e78cae2762c49a97001fe.tar.gz
PeerTube-ab4dbe36579f6d92511e78cae2762c49a97001fe.tar.zst
PeerTube-ab4dbe36579f6d92511e78cae2762c49a97001fe.zip
Remove the eventual trailing '/' at the end of urls (see #1453) (#1480)
remove eventual trailing '/' at the end of urls in import script (see #1453)
Diffstat (limited to 'server/tools/peertube-import-videos.ts')
-rw-r--r--server/tools/peertube-import-videos.ts10
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
329function removeEndSlashes (url: string) {
330 while (url.endsWith('/')) {
331 url.slice(0, -1)
332 }
333}