]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Do not import live streaming
authorChocobozzz <me@florianbigard.com>
Tue, 4 Sep 2018 09:55:43 +0000 (11:55 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 4 Sep 2018 09:55:43 +0000 (11:55 +0200)
server/helpers/youtube-dl.ts

index b0990ff68f1995f71b6514516a9c5f2b5cba3bc5..6738090f3613c91d996b48ecfd00e37f03c16782 100644 (file)
@@ -21,6 +21,7 @@ function getYoutubeDLInfo (url: string): Promise<YoutubeDLInfo> {
     const youtubeDL = await safeGetYoutubeDL()
     youtubeDL.getInfo(url, options, (err, info) => {
       if (err) return rej(err)
+      if (info.is_live === true) return rej(new Error('Cannot download a live streaming.'))
 
       const obj = buildVideoInfo(normalizeObject(info))
       if (obj.name && obj.name.length < CONSTRAINTS_FIELDS.VIDEOS.NAME.min) obj.name += ' video'