lyric

package module
v0.0.0-...-d80cac9 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 9 Imported by: 0

README

LYRIC

Fetch and search for song lyrics.

License

This project is licensed under the MIT license.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

Documentation

Overview

Package lyric can be used to search and fetch song lyrics

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("Not found")

Functions

func Fetch

func Fetch(path string) (lyric string, err error)

Fetch fetchs a lyrics by it's url (the parameter path (not called url to avoid problems with the url package)). It returns the lyric and an error.

func Search(query string) (string, error)

Search searchs for a query using Genius API. It returns the URL of the lyrics and an error, you can fetch the actual lyrics using Fetch(path). If you want a search with better results when the search term contains typos or not exactly the song name, you can use SearchDDG(query).

func SearchDDG

func SearchDDG(query string) (string, error)

SearchDDG searchs for a query using DuckDuckGO. Search engines can deal with typos and not exact searchs. DuckDuckGO have a rate limit, so don't call the same search too many times. It returns the URL of the lyrics and an error, you can fetch the actual lyrics using Fetch(path).

Types

This section is empty.

Jump to

Keyboard shortcuts

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