ytcaps2srt

package module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 15, 2021 License: MIT Imports: 5 Imported by: 0

README

ytcaps2srt

Library and CLI tool to convert YouTube captions to .srt files

Documentation

Index

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL