feat: support configuring the bgutil server
All checks were successful
build / build (push) Successful in 1m22s
All checks were successful
build / build (push) Successful in 1m22s
This commit is contained in:
parent
08779a5941
commit
1aa4e66c7e
|
|
@ -46,6 +46,7 @@ COPY <<-EOT /data/config.toml
|
|||
after_date = ""
|
||||
cookies_file = ""
|
||||
po_token = ""
|
||||
bgutil_server = "http://bgutil:4416"
|
||||
EOT
|
||||
|
||||
WORKDIR /app
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ type Provider struct {
|
|||
Output_path_template string
|
||||
Po_token string
|
||||
Verbose bool
|
||||
Bgutil_server string
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
|
|
|
|||
|
|
@ -24,6 +24,11 @@ type Download struct {
|
|||
}
|
||||
|
||||
func Youtube(d Download, p config.Provider) {
|
||||
|
||||
if p.Bgutil_server != "" && p.Po_token != "" {
|
||||
log.Fatal("please only provide bgutil_server OR po_token, not both")
|
||||
}
|
||||
|
||||
archive := filepath.Join(d.OutDir, "archive.txt")
|
||||
outdir := d.OutDir
|
||||
|
||||
|
|
@ -96,6 +101,11 @@ func Youtube(d Download, p config.Provider) {
|
|||
args = append(args, fmt.Sprintf("youtube:po_token=web.gvs+%s", p.Po_token))
|
||||
}
|
||||
|
||||
if p.Bgutil_server != "" {
|
||||
args = append(args, "--extractor-args")
|
||||
args = append(args, fmt.Sprintf("youtube:getpot_bgutil_baseurl=%s", p.Bgutil_server))
|
||||
}
|
||||
|
||||
args = append(args, "--format-sort")
|
||||
if p.Quality != "" {
|
||||
args = append(args, p.Quality)
|
||||
|
|
|
|||
Loading…
Reference in a new issue