Skip to content

ActivityPub-federated video streaming platform using P2P directly in your web browser

Use custom ffmpeg path in youtube dl

Chocobozzz5322589d16b6
diff --git a/server/helpers/youtube-dl.ts b/server/helpers/youtube-dl.ts
index 782dd2e2e1..c188739ffc 100644
--- a/server/helpers/youtube-dl.ts
+++ b/server/helpers/youtube-dl.ts
@@ -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 => {