skuill / lyricsscrapernet Goto Github PK
View Code? Open in Web Editor NEW๐ผ LyricsScraperNET is a .NET library to search for lyrics of a song from the web.
License: MIT License
๐ผ LyricsScraperNET is a .NET library to search for lyrics of a song from the web.
License: MIT License
For example by using country codes ISO 3166-1 alpha-2 as request parameter:
https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
Search by uri from the site. Example: https://www.musixmatch.com/lyrics/Parkway-Drive/Idols-and-Anchors.
Two ways:
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
Build fails after updating to v1.1.0 in both .net6 and .net7 avalonia and wpf projects after updating to v1.1.0
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.'
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)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.