Documentation ¶
Overview ¶
Package extractors contains the various lyrics extractors for gLyrics.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var AZLyricsExtractor = azLyrics{RegexCanHandle{ UrlMatch: regexp.MustCompile(`https?://(?:www.)?azlyrics.com/.*`), }}
AZLyricsExtractor is the Extractor instance used for AZLyrics
var AZLyricsOrigin = models.LyricsOrigin{Name: "AZLyrics", Url: "azlyrics.com"}
AZLyricsOrigin is the models.LyricsOrigin for AZLyrics.
var AnimeLyricsExtractor = animeLyrics{RegexCanHandle{ UrlMatch: regexp.MustCompile(`https?://(?:www.)?animelyrics.com/.*`), }}
AnimeLyricsExtractor is the Extractor instance used for AnimeLyrics
var AnimeLyricsOrigin = models.LyricsOrigin{Name: "Animelyrics", Url: "animelyrics.com"}
AnimeLyricsOrigin is the models.LyricsOrigin for AnimeLyrics.
var Extractors = make([]Extractor, 0)
Extractors is a slice of all the loaded extractors. Use RegisterExtractor to register a new extractor.
var GeniusLyricsExtractor = geniusLyrics{RegexCanHandle{ UrlMatch: regexp.MustCompile(`https?://(?:www.)?genius.com/.*`), }}
GeniusLyricsExtractor is the Extractor instance used for Genius
var GeniusOrigin = models.LyricsOrigin{Name: "Genius", Url: "genius.com"}
GeniusOrigin is the models.LyricsOrigin for Genius.
var LyricalNonsenseExtractor = lyricalNonsense{RegexCanHandle{ UrlMatch: regexp.MustCompile(`https?://(?:www.)?lyrical-nonsense.com/lyrics/.*`), }}
LyricalNonsenseExtractor is the Extractor instance used for Lyrical Nonsense
var LyricalNonsenseOrigin = models.LyricsOrigin{Name: "Lyrical Nonsense", Url: "lyrical-nonsense.com"}
LyricalNonsenseOrigin is the models.LyricsOrigin for Lyrical Nonsense.
var LyricsModeExtractor = lyricsMode{RegexCanHandle{ UrlMatch: regexp.MustCompile(`https?://(?:www.)?lyricsmode.com/.*`), }}
LyricsModeExtractor is the Extractor instance used for LyricsMode
var LyricsModeOrigin = models.LyricsOrigin{Name: "LyricsMode", Url: "lyricsmode.com"}
LyricsModeOrigin is the models.LyricsOrigin for LyricsMode.
var MusixMatchExtractor = musixMatch{RegexCanHandle{ UrlMatch: regexp.MustCompile(`https?://(?:www.)?musixmatch.com/lyrics/.*`), }}
MusixMatchExtractor is the Extractor instance used for MusixMatch
var MusixMatchOrigin = models.LyricsOrigin{Name: "MusixMatch", Url: "musixmatch.com"}
MusixMatchOrigin is the models.LyricsOrigin for MusixMatch.
Functions ¶
func RegisterExtractor ¶
func RegisterExtractor(extractor Extractor)
RegisterExtractor adds a new Extractor to the Extractors slice. Use this function to add a new extractor to be used by gLyrics
Types ¶
type Extractor ¶
type Extractor interface { // CanHandle performs simple checks to determine whether the extractor // has any chance of extracting lyrics from the Request. // It does not guarantee that Extractor.ExtractLyrics will be successful. CanHandle(req models.Request) bool // ExtractLyrics performs the actual extraction. ExtractLyrics(req models.Request) (*models.Lyrics, error) }
Extractor extracts lyrics from a Request.
type RegexCanHandle ¶
RegexCanHandle is a mixin for Extractor which uses a Regexp to check the Request url against in CanHandle.