Catch error in import script
This commit is contained in:
parent
a388781916
commit
f940e81469
|
@ -93,12 +93,16 @@ async function run (url: string, user: UserInfo) {
|
||||||
log.info('Will download and upload %d videos.\n', infoArray.length)
|
log.info('Will download and upload %d videos.\n', infoArray.length)
|
||||||
|
|
||||||
for (const info of infoArray) {
|
for (const info of infoArray) {
|
||||||
await processVideo({
|
try {
|
||||||
cwd: program['tmpdir'],
|
await processVideo({
|
||||||
url,
|
cwd: program['tmpdir'],
|
||||||
user,
|
url,
|
||||||
youtubeInfo: info
|
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'])
|
log.info('Video/s for user %s imported: %s', user.username, program['targetUrl'])
|
||||||
|
|
Loading…
Reference in New Issue