swingmx / swingmusic

Swing Music is a beautiful, self-hosted music player for your local audio files. Like a cooler Spotify ... but bring your own music.
https://swingmx.com
MIT License
661 stars 41 forks source link

Unable to Retrieve Lyrics for "レプリカント" by Yorushika via API #211

Open KoukeNeko opened 1 month ago

KoukeNeko commented 1 month ago

Description: I am encountering an issue with the swingmusic application where I am unable to retrieve the lyrics for the song "レプリカント" by Yorushika using the API. Despite the fact that I can find the lyrics on Musixmatch directly, the application does not return any results when using the API.

Steps to Reproduce:

  1. Install swingmusic using Docker.
  2. Open the application and navigate to the lyrics search functionality.
  3. Enter "レプリカント" as the song title and "Yorushika" as the artist.
  4. Execute the search.

Expected Behavior: The application should return the synced lyrics for "レプリカント" by Yorushika.

Actual Behavior: The application does not return any search results.

Environment:

Additional Information: I have verified that the song is available on Musixmatch by visiting this link. The issue seems to be with the API call made by the application.

Logs and Screenshots:

Please let me know if you need any additional information or if there are any troubleshooting steps I can follow to help resolve this issue.

Thank you!

image image

cwilvx commented 1 month ago

Hi @KoukeNeko

So ... I downloaded the song on my computer, and was able to get the lyrics from MusixMatch

image

Is this issue related to this specific track or all songs all the time?

KoukeNeko commented 1 month ago

Hi,

I have encountered a similar issue where none of the songs are fetching lyrics correctly, as demonstrated in the screen recording. Could this be related to the file type (flac)? Additionally, I have confirmed that I can connect to the Musixmatch API, as shown in the attached nslookup results. Thank you. image

https://github.com/swingmx/swingmusic/assets/111033412/a1608beb-4b2e-4aa0-b2cf-df8deed5af36

Other lyrics like "雲と幽霊" is available on Musixmatch, but not being retrieved by the application. image

cwilvx commented 1 month ago

@KoukeNeko

The files being FLAC does not affect lyrics since only the artist, album and title tags are used.

After looking closely at the screenshots, here's what I think the problem is.

Your local music tags are written in japanese characters, but on Musixmatch, it's a combination of both Japanese and abc (or whatever they're called)

So Musixmatch receives a prompt to find lyrics tagged with the following property:

{
  "title": "レプリカント",
  "artist": "ヨルシカ",
}

But, they only have lyrics for:

{
  "title": "レプリカント",
  "artist": "Yorushika"
}

Because the artist is stored in english letters, the search fails.

So, the fix to this is to transliterate ヨルシカ into yorushika. I don't know whether MusixMatch does this for all their records, because if they don't, it would break some other lyrics. Let's go with transliteration and see if we hurt some other people :laughing:

Thanks a lot for opening this issue. Thanks for contributing to Swing Music.

In case you encounter any other issues, please feel free to open another issue.

Cheers!

PS: I have patched this on this commit, and it's now working. You'll however have to wait for the next release to get the fix. image

KoukeNeko commented 1 month ago

But if only using unidecode image image "五月天" will be transliterate to "Wu Yue Tian ", but "五月天" is correct on Musixmatch

cwilvx commented 1 month ago

@KoukeNeko

That's the problem with unidecoding :laughing: ... breaks some, fixes some. It looks like MusixMatch does not unidecode their records.

In this case, we have no option but to drop the whole unidecode hack.

cwilvx commented 1 month ago

Or we can try to do multiple searches with unidecoded and the unchanged queries. I think that would probably match something.

cwilvx commented 1 month ago

@KoukeNeko

image

This seems to work. https://github.com/swingmx/swingmusic/commit/300c8eb30bd89ce0a7296fe1d756dd3e542265df

KoukeNeko commented 1 month ago

It's been working great, but I haven't had a chance to try it with Chinese yet.