]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/youtube-dl.ts
Merge branch 'release/v1.3.0' into develop
[github/Chocobozzz/PeerTube.git] / server / helpers / youtube-dl.ts
index 782dd2e2e194dde892a4a73ec21493a4cc5eeb05..b3079370f0bd71ccebb7fd28172b708f4b881bce 100644 (file)
@@ -1,5 +1,5 @@
 import { truncate } from 'lodash'
-import { CONSTRAINTS_FIELDS, VIDEO_CATEGORIES } from '../initializers'
+import { CONSTRAINTS_FIELDS, VIDEO_CATEGORIES } from '../initializers/constants'
 import { logger } from './logger'
 import { generateVideoImportTmpPath } from './utils'
 import { join } from 'path'
@@ -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 => {