diff options
Diffstat (limited to 'server/helpers/youtube-dl.ts')
-rw-r--r-- | server/helpers/youtube-dl.ts | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/server/helpers/youtube-dl.ts b/server/helpers/youtube-dl.ts index 25e719cc3..748c67e6c 100644 --- a/server/helpers/youtube-dl.ts +++ b/server/helpers/youtube-dl.ts | |||
@@ -18,6 +18,10 @@ export type YoutubeDLInfo = { | |||
18 | thumbnailUrl?: string | 18 | thumbnailUrl?: string |
19 | } | 19 | } |
20 | 20 | ||
21 | const processOptions = { | ||
22 | maxBuffer: 1024 * 1024 * 10 // 10MB | ||
23 | } | ||
24 | |||
21 | function getYoutubeDLInfo (url: string, opts?: string[]): Promise<YoutubeDLInfo> { | 25 | function getYoutubeDLInfo (url: string, opts?: string[]): Promise<YoutubeDLInfo> { |
22 | return new Promise<YoutubeDLInfo>(async (res, rej) => { | 26 | return new Promise<YoutubeDLInfo>(async (res, rej) => { |
23 | const options = opts || [ '-j', '--flat-playlist' ] | 27 | const options = opts || [ '-j', '--flat-playlist' ] |
@@ -44,7 +48,7 @@ function downloadYoutubeDLVideo (url: string) { | |||
44 | 48 | ||
45 | return new Promise<string>(async (res, rej) => { | 49 | return new Promise<string>(async (res, rej) => { |
46 | const youtubeDL = await safeGetYoutubeDL() | 50 | const youtubeDL = await safeGetYoutubeDL() |
47 | youtubeDL.exec(url, options, err => { | 51 | youtubeDL.exec(url, options, processOptions, err => { |
48 | if (err) return rej(err) | 52 | if (err) return rej(err) |
49 | 53 | ||
50 | return res(path) | 54 | return res(path) |