Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate to lrclib.net #48

Closed
raitonoberu opened this issue May 24, 2024 · 3 comments
Closed

Migrate to lrclib.net #48

raitonoberu opened this issue May 24, 2024 · 3 comments

Comments

@raitonoberu
Copy link
Owner

raitonoberu commented May 24, 2024

Here we'll track the progress of moving the source of free lyrics from Spotify to lrclib. Since lrclib's own search engine is not good enough to find the desired track, what we will do is:

  • sptlrx sends a fuzzy query to our lyrcsapi instance;
  • lyricsapi makes a search request to Spotify, which will give us the exact metadata;
  • then we make a request to lrclib's api with the exact title, album, artist and duration, and they give us the lyrics;
  • we parse their format and return good old JSON to sptlrx.

What's nice about this is that Vercel caches our responses, so we won't make the same request to lrclib twice. I tested this scenario briefly and it works awesome, it even has lyrics to songs that Spotify doesn't have. Also, AFAIK, we don't even need to specify Spotify cookies when hosting lyricsapi because unregistered users can do search requests too.

@sanderr
Copy link

sanderr commented May 30, 2024

Since lrclib's own search engine is not good enough to find the desired track

From reading the rest of the description, as well as my own experience with the API (I've been using it for a few months now with great success), I have the impression that this statement only holds if you don't have complete metadata. Hence you use lyricsapi to go from partial to complete metadata.

Might I suggest skipping this step iff complete metadata is already available? e.g. if the music player / MPRIS reports all of track name, artist name, album name and duration, assume that these are correct and query lrclib directly. If any of those fields is missing, try lyricsapi to fill in missing details. I believe this should make the results more robust in case of complete metadata (see e.g. #36), while still making a best-effort if any metadata is missing.

What do you think?

@DoctorDinosaur
Copy link

https://github.com/brentvollebregt/spotify-lyrics-viewer uses lrclib, might be able to adapt its track finding

@raitonoberu
Copy link
Owner Author

Right now, lyricsapi.vercel.app works as described in the first comment. I plan to completely move away from the idea of a self-hosted server; direct support for lrclib will added in future versions. Let's close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants