define static location for yt-dlp binary
This commit is contained in:
@@ -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").
|
||||||
|
|||||||
Reference in New Issue
Block a user