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 = ""
|
after_date = ""
|
||||||
cookies_file = ""
|
cookies_file = ""
|
||||||
po_token = ""
|
po_token = ""
|
||||||
|
bgutil_server = "http://bgutil:4416"
|
||||||
EOT
|
EOT
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ type Provider struct {
|
||||||
Output_path_template string
|
Output_path_template string
|
||||||
Po_token string
|
Po_token string
|
||||||
Verbose bool
|
Verbose bool
|
||||||
|
Bgutil_server string
|
||||||
}
|
}
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,11 @@ type Download struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func Youtube(d Download, p config.Provider) {
|
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")
|
archive := filepath.Join(d.OutDir, "archive.txt")
|
||||||
outdir := d.OutDir
|
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))
|
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")
|
args = append(args, "--format-sort")
|
||||||
if p.Quality != "" {
|
if p.Quality != "" {
|
||||||
args = append(args, p.Quality)
|
args = append(args, p.Quality)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue