From: Chocobozzz Date: Tue, 20 Feb 2018 17:18:47 +0000 (+0100) Subject: Fix 401 detection on import videos X-Git-Tag: v0.0.26-alpha~6 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=b6fe1f985c34ced6895ec1482e68b356c0f21877;p=github%2FChocobozzz%2FPeerTube.git Fix 401 detection on import videos --- 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 try { await uploadVideo(program['url'], accessToken, videoAttributes) } catch (err) { - if (err.message.indexOf('401')) { + if (err.message.indexOf('401') !== -1) { console.log('Got 401 Unauthorized, token may have expired, renewing token and retry.') const res = await login(program['url'], client, user)