From f940e81469928009e04b72866abba0d5845770d9 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 14 Apr 2020 09:41:20 +0200 Subject: [PATCH] Catch error in import script --- server/tools/peertube-import-videos.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/server/tools/peertube-import-videos.ts b/server/tools/peertube-import-videos.ts index 7f3b58bba..2c9eabe98 100644 --- a/server/tools/peertube-import-videos.ts +++ b/server/tools/peertube-import-videos.ts @@ -93,12 +93,16 @@ async function run (url: string, user: UserInfo) { log.info('Will download and upload %d videos.\n', infoArray.length) for (const info of infoArray) { - await processVideo({ - cwd: program['tmpdir'], - url, - user, - youtubeInfo: info - }) + try { + await processVideo({ + cwd: program['tmpdir'], + url, + user, + youtubeInfo: info + }) + } catch (err) { + console.error('Cannot process video.', { info, url }) + } } log.info('Video/s for user %s imported: %s', user.username, program['targetUrl']) -- 2.41.0