terminal – Youtube-dl and ffmpeg – error (Javascript / shell script)

I’m using an automation platform called Soundflow, which uses custom javascript code to control various things with shortcut triggers – it’s highly recommended!

I have one script that makes use of youtube-dl as well as ffmpeg. (it downloads a youtube video, and then extracts the audio and converts it to wav).

When I run youtube-dl in Terminal, it runs fine, no problems.
Same with ffmpeg, I have installed it correctly and I’m able to use it in terminal.

However when I try to run a shell script from Soundflow, it is running the youtube-dl section initially, but then it gets stuck on the bit where it uses ffmpeg to do the video conversion (in this case it’s extracting the audio from a youtube video). I doubt it’s a Soundflow issue as I run other similar shell scripts fine (for example ffmpeg conversions).

I have installed both ffmpeg and youtube-dl via homebrew.

I’m wondering if the problem has something to do with my install location for either ffmpeg or youtube-dl; I don’t know how to edit this or change it, but I think the script may be missing where it expects ffmpeg to be.

Do you have any tips where it’s getting stuck?

This is the error I get in the log: ffprobe/avprobe and ffmpeg/avconv not found


const youtubeDL = '/opt/homebrew/bin/youtube-dl';
var url = 'https://www.youtube.com/watch?v=dQw4w9WgXcQ';

log(`Download started`);

var execResult = sf.system.exec({
        commandLine: `"${youtubeDL}" "${url}" --extract-audio --audio-format wav`
    });

log (execResult)

if (execResult.exitCode !== 0) {
    throw `MP4 download failed with exit code: ${execResult.exitCode}`;
}