GithubHelp home page GithubHelp logo

skuill / lyricsscrapernet Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 0.0 370 KB

๐ŸŽผ LyricsScraperNET is a .NET library to search for lyrics of a song from the web.

License: MIT License

C# 99.80% Shell 0.20%
api azlyrics c-sharp csharp dotnet genius lyricfind lyrics music musixmatch song song-lyrics songlyrics

lyricsscrapernet's People

Contributors

skuill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

lyricsscrapernet's Issues

Musixmatch token persistence

Hi, @skuill! I really like your repository, as it provides an extensive and reliable way to retrieve texts from different sources simultaneously. Great job!
As a maintainer of MusixmatchClientLib, I'm always interested in how the library is used, and want to point out some nuances of its usage in your project. It's a suggestion, so feel free to just close the issue tho.

In your code, MusixmatchClient is initialized using new instance of MusixmatchToken, which is completely fine for generating "Desktop" context token (ref: code). However, users might stumble upon rate limits from Musixmatch API, as there's a major cooldown on token generation endpoint. After multiple tests I determined, that tokens with "Desktop" context don't expire automatically at all, so it's worth saving it somewhere on the client side and reusing it when creating a new MusixmatchToken instance (by passing it directly into the MusixmatchToken constructor: new MusixmatchToken(yourSavedToken)). I'm not sure if you save it, but looks like the token's generated every time the MusixmatchClient GetMusixmatchClient() is called.

According to the comments to the referenced method, library works as expected, as it's not designed to be used with official mxm API. I'll walk along the token generation pipeline from the official Musixmatch application to make it clear (hope this doesn't add too much to the issue).

Once one starts the official application, a new token is generated *and saved (the algorithm of token generation is already reverse-engineered, it's what the constructor of MusixmatchToken does). This token is able to do pretty much everything you need (it can fetch lyrics, fetch synced lyrics and search for songs). As the app receives token, it attempts to authenticate the user by giving them an external OAuth link (you can generate a similar link using musixmatchTokenInstance.GetAuthUrl()), that allows user to upload and sync lyrics, but requires Musixmatch account to operate.

Hope it helps debugging failed MusixmatchProvider tests (if they do fail).

Have a wonderful day!
Eimaen

Could not find assembly 'System.Runtime.InteropServices.PInvoke'

Bug

Build fails after updating to v1.1.0 in both .net6 and .net7 avalonia and wpf projects after updating to v1.1.0

Error:

Microsoft.WinFX.targets(211, 9): [MC1000] Unknown build error, 'Could not find assembly 'System.Runtime.InteropServices.PInvoke, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Either explicitly load this assembly using a method such as LoadFromAssemblyPath() or use a MetadataAssemblyResolver that returns a valid assembly.' 

Environment

  • Project Type: WPF/Avalonia
  • SDK: .NET 7, .NET 6

Musixmatch fails after certain requests

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.