felixhageloh / uebersicht

ˈyːbɐˌzɪçt

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FFMPEG missing?

Froxcey opened this issue · comments

So basically I was trying to make a widget where you copy a YouTube video link and press the button to download the mp3(planning on mp4 support in the future). All of that was made in React JS, and with in that I'm using YouTube-dl command to fetch the YouTube video (with in the run function). When I run the command in terminal, everything works fine, but when I use the run function, it downloads the webp and webm file(FFMPEG is not converting it). I do have latest version of ffmpeg installed, and running it in terminal totally works as what I intended. This is the error message:

...
[download] 100% of 14.50MiB
ERROR: ffprobe/avprobe and ffmpeg/avconv not found. Please install one.

This is how I run the YouTube-dl:

document.getElementById("yt-download-button").onclick = ()=>{
      navigator.clipboard.readText().then((url)=>{
        if (!url.includes('https://')||!url.includes('youtu')) return util.err("The link provided is not a valid youtube url")
        //check YouTube link before downloading, util.err is a function that I use to handle errors
        console.log(`Now downloading mp3 from ${url}`)
        run(`cd "$HOME/Downloads";/usr/local/bin/youtube-dl --no-playlist -x --audio-format mp3 --add-metadata --xattrs --embed-thumbnail '${url}'`).then(output=>{console.log(output)})
        //console.log(output) is for debug only, and this is how I found the bug
      }, ()=>{})
    }

Is the bug in my code or uebersicht itself?

commented

your bash env is not loaded by default - you can enable that in the preferences. Could that be related?

Sorry, it's my fault. Turning that on does fix the problem. It's solved :)