Documentation ¶
Index ¶
- func WithLanguage(lang string) func(s Subtitle) bool
- func WithVersion(version string) func(s Subtitle) bool
- func WithVersionRegexp(version *regexp.Regexp) func(s Subtitle) bool
- type Client
- type Show
- type Subtitle
- type Subtitles
- func (ss Subtitles) Filter(filter func(s Subtitle) bool) Subtitles
- func (ss Subtitles) GroupBy(property func(s Subtitle) string) map[string]Subtitles
- func (ss Subtitles) GroupByLanguage() map[string]Subtitles
- func (ss Subtitles) GroupByVersion() map[string]Subtitles
- func (ss Subtitles) String() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WithLanguage ¶
WithLanguage is a filter first-class function, used to keep subtitle with given language
func WithVersion ¶
WithVersion is a filter first-class function, used to keep subtitle with given subtitle version
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is the addic7ed client
func NewVerbose ¶ added in v0.2.0
func NewVerbose() *Client
NewVerbose creates a new client that will log verbosely to stdout
func (*Client) SearchAll ¶
SearchAll searches in the Addic7ed website for a given episode of a show showStr is usually the name of the video file that need to be searched but it could be any search that can be handled by Addic7ed website It returns the episode name and all found subtitles.
func (*Client) SearchBest ¶
SearchBest searches in the Addic7ed website for the best suitable subtitle of given episode of a show showStr is usually the name of the video file that need to be searched but it could be any search that can be handled by Addic7ed website lang is the language of the subtitle It returns the episode name and the found subtitle.
type Subtitle ¶
type Subtitle struct { // Language is the Addic7ed language as seen in the website Language string // Version is the subtitle type/version, usually the name of the teams who ripped the tv show Version string // Link is the link to the subtitle from Addic7ed website Link string }
Subtitle is a TV-Show subtitle
func (Subtitle) Download ¶
func (s Subtitle) Download() (io.ReadCloser, error)
Download download the subtitle in-memory, in a closable reader
func (Subtitle) DownloadTo ¶
DownloadTo downloads the subtitle to a given path
func (Subtitle) IsOriginal ¶
IsOriginal checks whether the subtitle is original. It means that the subtitle comes with different version and this subtitle is the original one.
type Subtitles ¶
type Subtitles []Subtitle
Subtitles is a slice of subtitle
func (Subtitles) Filter ¶
Filter filters out subtitles To use it, you have to provide a function that returns true for Subtitles to keep, and false to the one to ignore. See addic7ed.WithLanguage, addic7ed.WithVersion, addic7ed.WithVersionRegexp for built-in filters
func (Subtitles) GroupByLanguage ¶
GroupByLanguage groups subtitles by language
func (Subtitles) GroupByVersion ¶
GroupByVersion groups subtitles by version