genius_lyrics 1.0.1 genius_lyrics: ^1.0.1 copied to clipboard
Dart native package inspired by LyricsGenius Python library. genius_lyrics provides a simple interface to the song, artist, and lyrics data stored on Genius.com.
import 'package:genius_lyrics/genius_lyrics.dart';
void main(List<String> args) async {
Genius genius = Genius(accessToken: YOUR_TOKEN);
Artist? artist = await genius.searchArtist(
artistName: 'Eminem', maxSongs: 5, sort: SongsSorting.release_date, includeFeatures: true);
if (artist != null) {
for (var song in artist.songs) {
print(song.title);
}
}
Album? album = (await genius.searchAlbum(name: 'The Off-Season', artist: 'J.Cole'));
album?.saveLyrics(destPath: 'D:/Desktop/test');
if (album != null) {
print(album.tracks.length);
for (var track in album.tracks) {
print(track.title);
}
}
Song? song = (await genius.searchSong(artist: 'J. Cole', title: 'KOD'));
if (song != null) {
print(song.lyrics);
}
}