Added Download Audio Only
This commit is contained in:
@ -224,6 +224,7 @@ type Options struct {
|
|||||||
DownloadThumbnail bool
|
DownloadThumbnail bool
|
||||||
DownloadSubtitles bool
|
DownloadSubtitles bool
|
||||||
DownloadSections string // --download-sections
|
DownloadSections string // --download-sections
|
||||||
|
DownloadAudioOnly bool // -x Download audio only from video
|
||||||
ProxyUrl string // --proxy URL http://host:port or socks5://host:port
|
ProxyUrl string // --proxy URL http://host:port or socks5://host:port
|
||||||
UseIPV4 bool // -4 Make all connections via IPv4
|
UseIPV4 bool // -4 Make all connections via IPv4
|
||||||
CookiesFromBrowser string // --cookies-from-browser BROWSER[:FOLDER]
|
CookiesFromBrowser string // --cookies-from-browser BROWSER[:FOLDER]
|
||||||
@ -638,7 +639,9 @@ func (result Result) DownloadWithOptions(
|
|||||||
if result.Options.CookiesFromBrowser != "" {
|
if result.Options.CookiesFromBrowser != "" {
|
||||||
cmd.Args = append(cmd.Args, "--cookies-from-browser", result.Options.CookiesFromBrowser)
|
cmd.Args = append(cmd.Args, "--cookies-from-browser", result.Options.CookiesFromBrowser)
|
||||||
}
|
}
|
||||||
|
if result.Options.DownloadAudioOnly {
|
||||||
|
cmd.Args = append(cmd.Args, "-x")
|
||||||
|
}
|
||||||
if result.Options.MergeOutputFormat != "" {
|
if result.Options.MergeOutputFormat != "" {
|
||||||
cmd.Args = append(cmd.Args,
|
cmd.Args = append(cmd.Args,
|
||||||
"--merge-output-format", result.Options.MergeOutputFormat,
|
"--merge-output-format", result.Options.MergeOutputFormat,
|
||||||
|
Reference in New Issue
Block a user