X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftools%2Fpeertube-import-videos.ts;h=2c9eabe9889173b4091091c58b02191ee2a5ffa8;hb=d473fd94ce2fd04bffc6cf6ee8f193db309c1d83;hp=3fb9979df62795653518f2b7c1ec866de635a656;hpb=134cf2bce96a8c5aefd55154e884964975d8cf23;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tools/peertube-import-videos.ts b/server/tools/peertube-import-videos.ts index 3fb9979df..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']) @@ -274,7 +278,7 @@ async function getCategory (categories: string[], url: string) { 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 }