1
0
Fork 0

Do not import live streaming

This commit is contained in:
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

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'