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 (
"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").