This commit is contained in:
parent
22d935609f
commit
94df38f642
|
|
@ -55,8 +55,13 @@ func Youtube(d Download, p config.Provider) {
|
|||
args = append(args, "--no-simulate")
|
||||
}
|
||||
|
||||
// NOTE: we want to download the metadata for a channel, without
|
||||
// downloading every video in the channel. This uses
|
||||
// --playlist-items to download the video indices 0 to 0 with a step
|
||||
// of 1 ... this results in zero videos being downloaded.
|
||||
|
||||
if d.Metadata == true {
|
||||
log.Println("Downloading metadata")
|
||||
log.Println("Downloading channel metadata")
|
||||
mArgs := []string{
|
||||
"--skip-download",
|
||||
"--no-overwrites",
|
||||
|
|
@ -95,8 +100,7 @@ func Youtube(d Download, p config.Provider) {
|
|||
}
|
||||
|
||||
if p.Cookies_file != "" {
|
||||
args = append(args, "--cookies")
|
||||
args = append(args, p.Cookies_file)
|
||||
args = append(args, "--cookies", p.Cookies_file)
|
||||
} else {
|
||||
args = append(args, "--no-cookies")
|
||||
}
|
||||
|
|
@ -105,6 +109,7 @@ func Youtube(d Download, p config.Provider) {
|
|||
args = append(args, "--extractor-args", fmt.Sprintf("youtubepot-bgutilhttp:base_url=%s", p.Bgutil_server))
|
||||
}
|
||||
|
||||
// NOTE: every unqiue extractor's args needs to be combined into one string
|
||||
var youtubeArgs []string
|
||||
if p.Po_token != "" {
|
||||
youtubeArgs = append(youtubeArgs, fmt.Sprintf("po_token=web.gvs+%s", p.Po_token))
|
||||
|
|
@ -112,6 +117,7 @@ func Youtube(d Download, p config.Provider) {
|
|||
if p.Player_client != "" {
|
||||
youtubeArgs = append(youtubeArgs, fmt.Sprintf("player_client=%s", p.Player_client))
|
||||
}
|
||||
|
||||
if len(youtubeArgs) > 0 {
|
||||
args = append(args, "--extractor-args", fmt.Sprintf("youtube:%s", strings.Join(youtubeArgs, ";")))
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue