h1. Glyr is a search engine for music related metadata

The finest search you can buy for no money ^TM^

!https://github.com/sahib/glyr/blob/master/doc/screenshot.png([screenshot])!

It comes both in a command-line interface tool and as a C library, both with an easy to use interface.
The sort of metadata glyr is searching (and downloading) is usually the data you see in your musicplayer.
And indeed, originally it was written to serve as internally library for a musicplayer, but has been extended to 
work as a standalone program which is able to download:
<p>
<table border="1">
<tr>
<th>Getter</th><th>Description</th>
</tr>
<tr><td>cover</td><td>Coverart (front images supported only)</td></tr>
<tr><td>lyrics</td><td>Songtext</td></tr>
<tr><td>artistphotos</td><td>Photos of a certain band (press or live)</td></tr>
<tr><td>artistbio</td><td>Artist biography from various sites</td></tr>
<tr><td>review</td><td>album reviews from various sites</td></tr>
<tr><td>albumlist</td><td>A list of albums from a specific artist.</td></tr>
<tr><td>tags</td><td>Tags, either related to artist, album or title</td></tr>
<tr><td>relations</td><td>links to wikipedia, myspace, musicbrainz ...</td></tr>
<tr><td>similarartists</td><td>similar artists</td></tr>
<tr><td>similarsongs</td><td>similar songs</td></tr>
<tr><td>tracklist</td><td>tracklists of an album</td></tr>
<tr><td>guitartabs</td><td>guitartabs in textual form</td></tr>
<tr><td>backdrops</td><td> Large artist photos, suitable for backgrounds</td></tr>
</table>
</p>

*Terminology*:
To prevent disambiguation the following terms are used below: 	
* _glyrc_ is the command-line interface to libglyr.
* _libglyr_ is the library behind, which may be used by your program.
* a _getter_ is a type of metadata to download, e.g. @cover@, sometimes also called _fetcher_
* a _provider_ is a source libglyr queries in order to find the data.
* _glyros_ is the ruby wrapper for this lib. Currently it is not maintained.

h2. FEATURES

* Many built-in providers (46 at time of writing, ~30 distinct sites), high success-rate (the longer the search, the higher the risk :))
* Portable: Windows and Linux are supported (Developement on Linux) see ~[1]~ for Mac OSX, 
* Fuzzy matching: Search providers with Levenshtein algorithm to eliminate typos and enhance search results.
* Decent Unicode support: All sort of valid UTF8 is taken, and UTf8 output can be forced.
* Fast Download: libcurl is used internally, and sources are searched in parallel, unneeded data is not downloaded if possible.
* Lightweight dependencies: libcurl, glib and sqlite (for caching) - typical linux systems have those installed.
* Download of a user defined amount of items, @glyrc cover -a Foo -b Bar -n 30@ tries to load 30 covers of album 'Bar' by artist 'Foo'.
* Grouped download: Query providers by descending Accuray / Speed; controllable by the user over the @qsratio@
* Optional download of images, URL is returned otherwise - so it can act a bit like a search-engine.
* Free Software licensed under the terms of the GPLv3
* libglyr is portable, easy, threadsafe and lowlevel enough for everyone.
* ...lots of other options like min/max size for images.
* A built-in cache to store the metadata (using SQLite)

h2. GETTING STARTED

h3. Compiling

See the "compile page":https://github.com/sahib/glyr/wiki/Compiling.

h3. libglyr:

See the "examples in src/examples":https://github.com/sahib/glyr/wiki for a quickstart.
There's also a more "gentle (and brief) introduction.":https://github.com/sahib/glyr/wiki/Introduction-to-libglyr
Also see the "API Reference":http://sahib.github.com/glyr/doc/html/index.html
*Please note:* Since version 1.0.0 the API will be stable, and will only be open for extensions.

h3. glyrc:

Please refer to @glyrc -h@ which gives you a brief introduction to the arguments you can pass,
See the "wiki":https://github.com/sahib/glyr/wiki/Commandline-arguments for more detailed information about the options.

h2. FAQ

h3. Anyone using it already?

* "GMPC":http://gmpc.wikia.com/wiki/Gnome_Music_Player_Client
* "Pragha":http://pragha.wikispaces.com/
* "Freya":https://github.com/studentkittens/Freya
* "lyvi":http://ok100.github.com/lyvi/

