GeniusLyricsAPI is a library that can find information about a track and try to extract the lyrics from the genius website
- Gets track info
- Search some track in Genius
- Gets track's lyrics
- Gets album's cover link
-
Open a command line and switch to the directory that contains your project file.
-
Use the following command to install a NuGet package:
dotnet add package GeniusLyricsAPI
-
After the command completes, you can open the project file to see the package reference.
For example, open the .csproj file to see the added
GeniusLyricsAPI
package reference:<ItemGroup> <PackageReference Include="GeniusLyricsAPI" Version="1.0.0" /> </ItemGroup>
using GeniusLyricsAPI;
using GeniusLyricsApi.Models;
public class Program
{
static void Main(string[] args)
{
try
{
new Program().Run().Wait();
}
catch (AggregateException ex)
{
foreach (var e in ex.InnerExceptions)
{
Console.WriteLine("Error: " + e.Message);
}
}
}
private async Task Run()
{
var genius = new GeniusApi("REPLACE_ME_GeniusToken");
Song song = await genius.GetSong("8594139");
string Lyrics = await genius.GetLyrics(song.Uri);
Console.Write(Lyrics);
}
}
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
Thank you very much farshed for writing a similar library for JavaScript. If it wasn't for the genius-lyrics-api, I wouldn't have come up with the idea of rewriting it in C# and wouldn't have written a bot for Telegram :D