]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tools/import-videos.ts
Merge branch 'develop' of github.com:Chocobozzz/PeerTube into develop
[github/Chocobozzz/PeerTube.git] / server / tools / import-videos.ts
index 11f0257a964f3a770b557a655c06fe21aca9cce4..baaedd329df29c361c5cc043763b7215563fd4a1 100644 (file)
@@ -53,7 +53,10 @@ async function run () {
 
   const options = [ '-j', '--flat-playlist', '--playlist-reverse' ]
   youtubeDL.getInfo(program['targetUrl'], options, processOptions, async (err, info) => {
-    if (err) throw err
+    if (err) {
+      console.log(err.message)
+      process.exit(1)
+    }
 
     let infoArray: any[]
 
@@ -137,6 +140,7 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, languag
     nsfw: isNSFW(videoInfo),
     commentsEnabled: true,
     description: videoInfo.description,
+    support: undefined,
     tags,
     privacy: VideoPrivacy.PUBLIC,
     fixture: videoPath,
@@ -156,7 +160,8 @@ async function uploadVideoOnPeerTube (videoInfo: any, videoPath: string, languag
 
       await uploadVideo(program['url'], accessToken, videoAttributes)
     } else {
-      throw err
+      console.log(err.message)
+      process.exit(1)
     }
   }