Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AvailableLanguage ¶
type AvailableLanguage struct {
// Full name of the language translation, e.g. "English"
Name string `json:"name"`
// Code representation of the language's name, e.g. "en"
Code string `json:"code"`
}
AvailableLanguage holds the available translation data of transcripts provided by YouTube
func GetAvailableLanguages ¶
func GetAvailableLanguages(url string) ([]AvailableLanguage, error)
type Transcript ¶
type Transcript struct {
XMLName xml.Name `xml:"transcript" json:"-"`
Text []struct {
XMLName xml.Name `xml:"text" json:"-"`
Start string `xml:"start,attr" json:"start"` // Start time of the text
End string `json:"end"`
Duration float64 `xml:"dur,attr" json:"duration"` // Approximate duration of the speech in `text`
Text string `xml:",innerxml" json:"text"` // The text being said in the current time bucket
} `xml:"text" json:"data"`
}
Transcript is the underlying structure for processing the raw data of the transcript. It is used both as a serializing entity and as an output entity.
func GetTranscription ¶
func GetTranscription(url string, language string) (*Transcript, error)
Click to show internal directories.
Click to hide internal directories.