README ¶ ytcaps2srt Library and CLI tool to convert YouTube captions to .srt files Expand ▾ Collapse ▴ Documentation ¶ Index ¶ func ConvertToSRT(in []*Text) (string, error) type Text type TimedText func ParseTimedText(content []byte) (*TimedText, error) func (t *TimedText) Beautify() ([]*Text, error) Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func ConvertToSRT ¶ func ConvertToSRT(in []*Text) (string, error) Types ¶ type Text ¶ type Text struct { Duration int `xml:"d,attr"` Time int `xml:"t,attr"` Value string `xml:",chardata"` // Old caps have this set to 1, new caps don't have the attribute Append int `xml:"append,attr"` } type TimedText ¶ type TimedText struct { Content []*Text `xml:"text"` } func ParseTimedText ¶ func ParseTimedText(content []byte) (*TimedText, error) func (*TimedText) Beautify ¶ func (t *TimedText) Beautify() ([]*Text, error) Source Files ¶ View all Source files lib.go Click to show internal directories. Click to hide internal directories.