diff options
author | Chocobozzz <me@florianbigard.com> | 2018-11-21 16:29:09 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-11-21 16:29:32 +0100 |
commit | 9fa0ea41aaa511bed3aa179dacc312fad6170c21 (patch) | |
tree | 2fa94b01861fbe4832047459e874e500794d4161 /server/helpers/youtube-dl.ts | |
parent | fef13f148028f0922c0643eee999f141fee3a2c7 (diff) | |
download | PeerTube-9fa0ea41aaa511bed3aa179dacc312fad6170c21.tar.gz PeerTube-9fa0ea41aaa511bed3aa179dacc312fad6170c21.tar.zst PeerTube-9fa0ea41aaa511bed3aa179dacc312fad6170c21.zip |
Fix youtube video import
Diffstat (limited to 'server/helpers/youtube-dl.ts')
-rw-r--r-- | server/helpers/youtube-dl.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/server/helpers/youtube-dl.ts b/server/helpers/youtube-dl.ts index 70b4e1b78..2a5663042 100644 --- a/server/helpers/youtube-dl.ts +++ b/server/helpers/youtube-dl.ts | |||
@@ -24,10 +24,10 @@ const processOptions = { | |||
24 | 24 | ||
25 | function getYoutubeDLInfo (url: string, opts?: string[]): Promise<YoutubeDLInfo> { | 25 | function getYoutubeDLInfo (url: string, opts?: string[]): Promise<YoutubeDLInfo> { |
26 | return new Promise<YoutubeDLInfo>(async (res, rej) => { | 26 | return new Promise<YoutubeDLInfo>(async (res, rej) => { |
27 | const options = opts || [ '-j', '--flat-playlist' ] | 27 | const args = opts || [ '-j', '--flat-playlist' ] |
28 | 28 | ||
29 | const youtubeDL = await safeGetYoutubeDL() | 29 | const youtubeDL = await safeGetYoutubeDL() |
30 | youtubeDL.getInfo(url, options, (err, info) => { | 30 | youtubeDL.getInfo(url, args, processOptions, (err, info) => { |
31 | if (err) return rej(err) | 31 | if (err) return rej(err) |
32 | if (info.is_live === true) return rej(new Error('Cannot download a live streaming.')) | 32 | if (info.is_live === true) return rej(new Error('Cannot download a live streaming.')) |
33 | 33 | ||