m3u8_native
This commit is contained in:
15
goutubedl.go
15
goutubedl.go
@ -185,10 +185,11 @@ type Subtitle struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Caption struct {
|
type Caption struct {
|
||||||
Ext string `json:"ext"`
|
Ext string `json:"ext"`
|
||||||
URL string `json:"url"`
|
Protocol string `json:"protocol"`
|
||||||
Name string `json:"name"`
|
URL string `json:"url"`
|
||||||
Bytes []byte `json:"-"`
|
Name string `json:"name"`
|
||||||
|
Bytes []byte `json:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (f Format) String() string {
|
func (f Format) String() string {
|
||||||
@ -495,6 +496,12 @@ func infoFromURL(
|
|||||||
if options.DownloadSubtitlesFormat != "" && caption.Ext != options.DownloadSubtitlesFormat {
|
if options.DownloadSubtitlesFormat != "" && caption.Ext != options.DownloadSubtitlesFormat {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// filter out m3u8_native protocol
|
||||||
|
if caption.Protocol != "" {
|
||||||
|
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