add foramt chose for subtitlse
Some checks failed
Build on push and PRs / build (push) Failing after 4s
Some checks failed
Build on push and PRs / build (push) Failing after 4s
This commit is contained in:
@ -232,6 +232,7 @@ type Options struct {
|
|||||||
DownloadThumbnail bool
|
DownloadThumbnail bool
|
||||||
DownloadSubtitles bool
|
DownloadSubtitles bool
|
||||||
DownloadSubtitlesLang []string
|
DownloadSubtitlesLang []string
|
||||||
|
DownloadSubtitlesFormat string
|
||||||
DownloadSections string // --download-sections
|
DownloadSections string // --download-sections
|
||||||
Impersonate string // --impersonate
|
Impersonate string // --impersonate
|
||||||
|
|
||||||
@ -491,6 +492,9 @@ func infoFromURL(
|
|||||||
}
|
}
|
||||||
|
|
||||||
for _, caption := range info.AutomaticCaptions[lang] {
|
for _, caption := range info.AutomaticCaptions[lang] {
|
||||||
|
if caption.Ext != options.DownloadSubtitlesFormat {
|
||||||
|
continue
|
||||||
|
}
|
||||||
resp, respErr := get(caption.URL)
|
resp, respErr := get(caption.URL)
|
||||||
if respErr == nil {
|
if respErr == nil {
|
||||||
buf, err := io.ReadAll(resp.Body)
|
buf, err := io.ReadAll(resp.Body)
|
||||||
|
Reference in New Issue
Block a user