diff options
author | Chocobozzz <me@florianbigard.com> | 2018-09-04 11:55:43 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-09-04 11:55:43 +0200 |
commit | 1a893f9c704737e9e19d24cf9d9a7afb041302c3 (patch) | |
tree | 79de98aa0f18ab4a4a9bdaaededc5efce1f2496a /server/helpers/youtube-dl.ts | |
parent | 5d112d0c3bff78546cfe9114499a76ac49a46a56 (diff) | |
download | PeerTube-1a893f9c704737e9e19d24cf9d9a7afb041302c3.tar.gz PeerTube-1a893f9c704737e9e19d24cf9d9a7afb041302c3.tar.zst PeerTube-1a893f9c704737e9e19d24cf9d9a7afb041302c3.zip |
Do not import live streaming
Diffstat (limited to 'server/helpers/youtube-dl.ts')
-rw-r--r-- | server/helpers/youtube-dl.ts | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/server/helpers/youtube-dl.ts b/server/helpers/youtube-dl.ts index b0990ff68..6738090f3 100644 --- a/server/helpers/youtube-dl.ts +++ b/server/helpers/youtube-dl.ts | |||
@@ -21,6 +21,7 @@ function getYoutubeDLInfo (url: string): Promise<YoutubeDLInfo> { | |||
21 | const youtubeDL = await safeGetYoutubeDL() | 21 | const youtubeDL = await safeGetYoutubeDL() |
22 | youtubeDL.getInfo(url, options, (err, info) => { | 22 | youtubeDL.getInfo(url, options, (err, info) => { |
23 | if (err) return rej(err) | 23 | if (err) return rej(err) |
24 | if (info.is_live === true) return rej(new Error('Cannot download a live streaming.')) | ||
24 | 25 | ||
25 | const obj = buildVideoInfo(normalizeObject(info)) | 26 | const obj = buildVideoInfo(normalizeObject(info)) |
26 | if (obj.name && obj.name.length < CONSTRAINTS_FIELDS.VIDEOS.NAME.min) obj.name += ' video' | 27 | if (obj.name && obj.name.length < CONSTRAINTS_FIELDS.VIDEOS.NAME.min) obj.name += ' video' |