Use custom ffmpeg path in youtube dl
authorChocobozzz <me@florianbigard.com>
Wed, 3 Apr 2019 08:16:18 +0000 (10:16 +0200)
committerChocobozzz <me@florianbigard.com>
Wed, 3 Apr 2019 08:16:18 +0000 (10:16 +0200)
server/helpers/youtube-dl.ts

index 782dd2e2e194dde892a4a73ec21493a4cc5eeb05..c188739ffca84d4ab0febef40b0238e41485cb8b 100644 (file)
@@ -48,6 +48,11 @@ function downloadYoutubeDLVideo (url: string, timeout: number) {
 
   const options = [ '-f', 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/best', '-o', path ]
 
+  if (process.env.FFMPEG_PATH) {
+    options.push('--ffmpeg-location')
+    options.push(process.env.FFMPEG_PATH)
+  }
+
   return new Promise<string>(async (res, rej) => {
     const youtubeDL = await safeGetYoutubeDL()
     youtubeDL.exec(url, options, processOptions, err => {