h3. Glyr.. such a silly name! Why? 

Indeed. Should have named it 'Glyros' (too late, damnit).

h3. Is it hard to write something with it?

Some knowledge of C might be required, but the code is straight forward most of the time.

Bash scripts are pretty straight-forward:
@glyrc cover --artist Equilibrium --album Sagas --write '/tmp/:artist:_:album:.:format:' --callback 'sxiv ":path:"'@

Additionally there are bindings to Python and Ruby:

* "plyr":https://github.com/sahib/python-glyr by me (complete API).
* "ruby-glyr":https://github.com/meh/ruby-glyr by meh (complete API).


h3. How..how am I supposed to use it?

Well, as normal user you could use @glyrc@ to retrieve some metadata in a batchlike fashion.
As developers you have lots of option, you could write glyr-plugins for musicplayers (gmpc!), set up a webserver with this,
hack up little scripts showing covers on the desktop.. everything related to musicmetadat is possible here.
You could also extend libglyr itself but that's a little harder.

h3. Isn't there musicbrainz already?

# The kind of metadata downloaded by glyr differs heavily from musicbrainz.
i.e. glyr finds metadata for musicplayers while musicbrainz finds data for CD Rippers and taggers.
# Musicbrainz runs remotely on some server and uses a large database which is searched through lucene.
Glyr is a client program which hops over several sites and does not cache anything, unless you do it yourself.
You could of course let glyr run on a (remote) server, and cache all results to do something similiar.
# There is "coverarchive.org":www.coverartarchive.org , but it does not seem to fully work yet. But it will be accessible once it does.

h2. AUTHOR

See the AUTHORS file that comes in glyr's distribution.
See also COPYING to know about your rights.

h2. I CAN HAZ HELP?

h3. BUGS

If you found one: _Meh. Sorry for that._
If you file a bugreport: _Hey, thank you!_

Use the "Issue Tracker":https://github.com/sahib/glyr/issues to share your find.
Alternatively you may drop me a mail at <sahib@online.de>

h3. PATCHES

If you hacked one: Excellent! Send it to me via mail or see below.
If you want to add new providers you should look at the existing provider plugins to get an idea how to write one.
Starting with lib/cover/lastfm.c isn't a bad idea either, because it is one of the very simple ones.

__Take the usual Git(Hub) approach:__
# Fork this project
# Make your changes
# Make a Pull request

If you're not familiar with git, or just don't like it,
you can also send me the patch via mail: <sahib@online.de>

Thanks for any help in advance!

h3. WRITE SOFTWARE THAT USES GLYR

May sound strange, but you're giving me a reason to maintain it, write new providers etc.
Also bugreports (well, there are no bugs, just in case) are appreciated, or just questions.
Those help to make the documentation more clear.

h3. DONATE

You also might consider a small (CS-Students are already motivated by 1 Cent <img src="http://www.blendpolis.de/images/smilies/icon_wink.gif"/>) donation if you use feel like it:<a class="FlattrButton" style="display:none;" rev="flattr;button:compact;" href="https://github.com/sahib/glyr"></a>
<noscript><a href="http://flattr.com/thing/302682/libglyr" target="_blank">
<img src="http://api.flattr.com/button/flattr-badge-large.png" alt="Flattr this" title="Flattr this" border="0" /></a></noscript>
(For now only possible via Flattr or "Paypal":http://sahib.github.com/donate.html , you gonna need an account there - Sorry)

h2. DISCLAIMER

As usual, no warranty is granted that this software works like expected.
Refer to the GPLv3 copy you got with libglyr. It is "here.":https://github.com/sahib/glyr/blob/master/COPYING
Glyr is just a way to find the data, it does not own any rights on the data it found.

**All retrieved items are copyrighted by their respective copyright owners.**

Refer to the provider's terms of use. Every item you get from libglyr contains the name and a url to the provider, so lookup there terms of use there.

<br>
<br>

h3. 

[1] Glyr has not been tested on Mac OSX yet. If you own a Mac, any help with 'porting' glyr is highly appreciated. My guess would be that no to almost no changes need to be done though.
