diff --git a/app/ytdlp.go b/app/ytdlp.go index cabd313..ae72ab3 100644 --- a/app/ytdlp.go +++ b/app/ytdlp.go @@ -3,13 +3,17 @@ package main import ( "context" "encoding/json" + "os" "time" "github.com/lrstanley/go-ytdlp" ) +var ytdlpBinary = os.Getenv("YTDLP_BIN") + func GetFormats(url string) (*FormatOptions, error) { dl := ytdlp.New(). + SetExecutable(ytdlpBinary). SkipDownload(). DumpJSON() @@ -100,6 +104,7 @@ func DownloadVideo(out_dir, temp_dir, url string, opts DownloadOptions, progress var lastPhase string dl := ytdlp.New(). + SetExecutable(ytdlpBinary). Paths(homePath). Paths(tempPath). RecodeVideo("mp4"). diff --git a/flake.nix b/flake.nix index 6877dfa..f15805a 100644 --- a/flake.nix +++ b/flake.nix @@ -46,6 +46,8 @@ .venv/bin/pip install -r ./app/requirements.txt source .venv/bin/activate fi + + export YTDLP_BIN=${pkgs.lib.getExe pkgs.yt-dlp} ''; }; });