impersonate arg

This commit is contained in:
NexonSU
2024-09-08 22:29:37 +03:00
parent a623bde37b
commit d104f30286

View File

@ -224,6 +224,7 @@ type Options struct {
DownloadThumbnail bool
DownloadSubtitles bool
DownloadSections string // --download-sections
Impersonate string // --impersonate
ProxyUrl string // --proxy URL http://host:port or socks5://host:port
UseIPV4 bool // -4 Make all connections via IPv4
@ -332,6 +333,10 @@ func infoFromURL(
cmd.Args = append(cmd.Args, "--downloader", options.Downloader)
}
if options.Impersonate != "" {
cmd.Args = append(cmd.Args, "--impersonate", options.Impersonate)
}
if options.Cookies != "" {
cmd.Args = append(cmd.Args, "--cookies", options.Cookies)
}
@ -639,6 +644,10 @@ func (result Result) DownloadWithOptions(
cmd.Args = append(cmd.Args, "--audio-format", options.AudioFormats)
}
if result.Options.Impersonate != "" {
cmd.Args = append(cmd.Args, "--impersonate", result.Options.Impersonate)
}
if result.Options.ProxyUrl != "" {
cmd.Args = append(cmd.Args, "--proxy", result.Options.ProxyUrl)
}