From cc68049424c2a7fc7fb919bc39a43f169e128780 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 26 Sep 2018 15:55:45 +0200 Subject: Fix video import of some youtube videos --- server/helpers/youtube-dl.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'server') 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 = { thumbnailUrl?: string } +const processOptions = { + maxBuffer: 1024 * 1024 * 10 // 10MB +} + function getYoutubeDLInfo (url: string, opts?: string[]): Promise { return new Promise(async (res, rej) => { const options = opts || [ '-j', '--flat-playlist' ] @@ -44,7 +48,7 @@ function downloadYoutubeDLVideo (url: string) { return new Promise(async (res, rej) => { const youtubeDL = await safeGetYoutubeDL() - youtubeDL.exec(url, options, err => { + youtubeDL.exec(url, options, processOptions, err => { if (err) return rej(err) return res(path) -- cgit v1.2.3