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'])
function getLicence (licence: string) {
if (!licence) return undefined
- if (licence.indexOf('Creative Commons Attribution licence') !== -1) return 1
+ if (licence.includes('Creative Commons Attribution licence')) return 1
return undefined
}