https://github.com/roogue/rlyrics
https://github.com/roogue/rlyrics
lyrics-finder lyrics-scraping lyrics-search nodejs npm
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/roogue/rlyrics
- Owner: roogue
- License: mit
- Created: 2021-10-30T07:17:41.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-24T02:28:20.000Z (over 3 years ago)
- Last Synced: 2025-02-03T14:46:58.327Z (9 months ago)
- Topics: lyrics-finder, lyrics-scraping, lyrics-search, nodejs, npm
- Language: TypeScript
- Homepage:
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Rlyrics
A module that allows users to scrape song lyrics from musixmatch.
## Requirements
* Node.js
## Installation
```bash
npm i rlyrics
```
## Usage
```javascript
const { Rlyrics } = require("rlyrics");
const rlyrics = new Rlyrics();
// Define Query
const query = "Alan walker - Alone"
const url = "https://www.musixmatch.com/lyrics/Alan-Walker-3/Alone"
// #getLyrics Method - Get lyrics of the best result
rlyrics.getLyrics(query)
// #search Method - Search for songs
rlyrics.search(query)
// #find Method - Get detailed datas of the best result
rlyrics.find(url)
```
## Example Response
```javascript
// Search Result
[
SearchResult {
title: 'Alone',
artist: 'Alan Walker',
href: '/lyrics/Alan-Walker-3/Alone',
url: 'https://www.musixmatch.com/lyrics/Alan-Walker-3/Alone',
icon: [
'https://s.mxmcdn.net/images-storage/albums4/0/6/5/4/3/7/36734560.jpg',
'https://s.mxmcdn.net/images-storage/albums4/0/6/5/4/3/7/36734560_350_350.jpg',
'https://s.mxmcdn.net/images-storage/albums4/0/6/5/4/3/7/36734560_350_350.jpg',
'https://s.mxmcdn.net/images-storage/albums4/0/6/5/4/3/7/36734560_350_350.jpg'
]
},
SearchResult {
title: 'Alan Walker (I)',
artist: 'RamiKz',
href: '/lyrics/RamiKz/Alan-Walker-I',
url: 'https://www.musixmatch.com/lyrics/RamiKz/Alan-Walker-I',
icon: [
'https://s.mxmcdn.net/images-storage/albums4/0/2/0/4/3/4/40434020.jpg',
'https://s.mxmcdn.net/images-storage/albums4/0/2/0/4/3/4/40434020_350_350.jpg',
'https://s.mxmcdn.net/images-storage/albums4/0/2/0/4/3/4/40434020_350_350.jpg',
'https://s.mxmcdn.net/images-storage/albums4/0/2/0/4/3/4/40434020_350_350.jpg'
]
}, ...
]
// Result
Result {
name: 'Alone',
artist: [
Artist {
name: 'Alan Walker',
url: 'https://www.musixmatch.com/artist/Alan-Walker-3'
}
],
icon: 'https://s.mxmcdn.net/images-storage/albums4/0/6/5/4/3/7/36734560_350_350.jpg',
lyrics: 'Lost in your mind\n' +
'I wanna know\n' +
'Am I losing my mind?\n' +
'Never let me go\n' +
'\n' +
'If this night is not forever\n' +
'At least we are together\n' +
'I know I′m not alone\n' +
"I know I'm not alone\n"
...
}
```
## Dependencies
* axios
* cheerio
## License
[MIT](https://choosealicense.com/licenses/mit/)