moehmeni/syncedlyrics

Searching by metadata

Vuizur opened this issue · 6 comments

Vuizur commented

I think it would be great to have the option to search by metadata, so something like artist, title, album and duration. Both MusixMatch and LRClib seem to support it. It has been implemented in https://github.com/fashni/MxLRC, so one could copy some code. In my testing I got better results when using this metadata, because pure search sometimes gives false lyrics back/finds the wrong song.

I could also try to do a PR if you want 👍.

Can you please give an example? Maybe we could use text similarity libs like rapidfuzz if the true match is among the search API results but not the first song.

Vuizur commented

One example is Rome - To Die Amongs Strangers. Mxlrc gives me the correct lyrics with python .\mxlrc.py -s Rome,"To Die Amongst Strangers.

from syncedlyrics import search

lrc = search("Rome To Die Amongst Strangers", providers=["Musixmatch"])
print(lrc)

fails with

Traceback (most recent call last):
  File "c:\Users\hanne\Documents\Programme\syncedlyrics\mytest.py", line 3, in <module>
    lrc = search("Rome To Die Amongst Strangers", providers=["Musixmatch"])
  File "c:\Users\hanne\Documents\Programme\syncedlyrics\syncedlyrics\__init__.py", line 39, in search
    lrc = provider.get_lrc(search_term)
  File "c:\Users\hanne\Documents\Programme\syncedlyrics\syncedlyrics\providers\musixmatch.py", line 90, in get_lrc
    return self.get_lrc_by_id(tracks[0]["track"]["track_id"])
IndexError: list index out of range

(But this crash might be different problem.)

Another example where simply the wrong lyrics are fetched (but mxlrc fetches the correct ones) is Best Coast - Wasted Time.

I think the easiest way to get it to work would be copying this: https://github.com/fashni/MxLRC/blob/main/mxlrc.py#L26 . (Maybe in a new function to not break the old API)

i been using this script for downloading lyrics https://github.com/whatihavedone/lrc_fetcher/blob/main/lyrics_fetcher.py

am I reading this correctly that it spreads the lyrics out equally throughout the duration of the song? If so that would be kind of useless, the wrong timestamps more or less for the whole song?

i been using this script for downloading lyrics https://github.com/whatihavedone/lrc_fetcher/blob/main/lyrics_fetcher.py

am I reading this correctly that it spreads the lyrics out equally throughout the duration of the song? If so that would be kind of useless, the wrong timestamps more or less for the whole song?

i just use it to grab nonsync lyrics

I Already builded this so wait for somedays , i have to reverify it and i will upload in my repo