feat: embed additional metadata
This commit is contained in:
parent
3dbaa42ef3
commit
a4a6934dce
|
|
@ -1,16 +1,18 @@
|
||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"log"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
toml "github.com/pelletier/go-toml/v2"
|
toml "github.com/pelletier/go-toml/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue