Giter Site home page Giter Site logo

timbru31 / mp3lyrics Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 3.0 392 KB

🎡 πŸ“ CLI for mp3 lyrics fetching. Uses ruby-mp3info and some lyric wikis

Home Page: https://rubygems.org/gems/mp3lyrics

License: MIT License

Ruby 100.00%
ruby mp3info metrolyrics lyrics mp3-files mp3tag music cli genius ruby-mp3info

mp3lyrics's Introduction

MP3Lyrics

Ruby

Code Climate coverage Code Climate Known Vulnerabilities Dependabot Status

License

Still in Alpha, ugly and WIP :)

Info

MP3Lyrics is a tool written in Ruby (currently only CLI) to download song lyrics from AZLyrics or Genius. The lyrics are added to the mp3 file via the USLT (Unsynchronised lyric/text transcription) tag (with the power of ruby-mp3info).

Motivation

Why Ruby?

Because I wanted to try another language than Java.

Why are you not using the LyricWiki API?

Although they have got a pretty neat REST API the lyrics can't be fully retrieved, most likely due to licensing issues. They no longer offer an API since January 2016. The site has since been shut down as of October 2020.

Why are you not using musiXmatch API?

Simply because they charge me (the developer) for retrieving the lyrics.

Why are you not using MetroLyrics API?

The site has been shut down as of July 2021.

Why are you not using Genius API?

They do not offer fetching lyrics via the API (yet).

Why not iTunes Lyrics Adder, Lyrics for iTunes, iSongText, Get Lyrical, ...?

Either they were tied to iTunes and ugly DLL libraries, outdated/inactive, closed source or not cross platform. I'm mainly developing on my MacBook and my iTunes library is on my Windows system. I need something that works anywhere.

By dropping the need (and support) of iTunes running somewhere in the background, the tool is more lightweight.

Dependencies

  1. Bundler
  2. Nokogiri for HTML parsing
  3. mp3info as a MP3 library
  4. require_all for easier requiring of the wiki_api folder
  5. For testing purposes you should install rubocop, rake, minitest and optionally coverage reporters for CodeClimate

Installation

gem install mp3lyrics

Usage

mp3lyrics <dir> [-override true/false] [-use genius/azlyrics]

dir is the folder with your music, it's iterated recursively.
override is a boolean toggle to override existing lyrics (defaults to false).
use is a specific wiki to be used to download lyrics (all wikis are used by default).

Development usage

The same options as above apply, but the binary has to be invoked from

./lib/mp3lyrics.rb

Tests

To execute the tests run

bundle exec rake

Future plans // ToDo

  • Add support to other lyrics sites when 404 is returned from LyricWiki
  • GUI for easier usage (maybe)
  • Add test cases, see #1

Built by (c) Tim Brust and contributors. Released under the MIT license.

mp3lyrics's People

Contributors

codacy-badger avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar kitlawes avatar snyk-bot avatar timbru31 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mp3lyrics's Issues

Add tests to the project

Test are essential and to be aware of breaking API/layout changes from the sites the test suite should

  • test against the real site
  • test against mock data
  • test mp3 tag
  • test main executable

Improve character escaping

mp3lyrics works great for most songs, but seems to miss every song in which the title contains characters like ( ) - . and probably others. I imagine this has to do with character escaping. Since especially parentheses are pretty common in song titles, this results in about a 35% miss in my experience.

Robust error handling

Currently the application crashes when an error occurs. Instead the song should be skipped and the error logged, but app should continue to run.

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.