
These options may be useful if one either simply wants to build a lyrics database but always fetch the latest, or perhaps limit lyrics to a fixed cache but not add to it, or perhaps is using a readonly directory. "" (the opposite) will cache new lyrics but will never attempt to fetch (read) lyrics from the cache directory. If no matching lyrics file is found (and the search module list is not specifically set to "Cache" (and lyrics are found on the internet), then the lyrics will be saved to the directory under " artist/ title.lrc".Īn optional dirctional indicator ("") can be prepended to the directory to limit caching activity. If specified, this directory will be searched for a matching lyrics (.lrc) file (in this example, "/home/user/Music/LyricsFiles/ artist/ title.lrc"). "/home/user/Music/Lyricsfiles") to be used for disk caching. NOTE: This value will be overridden if $founder->agent("agent") is called! -cache => "directory", and -debug => integer. browser name) to pass to Some sites are pickey about receiving a user-agent string that corresponds to a valid / supported web-browser to prevent their sites from being "scraped" by programs, such as this.ĭefault: "Mozilla/5.0 (X11 Linux x86_64 rv:84.0) Gecko/20100101 Firefox/84.0". Specifies an alternate "user-agent" string sent to when attempting to fetch lyrics. The currently-supported options are: -agent => "user-agent string" If an "-option" is specified with no "value" given, the default value will be 1 (" true"). Options is a hash of option/value pairs (ie. The same finder object can be used for multiple fetches, so this normally only needs to be called once. SUBROUTINES/METHODS new LyricFinder::Musixmatch()Ĭreates a new finder object for fetching lyrics. This module is installed automatically with LyricFinder installation.

If all goes well, it will have 'Ok' in it. In case of problems with fetching lyrics, the error string will be returned by $finder->message(). In those cases, we set the status to "error!". There are some rare cases where no lyrics are found the normal way and we have to try a backup method to extract them. can be suppressed by passing the option "-noextra" => 1. Therefore, we append: (Musixmatch status: status) to the end of the returned lyrics. I don't know if this means someone's complained about correctness, profanity, etc. "warning" seems to mean "pending review", and when flagged "error", their site says "We detected some issues". NOTE: Musixmatch flags lyrics with a status of either "ok", "warning", or "error". In LyricFinder, it is invoked by specifying "Musixmatch" as the third argument of the fetch() method. It's designed to be called by LyricFinder, but can be used directly as well. LyricFinder::Musixmatch accepts an artist name and song title, searches for song lyrics, and, if found, returns them as a string. My $localfinder = new LyricFinder::Musixmatch(-cache => '/tmp/lyrics') DESCRIPTION Print "(Lyrics courtesy: ".$finder->source().")\n" # To fetch the source (site) name and base url: Print $finder->fetch('Pink Floyd','Echoes') My $finder = new LyricFinder::Musixmatch()

Many thanks to David for laying the groundwork for this module! SYNOPSIS #!/usr/bin/perl NOTE: This is a "derived work" of Lyrics::Fetcher family of modules, by (c) David Precious (davidp at .uk) (CPAN Id: BIGPRESH), as fair use legal under the terms of, subject to, and licensed in terms compatable and compliant with those modules.
#Musixmatch lyrics finder software#
This library is free software you can redistribute it and/or modify it under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file.

LyricFinder::Musixmatch - Fetch song lyrics from AUTHOR
