- youtubeDL.exec(videoInfo.url, options, processOptions, async (err, output) => {
- if (err) return console.error(err)
-
- console.log(output.join('\n'))
-
- await uploadVideoOnPeerTube(normalizeObject(videoInfo), path, languageCode)
-
+ try {
+ youtubeDL.exec(videoInfo.url, options, processOptions, async (err, output) => {
+ if (err) {
+ console.error(err)
+ return res()
+ }
+
+ console.log(output.join('\n'))
+ await uploadVideoOnPeerTube(normalizeObject(videoInfo), path, languageCode)
+ return res()
+ })
+ } catch (err) {
+ console.log(err.message)