X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fyoutube-dl.ts;h=b3079370f0bd71ccebb7fd28172b708f4b881bce;hb=e1a1f9c623bfbbc7e38b36047926338f2e1c61d9;hp=782dd2e2e194dde892a4a73ec21493a4cc5eeb05;hpb=c74c9be934fa1584edf6f4f7a41f00c4d3f2a8b3;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/youtube-dl.ts b/server/helpers/youtube-dl.ts index 782dd2e2e..b3079370f 100644 --- a/server/helpers/youtube-dl.ts +++ b/server/helpers/youtube-dl.ts @@ -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(async (res, rej) => { const youtubeDL = await safeGetYoutubeDL() youtubeDL.exec(url, options, processOptions, err => {