Skip to content

gohellp/GeniusLyricsAPI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GeniusLyricsAPI

GeniusLyricsAPI is a library that can find information about a track and try to extract the lyrics from the genius website

Features

  • Gets track info
  • Search some track in Genius
  • Gets track's lyrics
  • Gets album's cover link

Install a package

  1. Open a command line and switch to the directory that contains your project file.

  2. Use the following command to install a NuGet package:

    dotnet add package GeniusLyricsAPI
  3. 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>

Usage

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);
    }
}

Contributing

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.

Thanks

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

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages