Help:Wiki-Lyrics Script

From Lyriki
Revision as of 09:13, 8 November 2006 by Nanenj (talk | contribs) (Changed 'warning' about directions until they can be tested.)
Jump to navigation Jump to search

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 talk page, we'll try to give you an answer.

Install Ruby

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

Choose 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.

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.

Installing 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.15.0-1-i386-msvcrt-1.8> ruby.exe install.rb

Installing Tcl/TK

Download and install ActiveTcl from the ActiveState site.

Install Lyriki-Lyrics Script

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

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 (is that's configurable).

This set of directions may need verification that it works as listed. With both the Tcl/TK and GTK toolkits. If thise fails, there is a set of directions at the very bottom that are proven to work. Some have had issues with direct calling of Lyriki, so the GTK method at the bottom is definately the most recommended should these directions not work.

a. Fetch lyrics from Lyriki and other sites, prompt to submit missing lyrics:
/exec:(<full path to lyriki.bat>) -a "%1" -t "%2" -l "%4" -y "%5" -s -u <user> -p <pass> --persist session
b. Fetch lyrics from Lyriki and other sites, prompt to submit missing lyrics and review autogenerated pages:
/exec:(<full path to lyriki.bat>) -a "%1" -t "%2" -l "%4" -y "%5" -s -u <user> -p <pass> --persist session -g 
c. Fetch lyrics from Lyriki and other sites, do not prompt to submit missing lyrics:
/exec:(<full path to lyriki.bat>) -a "%1" -t "%2" -l "%4" -y "%5"
d. Fetch lyrics only from Lyriki, do not prompt to submit missing lyrics:
/exec:(<full path to lyriki.bat>) -a "%1" -t "%2" -l "%4" -y "%5" --no-meta
NOTE: these are only suggestions; you can customize AMIP's "output string & preset" option to do whatever you like (read the appendix on lyriki.bat 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 provided with the Lyriki script.
  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.

Appendix A: lyriki.bat options

Usage: lyriki.bat [OPTIONS]

Options:
    -a, --artist [ARTIST]            Song artist (mandatory).
    -t, --title [TITLE]              Song title (mandatory).
    -l, --album [ALBUM]              Song album.
    -y, --year [YEAR]                Song album year.

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

    -m, --[no-]meta                  Search missing lyrics in other sites (true by default).
        --meta-sites [S1,S2...]      Specify sites to query for missing lyrics, order included (defaults to all
                                     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).
    -u, --user [USERNAME]            Username to login with (mandatory when -s specified).
    -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.
                                           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).
    -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).

    -k, --toolkits [gtk,tk]          Specify UI toolkit priority (falling back to the next one when loading fails).
                                     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
                                           will be used). This will reduce the time taken to display the lyrics
                                           by a few seconds (for every song!).

Appendix B: Screenshots

No, seriously... it works:

  • Lyriki-Lyrics running from Winamp (GTK toolkit)

Lyriki-Lyrics running from Winamp (GTK toolkit)

  • Lyriki-Lyrics running from Winamp (Tk toolkit)

Lyriki-Lyrics running from Winamp (Tk toolkit)

Appendix C: Old instructions

These steps are more accurate in regards to AMIP settings and what the Lyriki.bat file needs to contain.

Method 1: Tcl/TK
  1. Install Ruby.
  2. Download and install ActiveTcl.
  3. Download and extract the Lyriki Amarok script to an empty folder on your computer. Recommended: C:\Lyriki\
  4. Install AMIP for the media player you're using.
  5. Configure AMIP's Output string & preset to a line similar to the following.
    /exec:(d:\lyriki\lyriki.rb) -u username -p password -a "%1" -t "%2" -l "%4" -y "%5" -m -s
  6. 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
  1. Install Ruby.
  2. Install Ruby/GTK Bindings.
  3. Install the GTK runtime libraries from Glade for Windows.
  4. Install AMIP for the media player you're using.
  5. Create a lyriki.bat file in a text editor with the following line.
    ruby.exe -Ce:\media\lyriki lyriki.rb -u username -p password -a %1 -t %2 -l %3 -y %4 -m -s
  6. Configure AMIPs Output String & Preset to:
    /exec:(C:\PathTo\lyriki.bat) "%1" "%2" "%4" "%5"
  7. 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

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.

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.

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.