Catch error in import script

pull/2629/head
Chocobozzz 2020-04-14 09:41:20 +02:00
parent a388781916
commit f940e81469
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 10 additions and 6 deletions

View File

@ -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'])