feat: po_token and verbose config options
All checks were successful
build / build (push) Successful in 1m55s
All checks were successful
build / build (push) Successful in 1m55s
This commit is contained in:
parent
3adf768132
commit
8341131031
|
|
@ -48,6 +48,8 @@ range = "1:5:1" # downloads last 5 videos: [START][:STOP
|
|||
after_date = "20250326" # only download videos after date
|
||||
cookies_file = "" # pass user cookies to yt, blank to disable
|
||||
opml_file = "./opml.xml" # the opml file to use
|
||||
po_token = "" # pass a proof-of-origin token
|
||||
verbose = true # debug info for provider
|
||||
```
|
||||
|
||||
## generate opml
|
||||
|
|
|
|||
|
|
@ -17,6 +17,8 @@ type Provider struct {
|
|||
Opml_file string
|
||||
Quality string
|
||||
Output_path_template string
|
||||
Po_token string
|
||||
Verbose bool
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package dl
|
|||
|
||||
import (
|
||||
"bufio"
|
||||
"fmt"
|
||||
"io"
|
||||
"log"
|
||||
"net/http"
|
||||
|
|
@ -50,6 +51,7 @@ func Youtube(d Download, p config.Provider) {
|
|||
"--sleep-interval", throttle,
|
||||
"--sleep-subtitles", throttle,
|
||||
"--sleep-requests", throttle,
|
||||
"--max-sleep-interval", "90",
|
||||
"--format-sort", p.Quality,
|
||||
"--prefer-free-formats",
|
||||
"--write-subs",
|
||||
|
|
@ -75,6 +77,10 @@ func Youtube(d Download, p config.Provider) {
|
|||
args = append(args, "--no-simulate")
|
||||
}
|
||||
|
||||
if p.Verbose == true {
|
||||
args = append(args, "--verbose")
|
||||
}
|
||||
|
||||
if p.Cookies_file != "" {
|
||||
args = append(args, "--cookies")
|
||||
args = append(args, p.Cookies_file)
|
||||
|
|
@ -87,6 +93,11 @@ func Youtube(d Download, p config.Provider) {
|
|||
args = append(args, p.After_date)
|
||||
}
|
||||
|
||||
if p.Po_token != "" {
|
||||
args = append(args, "--extractor-args")
|
||||
args = append(args, fmt.Sprintf("youtube:po_token=web.gvs+%s", p.Po_token))
|
||||
}
|
||||
|
||||
args = append(args, channelUrl.String())
|
||||
cmd := exec.Command(p.Cmd, args...)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue