Package: lyrico
lyricolyricois a command line application which downloads lyrics for your songs. When given a folder,lyricowill:scan it, and all inner folders, for audio filesread the metadata for all songs that it detectsdownload the lyrics for each songembed the lyrics downloaded into the song (as standard lyrics tag) and also save it to a text fileCurrent version oflyricosupports onlyunsynced lyrics.SupportAudio Formats- mp3, flac, m4a, mp4, wma, ogg/oga (Vorbis and FLAC).Python- Python 27 and Python 3 (tested on Python 3.5 Python 3.4)OS- Windows, Linux (tested on Ubuntu).InstallationUse the standardpipinstall:pip install lyricoThis will also install the dependencies. Hence, it is recommended to installlyricoon a separatevirtual environment.You can test iflyricowas installed correctly by running the ‘lyrico’ command, which now should be available:lyricoThis would give the following output:source_dir is not set. Please use the "set" command to set source_dir.
use "lyrico --help" to view commands.
Your current settings:

ACTIONS
    save_to_file = True
    save_to_tag = False
    overwrite = False


PATHS
    source_dir = None
    lyrics_dir = None


SOURCES
    lyric_wikia = True
    lyrics_n_music = True
    musix_match = True
    lyricsmode = True
    az_lyrics = FalseIf you get this screen, that meanslyricoand its dependencies were installed correctly.If you see an error likeImportError: No module named mutagen.id3, this means that the dependencies were not installed for some reason. In that case you can install them very easily with single command. Here’s what you do:Go tolyrico’sGitHub page.Download repository as ZIP and extract therequirements.txtfile from it. It is in the root directory of repository. This is the only file you need.Open command prompt in directory containing therequirements.txtand run following command (if you’re using a virtual environment, activate it before running the command):pip install -r requirements.txtThis will install all of thelyrico’s dependencies and now you can try testing with the ‘lyrico’ command. It should give no errors.Runninglyricolyricooperates using two directories (folders):Source Directory (source_dir): This is the directory whichlyricoscans for audio files. The scan also includes all the directories contained within.Lyrics Directory (lyrics_dir): This is wherelyricowill save the lyrics’ text files.Before runninglyricoyou must set these using thesetcommand. Values must be absolute paths to the directories. Once set,lyricowill remember your settings (which can be changed easily at any time). So this has to be done only for the first time.This is how an example first-run would look like on Windows.Set thesource_dir:lyrico set source_dir D:\test\MusicThis logs the following message:source_dir updated.
lyrico will scan the following folder for audio files:
    D:\test\MusicWhen settingsource_dir, the directory must exist beforehand.lyricowillnot createthesource_dirfor you.Set thelyrics_dir:lyrico set lyrics_dir D:\test\LyricsThis logs the following in command prompt:Directory does not exist. Creating new one.
lyrics_dir updated.
lyrico will save lyrics files in the following folder:
    D:\test\LyricsUnlikesource_dir, when setting thelyrics_dirto folder that does not exist (as in this example);lyricowillcreate it for you.Run lyrico:lyricoThis will start the application and it will start downloading the lyrics for songs that it detects in thesource_dir. You will be able to see the status (song name, lyrics URL) in the command prompt as it downloads, one at a time, the lyrics for each song.Finally it builds the log of whole operation and saves it in thelog.txtfile.log.txtis located in yourlyrics_dir.Other Settings and CommandsBasic settings likesource_dirandlyrics_dircan be repeatedly changed using thesetcommand as described in the example above. There are few more settings that are available to controllyrico’s actions. These actions can be either disabled or enabled.save_to_file- When enabled,lyricowill save the lyrics downloaded to a text file and put it in thelyrics_dir. The naming convention of file is as follows:[artist name] - [title].txtwhere  [artist name] and [title] are extracted from the song’s metadata. It either of this is not found, lyrics won’t be downloaded and you will see that in the finallog.txt. This naming convention in the current version cannot be changed.enabled by defaultsave_to_tag- When enabled,lyricowill embed the lyrics downloaded into song tags.lyricouses the standard lyrics tags for different formats. This means, as long as your music player can read standard lyrics tags from the song’s metadata, it should display them.disabled by defaultoverwrite- When enabled,lyricowill always download the lyrics for a song ignoring they might already be present in the lyrics tag or in thelyrics_diras a text file. After the download, it overwrites any existing lyrics in the tag or the text file.This setting is meant to avoid repetitive download of lyrics. For example, if there is a song ‘ABC’ in thesource_dir. Andoverwriteisdisabled. Whenlyricois run, it will first look intolyrics_dirif it already has lyrics. If yes, then it would ignore the song.overwritetakes into account, thesave_to_fileandsave_to_tagsettings to decide what to do. Forsave_to_file, it looks inlyrics_dirand forsave_to_tagit searches for existing lyrics in songs’s metadata. Whenever there is a void, download happens and old lyrics will be replaced by downloaded ones in both, text file and song metadata as per your settings.disabled by defaultThe above three settings can be changed usingenableanddisablecommands. This is how you will enablesave_to_tagfrom its default ‘disabled’ setting:lyrico enable save_to_tagThis would log:save_to_tag enabled
lyrico will embed the downloaded lyrics into song tags.Similarly to disablesave_to_file:lyrico disable save_to_fileThis gives following message in command prompt:save_to_file disabled
lyrico will not save the downloaded lyrics to text files.Viewing current settings- To view current settings use the following command:lyrico --settingsHelp- You can always view all the commands by asking for the help screen:lyrico --helplyricoquick invocation- you can supplysource_diralong withlyricocommand. The following command:lyrico full_path_to_source_diris same as running the two commands:lyrico set source_dir full_path_to_source_dir
lyricoHowever this won’t work for the very first run. When runninglyricofor the first time after installation, thesource_dirmust be set explicitly using thesetcommand.Lyrics Sourceslyricouses the following sources from where it downloads the lyrics:Lyric Wikia:lyric_wikiaLYRICSnMUSIC:lyrics_n_musicmusiXmatch:musix_matchLYRICSMODE:lyricsmodeAZLyrics:az_lyrics(disabled by default)The search order is same as enumerated above and cannot be changed. You can, however, disable or enable any of the sources using the sameenableanddisablecommands. When a source is disabled, it is simply skipped during the search.For example, to enable AZLyrics:lyrico enable az_lyricsUse the command line name for the source, which is mentioned after the link to the source in the above list. This logs the following message indicating thataz_lyricswill be used as a source:az_lyrics enabled
lyrico will use AZLyrics as a source for lyrics.Or to disable Lyric Wikia:lyrico disable lyric_wikia:This logs the following message:lyric_wikia disabled
lyrico will not use Lyric Wikia as a source for lyrics.Audio Formats and TagsBelow is the table of supported audio formats and their supported tags:Audio FormatTagmp3ID3 TagsflacVorbis Commentsm4a, mp4MP4 Tags (iTunes metadata)wmaASFogg, ogaVorbis CommentslyricogoodnessHere are somethings thatlyricodoes well:No junk-lyricowill not insert junk text into your lyrics files or audio tags. It won’t create blank files or blank lyrics tags. Neither it would create lyrics files or tags containing errors etc.Language- Sincelyricouses your song’s artist name and title to construct the URLs; so as long as they are correct and the source has the lyrics, it would work no matter which language.foobar2000- The poor performance of theLyric Show Panel 3component was main reason I wrote this application. It simply won’t work for me.lyricoplays nicely with ‘Lyric Show Panel’.lyrico’s file-naming convention matches ‘Lyric Show Panel’s default settings. Just point ‘Lyric Show Panel’ to yourlyrics_dirand done.I recommend simply removing all of ‘Lyric Show Panel’ online sources and use offline mode (Tag search, Files search, Associations search) withlyrico. It is the next best thing to automatic search. Because ‘Lyric Show Panel’ on failure embeds errors in lyrics files and tags!Even if you don’t use foobar2000 or your music player cannot read lyrics from text files like that, you can always embed lyrics into tags which should work with any decent music player includingiTunes.log.txt-log.txtcreated at end of everylyricorun is nice way to see what have you fetched. It show list of every song present insource_diralong with status of download or errors that happened.lyricogotchasHere are few points you should know before usinglyrico:Your tags-lyricouses metadata in your tags for building URLs. Hence your songs should be tagged with correct ‘artist’, ‘title’ information.lyricoalso assumes that you’re using standard tags for each format (container) of your songs. For example,lyricoassumes that your.mp3files are using the standardID3tags and only reads metadata for those. If you are using something like anAPEv2tag with an.mp3file,lyricowon’t be able to read it and would log the pertinent error in thelog.txt.You don’t need to be concerned about this unless you have forcibly embedded non-standard tags in your songs with some other software.Table of supported tags for audio formats is given above.ID3 tag versions-lyricowill convert any old ID3 tag to ID3v2.4 ifsave_to_tagis enabled. This is the default behavior ofmutagen; the underlying dependency used bylyricoto read ID3 tags.This has never caused any problem for me till date. And from my understanding you should be using ID3v2.4 tags anyways. I have usedlyricoon hundreds of mp3 files and had no issues. You can always testlyricoon few songs and check. Or you can just disablesave_to_tag.Song metadata- Lyrics are fetched using a URL generated using song’s artist name and title. This means that if the song has titles like:ABC(acoustic)ABC(live version)or an artist like:XYZ(feat. Blah)the download might fail. Sometimes artist-name or title contain characters like ‘?’.  For this, Windows won’t be able to create the text file as it is a restricted character. But the lyrics will be downloaded anyways and saved to tag ifsave_to_tagis enabled.windows console- If you are using Windows, like me, you must use some other font than the default ‘raster fonts’ in the command prompt to view in-prompt logging for songs using other characters than English in their metadata.But the problem does not end here. Even after enabling other allowed fonts likeConsolasorLucida Console, you still won’t be able to see in-prompt logging (you will see question marks or boxes) for Asian languages like Mandarin, Japanese, Korean etc. Though European language are displayed correctly.Despite any issues with windows console display,lyricodownloads and saves the lyrics correctly to files and tags.Dependencieslyricouses and thanks the following python packages:glob2: to allow simple recursive directory search in Python 27.requests: HTTP for Humans.mutagen: to read tags from audio files and embed lyrics in tags for multiple audio formats.beautifulsoup4: to extract the lyrics.win_unicode_console: because Python 27, Unicode and command prompt is a nightmare.docopt: to create beautiful command-line interfaces.A note on mass downloadingSincelyricois simply scraping lyrics off the HTML pages of the sources, please don’t setsource_dirto a folder having thousands of songs.They might ban your bot.az_lyricssometimes bans your IP (not sure if permanent) if you hit them with too many failed requests. Though, refreshing your IP by restarting your router or using a VPN solves that. Hence,az_lyricsas a source is disabled by default. Only use it if you are looking for recent lyrics.Also, downloading 1000s of lyrics will be slow sincelyricodoes not batch-download. It sends one request to one source at a time. This is by design.I personally use it at one or two albums at time and keep checking for any errors inlog.txt.Changelog0.6.0 Added support forogaaudio format. Detect uppercase extensions in Linux.0.5.0 Added musiXmatch and LYRICSMODE to sources. Include detection for licensing errors.0.4.0 Added LYRICSnMUSIC and AZLyrics as sources. Expanded the command line interface to control sources. Addedrequeststo dependencies.0.3.0 Added support foroggandwmaaudio formats. ReplacedUNSYNCED LYRICSwithLYRICStags to embed lyrics in Vorbis Comments.0.2.0 Added documentation and tutorial.0.1.0 Initial release.