# lyrics

MusixMatch lyrics getter.

## How it works

Using an API used by the MusixMatch desktop app, it's possible to get lyrics, subtitles lyrics and richsync lyrics using a usertoken which is eternal and doesn't expire. 

This library achieves this, but is against MusixMatch's API TOS because it's bypassing api auth, so please use at your own risk.

## Install

NPM:

```
npm i musixmatch-lyrics
```

Yarn:

```
yarn add musixmatch-lyrics
```

## Demo

```ts
import MusixMatch from 'musixmatch-lyrics';

const mm = new MusixMatch(['tokens here']);

mm.getLyrics('isrc')
	.then((lyrics) => {
		console.log(lyrics);
	})
	.catch((e) => {
		console.error(e);
	});

```

## How to get a usertoken...

Super easy, just requires some knowledge of the Inspect menu in chrome.

1. Head over to [https://curators.musixmatch.com/missions](https://curators.musixmatch.com/missions) and register an account.
2. Once you're at the screen that reads `Missions are only available to Curators`, open the inspect menu.
3. Head over to the `Network` tab at the top.
4. Click `Fetch/XHR`
5. Then, reload the page.
6. Go back to the inspect window.
7. Look for an entry along the lines of `user.get?app_id=web-desktop-app-v1.0`
8. Open it up and look at the Request URL.
9. Find the query parameter called `&usertoken=` and copy the value.
10. Chuck that into the API, and you should be away!

It's recommended to use multiple usertokens to avoid rate limits, but 1 should be fine.

## WTF is an ISRC?

ISRC stands for International Standard Recording Code, and every song has one. This is because MusixMatch supports ISRC and Spotify + Deezer export ISRC's with their APIs, just look for a key called `ISRC` and put it into the method in the library.

## Help

Feel free to contact me on Discord `Chezzer#6969`