Difference between revisions of "Help:Wiki-Lyrics Script"

From Lyriki
Jump to navigation Jump to search
(More editing on this, slowly getting it in line....)
 
(36 intermediate revisions by 5 users not shown)
Line 1: Line 1:
This guide intends to explain all steps necesaries to get Lyriki script working on Windows. Feel free to expand it if you manage to get it working by tweaking something not explained here. If you're having problems following any of the steps, don't hesitate to ask on the [[Help_talk:Lyriki On Windows|talk page]], we'll try to give you an answer.
+
Wiki-Lyrics is a set of [[wikipedia:Ruby (programming language)|Ruby]] classes and scripts to interface with various lyrics sites and submit content to [[Main Page|Lyriki]] and LyricWiki, both [[wikipedia:wiki|wikis]] for lyrics. Wiki-Lyrics can be downloaded from [http://www.kde-apps.org/content/show.php?content=35151 KDE-Apps].
 +
 
 +
Currently only 2 interfaces exists: an [http://amarok.kde.org Amarok] script and a standalone command line interface. However, the command line interface can be used from [http://www.winamp.com/ Winamp] and other Windows players with the help of [http://amip.tools-for.net/wiki/ AMIP] plugins, and directly from other Linux players such as [http://audacious-media-player.org/ Audacious].
 +
 
 +
= Supported Sites =
 +
{|style="width:98%;
 +
|style="width:30%; vertical-align:top;"|
 +
* Lyriki <small>[http://www.lyriki.com www.lyriki.com]</small>
 +
* AZ Lyrics <small>[http://www.azlyrics.com www.azlyrics.com]</small>
 +
* Baidu MP3 <small>[http://mp3.baidu.com mp3.baidu.com]</small>
 +
* Dark Lyrics <small>[http://www.darklyrics.com www.darklyrics.com]</small>
 +
|style="width:35%; vertical-align:top;"|
 +
* Giitaayan <small>[http://www.giitaayan.com www.giitaayan.com]</small>
 +
* Jamendo <small>[http://www.jamendo.com www.jamendo.com]</small>
 +
* Lyrc <small>[http://lyrc.com.ar lyrc.com.ar]</small>
 +
* Leos Lyrics <small>[http://www.leoslyrics.com www.leoslyrics.com]</small>
 +
* Lyrics Download <small>[http://www.lyricsdownload.com www.lyricsdownload.com]</small>
 +
|style="width:35%; vertical-align:top;"|
 +
* Lyrics Mania <small>[http://www.lyricsmania.com www.lyricsmania.com]</small>
 +
* Not Popular <small>[http://www.notpopular.com www.notpopular.com]</small>
 +
* Seek Lyrics <small>[http://www.seeklyrics.com www.seeklyrics.com]</small>
 +
* Sing365 <small>[http://www.sing365.com www.sing365.com]</small>
 +
* Terra Letras <small>[http://letras.terra.com.br letras.terra.com.br]</small>
 +
* LyricWiki
 +
* Clickgrátis <small>[http://www.clickgratis.com.br/letras-de-musicas/ letras de músicas]</small>
 +
|}
 +
 
 +
= Submitting Policy =
 +
 
 +
* ''Always keep your version of the script updated''. This ensures submitted content follows the [[Help:Contents|current site guides]] and reduces the damage to the site caused by bugs in the script or plain obsolesce of the plugins (the parts of it that parse the content of the [[Help:{{PAGENAME}}#Supported Sites|supported sites]] --content which is eventually submitted by the script).
 +
* Properly tag your files, specially if you submit content without reviewing it. ''You are responsible for the pages the script submits in your behalf''.
 +
* Check your talk page from time to time for any problems someone might have spotted with the script. Update notices and wrongly tagged files warnings will be placed there if necessary.
 +
* You are free to modify and use the script under the terms of the [[wikipedia:GPL|GPL]]. However if you use a modified version to submit content, you should also change the way the script identifies its submissions (this helps in identifying sources of problems). Translated, ''do not impersonate Wiki-Lyrics script''. This particularly applies to any mod bypassing the login restriction to submit content. Failure to comply will result in warnings, followed by bans in case of reiteration.
 +
 
 +
= Using Wiki-Lyrics on Windows =
 +
This guide intends to explain all steps necesaries to get the script working on Windows. Feel free to expand it if you manage to get it working by tweaking something not explained here. If you're having problems following any of the steps, don't hesitate to ask on the [[Help talk:{{PAGENAME}}|talk page]], we'll try to give you an answer.
  
 
== Install Ruby ==
 
== Install Ruby ==
Download and install the lastest version of the [http://rubyforge.org/frs/?group_id=167 Ruby One-Click-Installer] for Windows from [http://rubyforge.org/ RubyForge].
+
Download and install the latest version of the [http://rubyforge.org/frs/?group_id=167 Ruby One-Click-Installer] for Windows from [http://rubyforge.org/ RubyForge].
  
== Choose a GUI Toolkit ==
+
== Install a GUI Toolkit ==
Currently, Lyriki on Windows can only use GTK or Tcl/TK for it's GUI drawing.  You'll need to pick one of these.  Tcl/tk is easier to install, has fewer quirks, but, isn't as pretty as GTK.
+
At least one of the supported [[wikipedia:GUI toolkit|GUI toolkits]] is needed to actually see the lyrics. Currently, the Qt4, GTK+ and Tk GUI back-ends are supported on Windows.
  
Depending on which toolkit you choose, you'll also have different options available to you as far as how to configure AMIP and such to call Lyriki.  If using Tcl/TK you can call lyriki.rb directly.  If you're using GTK, you'll need to create a lyriki.bat file to handle calling lyriki.rb.  You can of course, use a batch file if you want when using Tcl/TK.
+
=== Install QtRuby ===
 +
TODO
  
==== Installing GTK ====
+
=== Install Ruby/GTK ===
Download and install the [http://prdownloads.sourceforge.net/gladewin32/gtk-2.8.20-win32-1.exe?download GTK runtime libraries] from [http://gladewin32.sourceforge.net/modules/news/ Glade for Windows].
+
Download and install the [http://prdownloads.sourceforge.net/gladewin32/gtk-2.10.11-win32-1.exe?download GTK runtime libraries] from [http://gladewin32.sourceforge.net/modules/news/ Glade for Windows].
  
Download the [http://prdownloads.sourceforge.net/ruby-gnome2/ruby-gtk2-0.15.0-1-i386-msvcrt-1.zip?download Ruby/GTK Bindings] for Windows. To install them decompress the zip contents in a folder and run the following command from a shell prompt:
+
Download the [http://prdownloads.sourceforge.net/ruby-gnome2/ruby-gtk2-0.16.0-1-i386-msvcrt-1.8.zip?download Ruby/GTK Bindings] for Windows. To install them decompress the zip contents in a folder and run the following command from a shell prompt:
  C:\ruby-gtk2-0.15.0-1-i386-msvcrt-1.8> ruby.exe install.rb
+
  C:\ruby-gtk2-0.16.0-1-i386-msvcrt-1.8> ruby.exe install.rb
  
==== Installing Tcl/TK ====
+
=== Install Tcl/Tk ===
 
Download and install [http://www.activestate.com/store/freedownload.aspx?prdGuid=f0cd6399-fefb-466e-ba17-220dcd6f4078 ActiveTcl] from the [http://www.activestate.com ActiveState] site.
 
Download and install [http://www.activestate.com/store/freedownload.aspx?prdGuid=f0cd6399-fefb-466e-ba17-220dcd6f4078 ActiveTcl] from the [http://www.activestate.com ActiveState] site.
  
== Install Lyriki-Lyrics Script ==
+
== Install Wiki-Lyrics Script ==
Download and extract the [http://www.kde-apps.org/content/show.php?content=35151 Lyriki-Lyrics script] to an empty folder on your computer, such as "C:\Lyriki" or "C:\Program Files\Lyriki".
+
Download and extract the [http://www.kde-apps.org/content/show.php?content=35151 Wiki-Lyrics script] to an empty folder on your computer, such as "C:\WikiLyrics" or "C:\Program Files\WikiLyrics".
  
 
== Install and Configure AMIP ==
 
== Install and Configure AMIP ==
 
Install [http://amip.tools-for.net/wiki/ AMIP] for the media player you're using.
 
Install [http://amip.tools-for.net/wiki/ AMIP] for the media player you're using.
  
Configure AMIP's "output string & preset" to be one of the suggested settings (explained below) and make sure the script is enabled (is that's configurable).
+
Configure AMIP's "output string & preset" to be one of the suggested settings (explained below) and make sure the script is enabled (if that's configurable). To use Wiki-Lyrics script AMIP has to be instructed to call wikilyrics.bat, located on the win folder.
 
 
'''Someone missed a step or misunderstood my previous instructions, consider this inaccurate at present. If you attempt these instructions and they do not work, reference Appendix C which contains the original old directions.'''
 
  
:'''a.''' Fetch lyrics from Lyriki and other sites, prompt to submit missing lyrics:
+
{{code box|Fetch lyrics from Lyriki and LyricWiki, prompt to submit missing lyrics to Lyriki|/exec:(<wikilyrics.bat FULL PATH>) -a "%1" -t "%2" -s Lyriki -u USERNAME -p PASSWORD --persist session}}
:<pre>/exec:(<full path to lyriki.bat>) -a "%1" -t "%2" -l "%4" -y "%5" -s -u <user> -p <pass> --persist session</pre>
 
  
:'''b.''' Fetch lyrics from Lyriki and other sites, prompt to submit missing lyrics and review autogenerated pages:
+
{{code box|Fetch lyrics from Lyriki and LyricWiki, prompt to submit missing lyrics to Lyriki and review autogenerated pages|/exec:(<wikilyrics.bat FULL PATH>) -a "%1" -t "%2" -s Lyriki -u USERNAME -p PASSWORD --persist session -g}}
:<pre>/exec:(<full path to lyriki.bat>) -a "%1" -t "%2" -l "%4" -y "%5" -s -u <user> -p <pass> --persist session -g </pre>
 
  
:'''c.''' Fetch lyrics from Lyriki and other sites, do not prompt to submit missing lyrics:
+
{{code box|Fetch lyrics from Lyriki and LyricWiki, do not prompt to submit missing lyrics|/exec:(<wikilyrics.bat FULL PATH>) -a "%1" -t "%2"}}
:<pre>/exec:(<full path to lyriki.bat>) -a "%1" -t "%2" -l "%4" -y "%5"</pre>
 
  
:'''d.''' Fetch lyrics only from Lyriki, do not prompt to submit missing lyrics:
+
{{code box|Fetch lyrics only from Lyriki, do not prompt to submit missing lyrics|/exec:(<wikilyrics.bat FULL PATH>) -a "%1" -t "%2" --sites Lyriki}}
:<pre>/exec:(<full path to lyriki.bat>) -a "%1" -t "%2" -l "%4" -y "%5" --no-meta</pre>
 
  
:'''NOTE''': these are only suggestions; you can customize AMIP's "output string & preset" option to do whatever you like (read the [[{{FULLPAGENAME}}#Appendix A: lyriki.bat options|appendix on lyriki.bat options]] to find out what each switch does).
+
:'''NOTE''': these are only suggestions; you can customize AMIP's "output string & preset" option to your liking (read the [[{{FULLPAGENAME}}#Command Line Interface Options|section on command line interface options]] to find out what each switch does).
  
 
== Try It Out ==
 
== Try It Out ==
Line 46: Line 76:
 
If nothing happens it might be one of the following reasons:
 
If nothing happens it might be one of the following reasons:
 
# ''The lyrics were not found'': how likely this is depends on AMIP's "output string & preset" option and on the song playing. To rule this out try with other songs and, if it's not the case already, change AMIP's "output string & preset" option to search the lyrics on other sites as well (remove the --no-meta switch).
 
# ''The lyrics were not found'': how likely this is depends on AMIP's "output string & preset" option and on the song playing. To rule this out try with other songs and, if it's not the case already, change AMIP's "output string & preset" option to search the lyrics on other sites as well (remove the --no-meta switch).
# ''There is a problem with the GTK or Ruby/GTK instalation'': there seems to be an incompatibility between the [http://www.gnu.org/software/libiconv/ iconv] version installed with Ruby and the one needed by GTK. Try executing the file gtk_fix.bat provided with the Lyriki script.
+
# ''There is a problem with the GTK or Ruby/GTK instalation'': there seems to be an incompatibility between the [http://www.gnu.org/software/libiconv/ iconv] version installed with Ruby and the one needed by GTK. Try executing the file gtk_fix.bat found on the win directory.
 
# ''There is a problem with the Tcl/Tk instalation'': you may need to copy the tcl lib directory to the root of the drive you have Lyriki's plugin installed to.
 
# ''There is a problem with the Tcl/Tk instalation'': you may need to copy the tcl lib directory to the root of the drive you have Lyriki's plugin installed to.
  
== Appendix A: lyriki.bat options ==
+
== Screenshots ==
<pre>Usage: lyriki.bat [OPTIONS]
+
No, seriously... it works:
  
Options:
+
* Wiki-Lyrics running from Winamp (GTK toolkit)
    -a, --artist [ARTIST]            Song artist (mandatory).
+
[[Image:Lyriki_rb_On_Windows_(gtk).png|Lyriki-Lyrics running from Winamp (GTK toolkit)]]
    -t, --title [TITLE]              Song title (mandatory).
+
* Wiki-Lyrics running from Winamp (Tk toolkit)
    -l, --album [ALBUM]             Song album.
+
[[Image:Lyriki_rb_On_Windows_(tk).png|Lyriki-Lyrics running from Winamp (Tk toolkit)|600px]]
    -y, --year [YEAR]               Song album year.
 
  
    -c, --[no-]cleanup              Cleanup fetched lyrics (true by default).
+
= Using Wiki-Lyrics with Audacious =
 +
To use the script with Audacious you have to enable the Song Change plugin and configure it to call cli/wikilyrics.rb when a new song starts.
  
    -m, --[no-]meta                  Search missing lyrics in other sites (true by default).
+
== Install Wiki-Lyrics Script ==
        --meta-sites [S1,S2...]      Specify sites to query for missing lyrics, order included (defaults to all
+
Download and extract the [http://www.kde-apps.org/content/show.php?content=35151 Wiki-Lyrics script].
                                    available sites if -m given).
 
                                    Available sites:
 
                                      - AZ Lyrics (www.azlyrics.com)
 
                                      - Jamendo (www.jamendo.com)
 
                                      - Leos Lyrics (www.leoslyrics.com)
 
                                      - Lyrc (lyrc.com.ar)
 
                                      - LyricWiki (www.lyricwiki.org)
 
                                      - Lyrix.at (www.lyrix.at)
 
                                      - Sing365 (www.sing365.com)
 
                                      - Terra Letras (letras.terra.com.br)
 
  
    -s, --[no-]submit                Submit lyrics to Lyriki (false by default).
+
== Configure the Song Change Plugin ==
    -u, --user [USERNAME]            Username to login with (mandatory when -s specified).
+
Make sure the plugin is enabled (it's on the General plugins section) and configure the "command to run when audacious starts a new song" to call wikilyrics.rb, located under the "cli" directory. Let's see some examples:
    -p, --pass [PASSWORD]            Password to login with (mandatory when -s specified).
 
        --persist [SESSIONFILE]      Restore session from file and save it before exiting (needs -u & -p).
 
  
                                    NOTE: it is extremely recommended to specify this option if -s is specified.
+
{{code box|Fetch lyrics from Lyriki and LyricWiki, prompt to submit missing lyrics to Lyriki|ruby <wikilyrics.rb FULL PATH> -a ARTIST -t TITLE -s Lyriki -u USERNAME -p PASSWORD --persist session}}
                                          Otherwise, the script will attempt to (re)login to the site for every
 
                                          song (wasting a few seconds every time!).
 
  
    -r, --[no-]review                Prompt for review before submitting content (requires -s, true by default).
+
{{code box|Fetch lyrics from Lyriki and LyricWiki, prompt to submit missing lyrics to Lyriki and review autogenerated pages|ruby <wikilyrics.rb FULL PATH> -a ARTIST -t TITLE -s Lyriki -u USERNAME -p PASSWORD --persist session -g}}
    -g, --[no-]prompt-autogen        Prompt for review of autogenerated pages (requires -r, false by default).
 
    -n, --[no-]prompt-new            Prompt for submission even when there are no lyrics to submit (requires -r,
 
                                    false by default).
 
  
    -x, --proxy [PROXY]              Proxy server URL (defaults to no proxy).
+
{{code box|Fetch lyrics from Lyriki and LyricWiki, do not prompt to submit missing lyrics|ruby <wikilyrics.rb FULL PATH> -a ARTIST -t TITLE}}
  
    -k, --toolkits [gtk,tk]          Specify UI toolkit priority (falling back to the next one when loading fails).
+
{{code box|Fetch lyrics only from Lyriki, do not prompt to submit missing lyrics|ruby <wikilyrics.rb FULL PATH> -a ARTIST -t TITLE --sites Lyriki}}
                                    An empty list will cause no dialog to be shown and lyrics to be dumped to
 
                                    stdout (defaults to qt,gtk,tk).
 
  
                                    NOTE: it is extremely recommended to specify only one toolkit (the one that
+
:'''NOTE''': these are only suggestions; you can customize this to do whatever you like (read the [[{{FULLPAGENAME}}#Command Line Interface Options|section on command line interface options]] to find out what each switch does).
                                          will be used). This will reduce the time taken to display the lyrics
 
                                          by a few seconds (for every song!).
 
</pre>
 
  
== Appendix B: Screenshots ==
 
No, seriously... it works:
 
  
* Lyriki-Lyrics running from Winamp (GTK toolkit)
+
Unfortunately the plugin doesn't provide song metadata such as artist, title, album or year as variables, so they have to be parsed from the "song name" (%n) using regular expressions. To make it worst, the "song name" value depends on the title display format option (found on the playlist page). The following expressions can be used to extract the ARTIST and TITLE information from the most common display names:
[[Image:Lyriki_rb_On_Windows_(gtk).png|Lyriki-Lyrics running from Winamp (GTK toolkit)]]
 
* Lyriki-Lyrics running from Winamp (Tk toolkit)
 
[[Image:Lyriki_rb_On_Windows_(tk).png|Lyriki-Lyrics running from Winamp (Tk toolkit)|800px]]
 
  
== Appendix C: Old instructions ==
+
{{code box|ARTIST - TITLE|<nowiki>ARTIST: $(echo "%n" | sed -ne 's/ - .*$//p' | sed -e 's/ /_/g')
 +
TITLE:  $(echo "%n" | sed -ne 's/^.* - //p' | sed -e 's/ /_/g')</nowiki>}}
  
These steps are more accurate in regards to AMIP settings and what the Lyriki.bat file needs to contain.
+
= Command Line Interface Options =
 +
<pre>Usage: wikilyrics.rb [OPTIONS]
 +
Fetch lyrics from various sites and/or submit lyrics to Lyriki and LyricWiki.
  
:'''Method 1:  Tcl/TK'''
+
Options:
 +
    -a, --artist [ARTIST]            Song artist (mandatory unless batch-file specified).
 +
    -t, --title [TITLE]              Song title (mandatory unless batch-file specified).
 +
    -l, --album [ALBUM]              Song album.
 +
    -y, --year [YEAR]                Song album year.
 +
    -f, --[no-]featfix              Fix artist/title when the later has "feat. ARTIST" (true by
 +
                                    default).
  
# [http://rubyforge.org/frs/?group_id=167 Install] Ruby.
+
    -b, --batch-file [FILE]         Batch process file (expects artist;title;album;year entries in
# Download and install ActiveTcl.
+
                                    each line).
# [http://www.kde-apps.org/content/show.php?content=35151 Download] and extract the Lyriki Amarok script to an empty folder on your computer. Recommended: C:\Lyriki\
 
# [http://amip.tools-for.net/wiki/ Install] AMIP for the media player you're using.
 
# Configure AMIP's Output string & preset to a line similar to the following.<br><pre>/exec:(d:\lyriki\lyriki.rb) -u username -p password -a "%1" -t "%2" -l "%4" -y "%5" -m -s</pre>
 
# Play a song and wait (up to 20ish), if nothing happens, you -may- need to copy the tcl lib directory to the root of the drive you have Lyriki's plugin installed to.
 
  
:'''Method 2: Ruby/GTK'''
+
    -c, --[no-]cleanup              Cleanup fetched lyrics (true by default).
  
# [http://rubyforge.org/frs/?group_id=167 Install] Ruby.
+
        --sites [SITE1,SITE2...]     Sites to search lyrics for, order included (Lyriki,LyricWiki by
# [http://prdownloads.sourceforge.net/ruby-gnome2/ruby-gtk2-0.14.1-1-i386-msvcrt-1.zip?download Install] Ruby/GTK Bindings.
+
                                    default; see sites-list).
# [http://gladewin32.sourceforge.net/ Install] the GTK runtime libraries from Glade for Windows.
+
        --sites-list                List available sites.
# [http://amip.tools-for.net/wiki/ Install] AMIP for the media player you're using.
 
# Create a lyriki.bat file in a text editor with the following line. <br><pre>ruby.exe -Ce:\media\lyriki lyriki.rb -u username -p password -a %1 -t %2 -l %3 -y %4 -m -s</pre>
 
# Configure AMIPs Output String & Preset to: <br><pre>/exec:(C:\PathTo\lyriki.bat) "%1" "%2" "%4" "%5"</pre>
 
# Play a song to test, if nothing happens (wait up to 20 seconds), you -may- need to copy the tcl lib directory to the root of the drive you have Lyriki's plugin installed to.
 
  
== Differences ==
+
    -s, --submit [Lyriki|LyricWiki]  Wiki site to submit content to (needs username and password).
 +
    -u, --username [USERNAME]        Username to login with (mandatory when submit specified).
 +
    -p, --password [PASSWORD]        Password to login with (mandatory when submit specified).
 +
        --persist [SESSIONFILE]      Restore/save session from/to file (needs username and password).
 +
    -r, --[no-]review                Prompt for review before submitting content (true by default,
 +
                                    needs submit).
 +
    -g, --[no-]autogen              Prompt for review of autogenerated pages (false by default,
 +
                                    needs review).
 +
    -n, --[no-]new                  Prompt for submission even when no lyrics to submit where found
 +
                                    (false by default, needs review).
  
The main difference between the two is that the Ruby/GTK version requires AMIP to call a batch file to call Ruby to call Lyriki.  It's a little convoluted, but, it seems to call the script faster and more reliably.  It also has a much prettier interface than the Tcl/TK version.
+
    -x, --proxy [PROXY]              Proxy server URL.
  
Note again, neither of these methods are supported, these steps worked for me, if they don't work for you, there's something different about your system that I can't possible diagnose, fiddle with it, try calling Lyriki from a cmd.com command line and seeing what errors and possible clues it may give you to why the script is failing, do this both from inside the directory lyriki's installed in and outside.
+
    -k, --toolkits [TK1,TK2...]      GUI toolkits priority. Loading falls back to the next toolkit
 +
                                    when one fails; an empty list will cause no dialog to be shown
 +
                                    and lyrics to be dumped to stdout (defaults to qt3,qt4,gtk,tk).
  
If you find this info useful and you manage to get it working, please let me know, if you have problems and find solutions for them, feel free to post to expand this a little bit.
+
    -h, --help                      Show this message and exit.
 +
    -v, --version                    Show version and exit.
 +
</pre>

Latest revision as of 07:33, 2 March 2012

Wiki-Lyrics is a set of Ruby classes and scripts to interface with various lyrics sites and submit content to Lyriki and LyricWiki, both wikis for lyrics. Wiki-Lyrics can be downloaded from KDE-Apps.

Currently only 2 interfaces exists: an Amarok script and a standalone command line interface. However, the command line interface can be used from Winamp and other Windows players with the help of AMIP plugins, and directly from other Linux players such as Audacious.

Supported Sites

Submitting Policy

  • Always keep your version of the script updated. This ensures submitted content follows the current site guides and reduces the damage to the site caused by bugs in the script or plain obsolesce of the plugins (the parts of it that parse the content of the supported sites --content which is eventually submitted by the script).
  • Properly tag your files, specially if you submit content without reviewing it. You are responsible for the pages the script submits in your behalf.
  • Check your talk page from time to time for any problems someone might have spotted with the script. Update notices and wrongly tagged files warnings will be placed there if necessary.
  • You are free to modify and use the script under the terms of the GPL. However if you use a modified version to submit content, you should also change the way the script identifies its submissions (this helps in identifying sources of problems). Translated, do not impersonate Wiki-Lyrics script. This particularly applies to any mod bypassing the login restriction to submit content. Failure to comply will result in warnings, followed by bans in case of reiteration.

Using Wiki-Lyrics on Windows

This guide intends to explain all steps necesaries to get the script working on Windows. Feel free to expand it if you manage to get it working by tweaking something not explained here. If you're having problems following any of the steps, don't hesitate to ask on the talk page, we'll try to give you an answer.

Install Ruby

Download and install the latest version of the Ruby One-Click-Installer for Windows from RubyForge.

Install a GUI Toolkit

At least one of the supported GUI toolkits is needed to actually see the lyrics. Currently, the Qt4, GTK+ and Tk GUI back-ends are supported on Windows.

Install QtRuby

TODO

Install Ruby/GTK

Download and install the GTK runtime libraries from Glade for Windows.

Download the Ruby/GTK Bindings for Windows. To install them decompress the zip contents in a folder and run the following command from a shell prompt:

C:\ruby-gtk2-0.16.0-1-i386-msvcrt-1.8> ruby.exe install.rb

Install Tcl/Tk

Download and install ActiveTcl from the ActiveState site.

Install Wiki-Lyrics Script

Download and extract the Wiki-Lyrics script to an empty folder on your computer, such as "C:\WikiLyrics" or "C:\Program Files\WikiLyrics".

Install and Configure AMIP

Install AMIP for the media player you're using.

Configure AMIP's "output string & preset" to be one of the suggested settings (explained below) and make sure the script is enabled (if that's configurable). To use Wiki-Lyrics script AMIP has to be instructed to call wikilyrics.bat, located on the win folder.

Fetch lyrics from Lyriki and LyricWiki, prompt to submit missing lyrics to Lyriki
/exec:(<wikilyrics.bat FULL PATH>) -a "%1" -t "%2" -s Lyriki -u USERNAME -p PASSWORD --persist session
Fetch lyrics from Lyriki and LyricWiki, prompt to submit missing lyrics to Lyriki and review autogenerated pages
/exec:(<wikilyrics.bat FULL PATH>) -a "%1" -t "%2" -s Lyriki -u USERNAME -p PASSWORD --persist session -g
Fetch lyrics from Lyriki and LyricWiki, do not prompt to submit missing lyrics
/exec:(<wikilyrics.bat FULL PATH>) -a "%1" -t "%2"
Fetch lyrics only from Lyriki, do not prompt to submit missing lyrics
/exec:(<wikilyrics.bat FULL PATH>) -a "%1" -t "%2" --sites Lyriki
NOTE: these are only suggestions; you can customize AMIP's "output string & preset" option to your liking (read the section on command line interface options to find out what each switch does).

Try It Out

Play a song to test it, if everything goes well you should see a dialog popup with the lyrics for the playing song (it should take from 5 to 20 seconds, depending on the song and your settings). If nothing happens it might be one of the following reasons:

  1. The lyrics were not found: how likely this is depends on AMIP's "output string & preset" option and on the song playing. To rule this out try with other songs and, if it's not the case already, change AMIP's "output string & preset" option to search the lyrics on other sites as well (remove the --no-meta switch).
  2. There is a problem with the GTK or Ruby/GTK instalation: there seems to be an incompatibility between the iconv version installed with Ruby and the one needed by GTK. Try executing the file gtk_fix.bat found on the win directory.
  3. There is a problem with the Tcl/Tk instalation: you may need to copy the tcl lib directory to the root of the drive you have Lyriki's plugin installed to.

Screenshots

No, seriously... it works:

  • Wiki-Lyrics running from Winamp (GTK toolkit)

Lyriki-Lyrics running from Winamp (GTK toolkit)

  • Wiki-Lyrics running from Winamp (Tk toolkit)

Lyriki-Lyrics running from Winamp (Tk toolkit)

Using Wiki-Lyrics with Audacious

To use the script with Audacious you have to enable the Song Change plugin and configure it to call cli/wikilyrics.rb when a new song starts.

Install Wiki-Lyrics Script

Download and extract the Wiki-Lyrics script.

Configure the Song Change Plugin

Make sure the plugin is enabled (it's on the General plugins section) and configure the "command to run when audacious starts a new song" to call wikilyrics.rb, located under the "cli" directory. Let's see some examples:

Fetch lyrics from Lyriki and LyricWiki, prompt to submit missing lyrics to Lyriki
ruby <wikilyrics.rb FULL PATH> -a ARTIST -t TITLE -s Lyriki -u USERNAME -p PASSWORD --persist session
Fetch lyrics from Lyriki and LyricWiki, prompt to submit missing lyrics to Lyriki and review autogenerated pages
ruby <wikilyrics.rb FULL PATH> -a ARTIST -t TITLE -s Lyriki -u USERNAME -p PASSWORD --persist session -g
Fetch lyrics from Lyriki and LyricWiki, do not prompt to submit missing lyrics
ruby <wikilyrics.rb FULL PATH> -a ARTIST -t TITLE
Fetch lyrics only from Lyriki, do not prompt to submit missing lyrics
ruby <wikilyrics.rb FULL PATH> -a ARTIST -t TITLE --sites Lyriki
NOTE: these are only suggestions; you can customize this to do whatever you like (read the section on command line interface options to find out what each switch does).


Unfortunately the plugin doesn't provide song metadata such as artist, title, album or year as variables, so they have to be parsed from the "song name" (%n) using regular expressions. To make it worst, the "song name" value depends on the title display format option (found on the playlist page). The following expressions can be used to extract the ARTIST and TITLE information from the most common display names:

ARTIST - TITLE
ARTIST: $(echo "%n" | sed -ne 's/ - .*$//p' | sed -e 's/ /_/g') TITLE: $(echo "%n" | sed -ne 's/^.* - //p' | sed -e 's/ /_/g')

Command Line Interface Options

Usage: wikilyrics.rb [OPTIONS]
Fetch lyrics from various sites and/or submit lyrics to Lyriki and LyricWiki.

Options:
    -a, --artist [ARTIST]            Song artist (mandatory unless batch-file specified).
    -t, --title [TITLE]              Song title (mandatory unless batch-file specified).
    -l, --album [ALBUM]              Song album.
    -y, --year [YEAR]                Song album year.
    -f, --[no-]featfix               Fix artist/title when the later has "feat. ARTIST" (true by
                                     default).

    -b, --batch-file [FILE]          Batch process file (expects artist;title;album;year entries in
                                     each line).

    -c, --[no-]cleanup               Cleanup fetched lyrics (true by default).

        --sites [SITE1,SITE2...]     Sites to search lyrics for, order included (Lyriki,LyricWiki by
                                     default; see sites-list).
        --sites-list                 List available sites.

    -s, --submit [Lyriki|LyricWiki]  Wiki site to submit content to (needs username and password).
    -u, --username [USERNAME]        Username to login with (mandatory when submit specified).
    -p, --password [PASSWORD]        Password to login with (mandatory when submit specified).
        --persist [SESSIONFILE]      Restore/save session from/to file (needs username and password).
    -r, --[no-]review                Prompt for review before submitting content (true by default,
                                     needs submit).
    -g, --[no-]autogen               Prompt for review of autogenerated pages (false by default,
                                     needs review).
    -n, --[no-]new                   Prompt for submission even when no lyrics to submit where found
                                     (false by default, needs review).

    -x, --proxy [PROXY]              Proxy server URL.

    -k, --toolkits [TK1,TK2...]      GUI toolkits priority. Loading falls back to the next toolkit
                                     when one fails; an empty list will cause no dialog to be shown
                                     and lyrics to be dumped to stdout (defaults to qt3,qt4,gtk,tk).

    -h, --help                       Show this message and exit.
    -v, --version                    Show version and exit.