Giter VIP home page Giter VIP logo

rlyrics's Introduction

Rlyrics

A module that allows users to scrape song lyrics from musixmatch.

Requirements

  • Node.js

Installation

npm i rlyrics

Usage

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

// 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

rlyrics's People

Contributors

dependabot[bot] avatar roogue avatar

Watchers

 avatar

Forkers

zoli456

rlyrics's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.