-
-
Notifications
You must be signed in to change notification settings - Fork 13
Fetching Lyrics (Fastest Method)
ZYROUGE edited this page Apr 11, 2020
·
1 revision
Fetching only One Result for fast response.
const Genius = new (require("genius-lyrics"))("your-token-here");
Genius.tracks.search("faded", { limit: 1 })
.then(results => {
const song = results[0];
song.lyrics()
.then(lyrics => {
console.log(lyrics);
})
})
.catch(err => console.error(err));
const Genius = new (require("genius-lyrics"))("your-token-here");
async function lyrics() {
try {
const song = await Genius.tracks.search("faded", { limit: 1 })[0]; //even tho limit is 1, it will be inside an array
const lyrics = await song.lyrics();
console.log(lyrics);
} catch(e) {
console.log(e);
}
}
lyrics();
Issue/Bugs
Links
Made with