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

Searching by metadata #12

Open
Vuizur opened this issue Aug 15, 2023 · 6 comments
Open

Searching by metadata #12

Vuizur opened this issue Aug 15, 2023 · 6 comments
Labels
enhancement New feature or request

Comments

@Vuizur
Copy link

Vuizur commented Aug 15, 2023

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 👍.

@moehmeni
Copy link
Owner

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
Copy link
Author

Vuizur commented Aug 16, 2023

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)

moehmeni added a commit that referenced this issue Aug 18, 2023
@moehmeni moehmeni added the enhancement New feature or request label Sep 13, 2023
@calm3285
Copy link

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

@Skidudeaa
Copy link

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?

@calm3285
Copy link

calm3285 commented Jan 24, 2024

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

@WorldOfDex
Copy link

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

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

No branches or pull requests

5 participants