Do not import live streaming

pull/1020/head
Chocobozzz 2018-09-04 11:55:43 +02:00
parent 5d112d0c3b
commit 1a893f9c70
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 1 additions and 0 deletions

View 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'