Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
genius-lyrics-api-mod
Advanced tools
Readme
A JavaScript package for non-browser environments that leverages Genius API to find (and scrape) song lyrics and album covers.
Install with npm
npm install --save genius-lyrics-api-mod
Or install with Yarn
yarn add genius-lyrics-api-mod
Get the Genius Developer Access Token
import { getLyrics, getSong } from 'genius-lyrics-api-mod';
const options = {
apiKey: 'XXXXXXXXXXXXXXXXXXXXXXX',
title: 'Posthumous Forgiveness',
artist: 'Tame Impala',
optimizeQuery: true
};
getLyrics(options).then((lyrics) => console.log(lyrics));
getSong(options).then((song) =>
console.log(`${song.id} - ${song.title} - ${song.url} - ${song.albumArt} - ${song.lyrics}`)
);
type options {
title: string;
artist: string;
apiKey: string; // Genius developer access token
optimizeQuery?: boolean; // (optional, default: false) If true, Perform some cleanup to maximize the chance of finding a match
authHeader?: boolean; // (optional, default: false) Whether to include auth header in the search request
}
🚨 If title
or artist
is unknown, pass an empty string.
type song {
id: number; // Genius song id
title: string; // Song title
url: string; // Genius webpage URL for the song
lyrics: string; // Song lyrics
albumArt: string; // URL of the album art image (jpg/png)
releaseDate: string;
}
type searchResult {
id: number; // Genius song id
url: string; // Genius webpage URL for the song
title: string; // Song title
albumArt: string; // URL of the album art image (jpg/png)
releaseDate: string;
}
genius-lyrics-api exposes the following methods:
getLyrics(options | url)
Accepts options or the url to a Genius song.
Returns a promise that resolves to a string containing lyrics. Returns null
if no lyrics are found.
getAlbumArt(options)
Accepts an options object.
Returns a promise that resolves to a url (string) to the song's album art. Returns null
if no url is found.
getSong(options)
Accepts an options object.
Returns a promise that resolves to an object of type song. Returns null
if song is not found.
searchSong(options)
Accepts an options object.
Returns a promise that resolves to an array of type searchResult. Returns null
if no matches are found.
getSongById(id: (number | string), access_token: string)
Accepts a valid Genius song ID. IDs can be found using the searchSong
method.
Returns a promise that resolves to an object of type song.
FAQs
A JavaScript package for non-browser environments that leverages [Genius API](https://genius.com/developers) to find (and scrape) song lyrics and album covers.
The npm package genius-lyrics-api-mod receives a total of 6 weekly downloads. As such, genius-lyrics-api-mod popularity was classified as not popular.
We found that genius-lyrics-api-mod demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.