define static location for yt-dlp binary

This commit is contained in:
2026-02-12 23:27:02 -05:00
parent a2a0aabb3a
commit 600fde2e71
2 changed files with 7 additions and 0 deletions

View File

@@ -3,13 +3,17 @@ package main
import ( import (
"context" "context"
"encoding/json" "encoding/json"
"os"
"time" "time"
"github.com/lrstanley/go-ytdlp" "github.com/lrstanley/go-ytdlp"
) )
var ytdlpBinary = os.Getenv("YTDLP_BIN")
func GetFormats(url string) (*FormatOptions, error) { func GetFormats(url string) (*FormatOptions, error) {
dl := ytdlp.New(). dl := ytdlp.New().
SetExecutable(ytdlpBinary).
SkipDownload(). SkipDownload().
DumpJSON() DumpJSON()
@@ -100,6 +104,7 @@ func DownloadVideo(out_dir, temp_dir, url string, opts DownloadOptions, progress
var lastPhase string var lastPhase string
dl := ytdlp.New(). dl := ytdlp.New().
SetExecutable(ytdlpBinary).
Paths(homePath). Paths(homePath).
Paths(tempPath). Paths(tempPath).
RecodeVideo("mp4"). RecodeVideo("mp4").

View File

@@ -46,6 +46,8 @@
.venv/bin/pip install -r ./app/requirements.txt .venv/bin/pip install -r ./app/requirements.txt
source .venv/bin/activate source .venv/bin/activate
fi fi
export YTDLP_BIN=${pkgs.lib.getExe pkgs.yt-dlp}
''; '';
}; };
}); });