Code Monkey home page Code Monkey logo

lyrics-searcher's Introduction

Welcome to lyrics-searcher ๐Ÿ‘‹

Version Documentation Maintenance License: MIT

A Simple Lyrics Finder That Just Works

Programmatic usage:

Installation

npm install --save lyrics-searcher

Usage

import lyricsSearcher from "lyrics-searcher";

lyricsSearcher("poets of fall", "carnival of rust")
  .then((lyrics) => {
    console.log(lyrics);
  })
  .catch((error) => {
    console.error(error);
  });

Command line usage:

Using without installation

npx lyrics-searcher "a r rahman" "kun faya kun"

Note: Use this method only if you plan to use lyrics-searcher for one time, installing lyrics-searcher globally (see-below) is recommended for multiple time usages.

Installation

npm install lyrics-searcher -g

Note for Linux & MacOS users: DO NOT use sudo to install global packages! The correct way is to tell npm where to install its global packages: npm config set prefix ~/.local. Make sure ~/.local/bin is added to PATH.

Usage after installation

lyrics-searcher "prateek kuhad" "cold mess"

Screenshot

all-i-want-kodaline.png

API

For CLI usage, see the help option:

npx lyrics-searcher --help

For programmatic usage, use the default exported module. It takes two arguments. Artist name and Song name. It returns a promise which resolves into a string containing the lyrics if found, otherwise it will throw an exception (with an error message).

Author

๐Ÿ‘ค Rahil Kabani

๐Ÿค Contributing

Contributions, issues and feature requests are welcome!
Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a โญ๏ธ if this project helped you!

Lyrics-searcher

๐Ÿ“ License

Copyright ยฉ 2021 Rahil Kabani.
This project is MIT licensed.

lyrics-searcher's People

Contributors

alias-rahil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

lyrics-searcher's Issues

Not working

Hi, so yesterday it was working and it give the lyrics just fine
but today all I get is lyrics not found i didn't change anything in my code

No lyrics found for certain of songs

Cuplikan layar 2021-08-31 111220

I tried a couple new songs recently, and this thing showed, similliar to old songs aswell no lyrics found. i think the music library not updated? please help this issue

Typescript declarations for lyrics-finder

Is your feature request related to a problem? Please describe.
When I started to use this package, I found that this package doesn't provide typescript declarations. It would be nice to have them in the package.

Describe the solution you'd like
Providing typescript declarations for the package.

Is it offline?

Today is July 23rd, 2021 and it seems that nothing is working. It can't find any lyrics.

Add timestamps?

Is your feature request related to a problem? Please describe.
The package works find when grabbing lyrics, but no timestamps are given.

Describe the solution you'd like
Can a feature be developed to return timestamps for lyrics?

Google Changed HTML Structure - 'delims' constants are off now

Hey there busy, awesome developer person.

Not sure if you're still interested or if this repo is dead, but it looks like Google changed their HTML structure recently (March 2023) and your delims are now off.

Please see LINE 29 in /src/lib/index.ts

const delims = [
  '</div></div></div></div><div class="hwc"><div class="BNeawe tAd8D AP7Wnd"><div><div class="BNeawe tAd8D AP7Wnd">',
  '</div></div></div><div><span class="hwc"><div class="BNeawe uEec3 AP7Wnd">',
];

... which are referenced on LINE 63...

return searchResult.split(delims[0])[1].split(delims[1])[0];

As of today, March 21, 2023, the HTML structure should look something like the HTML results shown below...

<div class="wDYxhc NFQFxe" data-attrid="kc:/music/recording_cluster:lyrics" data-md="113" style="clear:none">
    <div class="wGduib" data-hveid="CCoQAA" data-ved="2ahUKEwj5l9agyO79AhWdI0QIHUZQBlcQsEx6BAgqEAA">
        <div class="Z1hOCe">
            <div class="PZPZlf zloOqf" data-lyricid="Lyricfind002-1071544">
                <div class="xaAUmb">
                    <div jsname="Vinbg"/>
                    <div jsname="WbKHeb">
                        <div jsname="U8S5sf" class="ujudUb">
                            <span jsname="YS01Ge">Work, work, work, work, work, work</span>
                            <br aria-hidden="true">
                                <span jsname="YS01Ge">He said me haffi work, work, work, work, work, work</span>

... etc ...

At least... I think that might be somewhere around what's going on. (I only looked at it for about 5 minutes.)

Oh the perils of scraping.

Anyway. Not sure if you were no longer interested, or if you still wanted to .... work, work, work, work, work, work... on it.

Either way. Thanks, and wish you all the best.

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.