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

View file

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