Bluegrams / YoutubeDLSharp

A simple .NET wrapper library for youtube-dl and yt-dlp
BSD 3-Clause "New" or "Revised" License
173 stars 30 forks source link

Does it work on Linux? #23

Closed D2O84 closed 1 year ago

D2O84 commented 1 year ago

Hi Is YoutubeDLSharp suppose to work on Linux?, it works fine on windows but fails on Linux I have this error An error occurred trying to start process 'yt-dlp.exe' with working directory '/home/...'. No such file or directory

I'm using

And await YoutubeDL.DownloadYtDlpBinary(); await YoutubeDL.DownloadFFmpegBinary();

Thank you

alxnull commented 1 year ago

Hey @D2O84,

In principle, it should also work on Linux (although it's currently not actively tested on platforms other than Windows). From your error message, it seems that the path to the yt-dlp binary is not set correctly to work on Linux, where the downloaded binary should be named just yt-dlp instead of yt-dlp.exe.

You can configure this as follows:

var ytlp = new YoutubeDL()
{
    YoutubeDLPath = "/home/.../yt-dlp"
};
D2O84 commented 1 year ago

That worked,

YoutubeDLPath = OperatingSystem.IsLinux() ? "yt-dlp" : "yt-dlp.exe", FFmpegPath = OperatingSystem.IsLinux() ? "ffmpeg" : "ffmpeg.exe"

Thank you