lyrics

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package lyrics fetches song lyrics for the visualizer's lyrics panel.

Strategy: scrape genius.com's search results for the best matching track, follow the result URL, and extract lyric text from the rendered HTML. No API key is required (Genius's public API demands one for any useful endpoint, so scraping is the pragmatic choice for a user-local TUI).

Search returns ErrInstrumental when Genius's page indicates the track has no lyrics (e.g. instrumental releases), so callers can render an "Instrumental" marker instead of "Lyrics not found". Network and parse failures surface as ordinary errors.

Index

Constants

This section is empty.

Variables

View Source
var ErrInstrumental = errors.New("instrumental")

ErrInstrumental is returned when Genius marks a song as instrumental.

Functions

func Search(ctx context.Context, client *http.Client, track, artist string) (string, error)

Search finds lyrics for a track on Genius. Returns the lyrics text or an error. Returns empty string if no lyrics found. Returns ErrInstrumental if Genius marks the song as instrumental. The context can be used to cancel or set a deadline on the search.

Types

This section is empty.

Jump to

Keyboard shortcuts

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