feat: embed additional metadata
This commit is contained in:
parent
3dbaa42ef3
commit
a4a6934dce
|
|
@ -1,6 +1,7 @@
|
|||
package config
|
||||
|
||||
import (
|
||||
"log"
|
||||
"os"
|
||||
|
||||
toml "github.com/pelletier/go-toml/v2"
|
||||
|
|
@ -9,8 +10,9 @@ import (
|
|||
type Provider struct {
|
||||
Url string
|
||||
Throttle int
|
||||
Video_items 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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue