Closed Dr-Blank closed 9 months ago
I'm working on a official homepage for lrclib which including a search feature, but in the meantime you can use these APIs to find the lyrics you want:
https://lrclib.net/api/search?q={query}
https://lrclib.net/api/get/{id}
For example:
This api is awesome. I wish there was a plugin for beets which used this api. It would be splendid.
Agreed the API and program are great! Thanks @tranxuanthang :) I added Lrclib to my beets lyrics plugin and it works well. It's handy to run lrclib as the sole lyrics source with -f
so existing plain lyrics are replaced with synced versions, if available. I modified my beets install directly at Python39\Lib\site-packages\beetsplug\lyrics.py
Added a basic Backend for Lrclib above the existing Tekstowo
one (the api call I borrowed from what lrcget uses in main.rs)
class Lrclib(Backend):
def fetch(self, artist, title, album, length):
url = 'https://lrclib.net/api/get?artist_name={}&track_name={}&album_name={}&duration={}'.format(artist, title, album, length)
try:
response = requests.get(url)
except requests.RequestException as exc:
self._log.debug('Lrclib API request failed: {0}', exc)
return None
try:
return response.json()['syncedLyrics']
except json.decoder.JSONDecodeError as exc:
self._log.debug('Lrclib API request failed: {0}', exc)
return None
except KeyError:
return None
We add album/duration parameters to all methods, the other backends don't use these but it's nice lrclib is accurate in this way
- lyrics = [self.get_lyrics(artist, title) for title in titles]
+ lyrics = [self.get_lyrics(artist, title, item.album, round(item.length)) for title in titles]
- def get_lyrics(self, artist, title):
+ def get_lyrics(self, artist, title, album, length):
- lyrics = backend.fetch(artist, title)
+ lyrics = backend.fetch(artist, title, album, length)
# there are multiple instances of this
- def fetch(self, artist, title):
+ def fetch(self, artist, title, album, length):
And add it as a source, and enable in your config :)
- SOURCES = ['google', 'musixmatch', 'genius', 'tekstowo']
+ SOURCES = ['google', 'musixmatch', 'genius', 'tekstowo', 'lrclib']
SOURCE_BACKENDS = {
'google': Google,
'musixmatch': MusiXmatch,
'genius': Genius,
'tekstowo': Tekstowo,
+ 'lrclib': Lrclib
}
I added Lrclib to my beets lyrics plugin
Sounds amazing, I'll have to try once I get home!
Manual search feature is now available in v0.2.1:
https://github.com/tranxuanthang/lrcget/releases
You can also search for lyrics by visiting LRCLIB homepage:
There are some songs where I know the lyrics exists on musixmatch, it's just that the metadata might be a little off which fails the matching of song to your database.
If there was a way to modify the search query, e.g. artist or song name, such that I could try matching to your database and retrieve the lyrics.
This is a wonderful piece of software, thank you for making this. It relieved me of so much pain of finding lyrics for every song individually and renaming the file to match the song (that is just brilliant)!!