Use custom ffmpeg path in youtube dl

This commit is contained in:
Chocobozzz 2019-04-03 10:16:18 +02:00
parent c47106315a
commit 5322589d16
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 5 additions and 0 deletions

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