tranxuanthang / lrcget

Utility for mass-downloading LRC synced lyrics for your offline music library.
MIT License
540 stars 20 forks source link

API Documentation #18

Closed korewaChino closed 9 months ago

korewaChino commented 9 months ago

Hi! We would like to use your lrclib API to integrate into a music player. Could we have a proper API documentation for it?

I'm sorry if I'm in the wrong place, but since there's nowhere else to write I'll be writing it here instead.

koehntopp commented 9 months ago

I can offer the crappy Python code I hacked together:

image
tranxuanthang commented 9 months ago

The good news is I'm still working on a home and documentation page for lrclib.net. My time is limited though so it might take a while for me to finish.

koehntopp commented 9 months ago

This no longer works - I saw you have changed the order of parameters, is there anything else that's different...?

tranxuanthang commented 9 months ago

@koehntopp I did add some fields to the response JSON of get API, but I don't remember changing or removing any, to keep it backward compatible.

koehntopp commented 9 months ago

Hmmm... maybe a more direct question - any idea why the following query returns a 404 - the App has LRC lyrics for that song:

https://lrclib.net/api/get?artist_name=Huey%20Lewis%20%26%20The%20News&track_name=If%20This%20Is%20It&album_name=Sports&duration=354

tranxuanthang commented 9 months ago

@koehntopp I see... I actually fixed some "bugs" that makes LRCLIB find a match for a song that are not really closely equal in duration (+- 2s).

This is probably the record that was matched before: https://lrclib.net/api/get/2148759. The duration of it is way shorter (234s) than your track (354s).

If you don't need the pessimistic exact match, you may use the search API:

https://lrclib.net/api/search?artist_name=Huey%20Lewis%20%26%20The%20News&track_name=If%20This%20Is%20It&album_name=Sports

koehntopp commented 9 months ago

OK, turns out I was just stupid. I thought I had the duration in minutes and seconds and needed to convert ist, but it was in seconds all along 🤦🏻‍♂️

Now the question remains why it worked at all 🤣

Anyway, thank you!!

tranxuanthang commented 9 months ago

The API documentation page for LRCLIB is available here: 🎉

https://lrclib.net/docs