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'
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 => {