diff options
author | Chocobozzz <me@florianbigard.com> | 2018-02-20 18:18:47 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-02-20 18:18:47 +0100 |
commit | b6fe1f985c34ced6895ec1482e68b356c0f21877 (patch) | |
tree | 1082a225ea96e65f216a3694ec6f1f668be4824f /server/tools | |
parent | 61b3e146e16e997ea539cd4610af10d4b681e04a (diff) | |
download | PeerTube-b6fe1f985c34ced6895ec1482e68b356c0f21877.tar.gz PeerTube-b6fe1f985c34ced6895ec1482e68b356c0f21877.tar.zst PeerTube-b6fe1f985c34ced6895ec1482e68b356c0f21877.zip |
Fix 401 detection on import videos
Diffstat (limited to 'server/tools')
-rw-r--r-- | server/tools/import-videos.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/server/tools/import-videos.ts b/server/tools/import-videos.ts index 268101b41..d29a2c6f3 100644 --- a/server/tools/import-videos.ts +++ b/server/tools/import-videos.ts | |||
@@ -148,7 +148,7 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, languag | |||
148 | try { | 148 | try { |
149 | await uploadVideo(program['url'], accessToken, videoAttributes) | 149 | await uploadVideo(program['url'], accessToken, videoAttributes) |
150 | } catch (err) { | 150 | } catch (err) { |
151 | if (err.message.indexOf('401')) { | 151 | if (err.message.indexOf('401') !== -1) { |
152 | console.log('Got 401 Unauthorized, token may have expired, renewing token and retry.') | 152 | console.log('Got 401 Unauthorized, token may have expired, renewing token and retry.') |
153 | 153 | ||
154 | const res = await login(program['url'], client, user) | 154 | const res = await login(program['url'], client, user) |