skuill / LyricsScraperNET

🎼 LyricsScraperNET is a .NET library to search for lyrics of a song from the web.
MIT License
5 stars 0 forks source link

Musixmatch fails after certain requests #21

Closed AutMai closed 5 months ago

AutMai commented 7 months ago

Hey @skuill, I just wanted to code some project using your library. Great library so far! But I just encountered that if I request several lyrics (I'm using Musixmatch as provider because the other ones do not work as expected) I get the following error:

MusixmatchClientLib.API.Model.Exceptions.MusixmatchRequestException: Authentication failed, probably because of invalid/missing API key.
   at MusixmatchClientLib.API.ApiRequestFactory.SendRequestLegacy(ApiMethod method, Dictionary`2 additionalArguments, String data)
   at MusixmatchClientLib.API.ApiRequestFactory.SendRequest(ApiMethod method, Dictionary`2 additionalArguments, Dictionary`2 data)
   at MusixmatchClientLib.MusixmatchClient.SongSearch(TrackSearchParameters parameters, PaginationParameters paginationParameters)
   at LyricsScraperNET.Providers.Musixmatch.MusixmatchProvider.SearchLyric(String artist, String song)
   at LyricsScraperNET.Providers.Abstract.ExternalProviderBase.SearchLyric(SearchRequest searchRequest)
   at LyricsScraperNET.LyricsScraperClient.SearchLyric(SearchRequest searchRequest)
skuill commented 7 months ago

Hi @AutMai ! Thank you for the feedback. 1) Could you please provide an example of reproducing the problem? How do you initialize the client, provider, and trigger the lyrics search? If you can attach a solution with an example project, that would be great! 2) Could you please describe in more detail why other providers are not suitable for your case? Maybe this is some new feature to implement :) I'm using Musixmatch as provider because the other ones do not work as expected

skuill commented 7 months ago

Found the bug. Created an Issue in related project: https://github.com/Eimaen/MusixmatchClientLib/issues/23 The token regeneration logic is not working in case when StatusCode is Undefined for the MusixmatchRequestException image

skuill commented 7 months ago

Hi @AutMai! Published fix in the 1.8.1 Could you please update the package to the latest version and let me know if it works.

skuill commented 5 months ago

A lot of time has passed, I close it, apparently it works.