feat: embed additional metadata

This commit is contained in:
Viktor Varland 2025-03-28 13:16:50 +01:00
parent 3dbaa42ef3
commit a4a6934dce
Signed by: varl
GPG key ID: 7459F0B410115EE8
2 changed files with 12 additions and 6 deletions

View file

@ -1,6 +1,7 @@
package config package config
import ( import (
"log"
"os" "os"
toml "github.com/pelletier/go-toml/v2" toml "github.com/pelletier/go-toml/v2"
@ -9,8 +10,9 @@ import (
type Provider struct { type Provider struct {
Url string Url string
Throttle int Throttle int
Video_items int Range string
After_date string After_date string
Cmd string
} }
type Config struct { type Config struct {
@ -32,5 +34,8 @@ func Load(filepath string) (Config, error) {
panic(err) panic(err)
} }
log.Printf("Loaded config:")
log.Printf("%+v\n", cfg)
return cfg, err return cfg, err
} }

View file

@ -44,7 +44,7 @@ func Get(d Download, p config.Provider) {
simulate = "--no-simulate" simulate = "--no-simulate"
} }
cmd := exec.Command("yt-dlp", cmd := exec.Command(p.Cmd,
fullUrl.String(), fullUrl.String(),
simulate, simulate,
"--no-progress", "--no-progress",
@ -59,8 +59,9 @@ func Get(d Download, p config.Provider) {
"--output", output, "--output", output,
"--download-archive", archive, "--download-archive", archive,
"--break-on-existing", "--break-on-existing",
"--playlist-items", strconv.Itoa(p.Video_items), "--playlist-items", p.Range,
"--restrict-filenames", "--restrict-filenames",
"--embed-metadata",
) )
stdout, err := cmd.StdoutPipe() stdout, err := cmd.StdoutPipe()