Amarok LyricWiki.org Lyrics
Amarok 1.x Scripts
Score 50%
Description:

A simple script to retrieve lyrics from LyricWiki.org and display them on the Lyric tab of the context browser. Now you can enjoy having lyrics that can be fixed when incorrect!

As of v2.0 this script now utilizes the LyricWiki.org SOAP API. In the short term this means more reliable results in a shorter time frame. In the long run (future versions) it means being able to edit, update, or add lyrics and albums to LyricWiki directly from Amarok.

Note: In version 2.0 special characters are not displayed properly. This is a problem with the SOAP service and not a problem in the script.

Requires:
Amarok 1.4
Ruby 1.8
QtRuby (Optional)

Note: Kubuntu users should be able to install QtRuby with the following command:
sudo apt-get install libqt0-ruby1.8

Comments and suggestions are appreciated.
Last changelog:

11 years ago

v2.0
====

* New: LyricWiki.org's SOAP API has been implemented, improving performance and reliability.
* Bugfix: Search results no longer yeild duplicate song entries.
* Bugfix: Script will check bands starting with "The" by switching the order when using SOAP. Ex: "The Used" will also try searching for "Used, The"

v1.2
====

* Bugfix: Suggestions when no exact match is found should now function reliably.
* Bugfix: Following page redirects would sometimes fail due to spaces in song or artist names.
* Bugfix: Search results no longer yeild links to albums.

v1.1
====

* Bugfix: Missing QTRuby is now handled by the error handling.
* Bugfix: Bug in removal of category information may have truncated lyrics.
* Package fix: Script is now tarred as a directory for easier removal/update.

v1.0
====

* New: Error Handling. The script should no longer crash if unable to connect to LyricWiki.org.
* New: LyricWiki's page redirects are now automatically followed.
* New: Attempts to both find lyrics with case of ID3 tag characters unmodified and with the first letters of words capitalized before searching.
* Bugfix: Category information was sometimes displayed with lyrics.
* Bugfix: Empty lines before and after the lyrics are now removed.

See the full changelog in the About dialog found in Amarok's Script Manager.

ultr

8 years ago

Now, when LyricWiki API has been closed, you get this instead of the lyric:

"
Unfortunately, due to licensing restrictions from some of the major music
publishers we can no longer return lyrics through the LyricWiki API (where this
application gets some or all of its lyrics).
[...]
(Please note: this is not the fault of the developer who created this
application, but is a restriction imposed by the music publishers themselves.).
"

However this should be quite easy for the script to simply read the LyricWiki page content to get the song text from it.

Any patches? :)
I don't know Ruby myself :/

Report

ultr

8 years ago

I noticed there already is a legacy function for this :)


To activate it edit lyrics_lyricwiki.rb file, comment out:

# begin
# $getLyricWikiSOAP = SOAP::WSDLDriverFactory.new("http://lyricwiki.org/server.php?wsdl").create_rpc_driver
# rescue
# errormsg = 'Failed to establish a connection with LyricWiki.org SOAP Server. LyricWiki.org is either down or experiencing an problem with their SOAP server. The script will run, but will be less responsive than usual.'
# `dcop amarok playlist popupMessage "#{errormsg}"`
# $useSOAP = false
# rescue Timeout::Error
# errormsg = 'Failed to establish a connection with LyricWiki.org SOAP server. The connection timed out. The script will run, but will be less responsive than usual or may not be able to contact LyricWiki.org at all.'
# `dcop amarok playlist popupMessage "#{errormsg}"`
# $useSOAP = false
# end

and add below:

begin
$useSOAP = false
end


And that's all :)


BTW: FSCK YOU, recording industry! You attack your own customers. And you will pay for that.

Report

richlv

9 years ago

lyrics_lyricwiki.rb:423:in `parseLyrics': undefined method `-' for nil:NilClass (NoMethodError)
from lyrics_lyricwiki.rb:674:in `fetchLyricsLegacy'
from lyrics_lyricwiki.rb:791
from lyrics_lyricwiki.rb:754:in `loop'
from lyrics_lyricwiki.rb:754

removed paths for improved reading.
i'm not sure when this happened, just noticed it after some time.

Report

UncleOwen

10 years ago

2.0 seems to have problems with UTF8. This worked in the version before.

Example: http://lyricwiki.org/Wise_Guys:K

Report

stifi

10 years ago

Same problem here. I am using UTF-8 as locales. When the script fetches Lyrics with non-ASCII characters, they are 'destroyed'. E.g. http://www.lyricwiki.org/Herbert_Grönemeyer:Chaos won't work for me.

Report

thmwarp

9 years ago

Same here...

..but it is only, when the artist or the title of the song contains a german umlaut. If there is no umlaut in title or artist, the umlauts in the lyrik are displayed correct.

Report

ngk-ben

9 years ago

Bug reported on lyricwiki:
Ruby - Bugs : Any character outside of ASCII is returned malformatted

http://lyricwiki.org/LyricWiki:SOAP

I have no Ruby skills but developed a hack

add
l. 19: require 'iconv' #utf8 cast
l. 738: lyrics = Iconv.new('iso-8859-1','utf-8').iconv(lyrics)

in lyrcis_lyricwiki.rb

This will work for german umlauts at least maybe others to

Report

TimoSchmid

9 years ago

works like a charm, thanks.

Report

Rouge8

10 years ago

/home/andy/.kde/share/apps/amarok/scripts/lyrics_lyricwiki/lyrics_lyricwiki.rb:593: warning: don't put space before argument parentheses
/home/andy/.kde/share/apps/amarok/scripts/lyrics_lyricwiki/lyrics_lyricwiki.rb:650: warning: don't put space before argument parentheses
/home/andy/.kde/share/apps/amarok/scripts/lyrics_lyricwiki/lyrics_lyricwiki.rb:663: warning: don't put space before argument parentheses
/home/andy/.kde/share/apps/amarok/scripts/lyrics_lyricwiki/lyrics_lyricwiki.rb:687: warning: don't put space before argument parentheses
/usr/lib/ruby/1.8/timeout.rb:54:in `rbuf_fill': execution expired (Timeout::Error)
from /usr/lib/ruby/1.8/timeout.rb:56:in `timeout'
from /usr/lib/ruby/1.8/timeout.rb:76:in `timeout'
from /usr/lib/ruby/1.8/net/protocol.rb:132:in `rbuf_fill'
from /usr/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'
from /usr/lib/ruby/1.8/net/protocol.rb:126:in `readline'
from /usr/lib/ruby/1.8/net/http.rb:2017:in `read_status_line'
from /usr/lib/ruby/1.8/net/http.rb:2006:in `read_new'
from /usr/lib/ruby/1.8/net/http.rb:1047:in `request'
from /usr/lib/ruby/1.8/net/http.rb:945:in `request_get'
from /usr/lib/ruby/1.8/net/http.rb:375:in `get_response'
from /usr/lib/ruby/1.8/net/http.rb:543:in `start'
from /usr/lib/ruby/1.8/net/http.rb:374:in `get_response'
from /usr/lib/ruby/1.8/net/http.rb:356:in `get'
from /home/andy/.kde/share/apps/amarok/scripts/lyrics_lyricwiki/lyrics_lyricwiki.rb:578:in `fetchLyricsXML'
from /home/andy/.kde/share/apps/amarok/scripts/lyrics_lyricwiki/lyrics_lyricwiki.rb:650
from /home/andy/.kde/share/apps/amarok/scripts/lyrics_lyricwiki/lyrics_lyricwiki.rb:603:in `loop'
from /home/andy/.kde/share/apps/amarok/scripts/lyrics_lyricwiki/lyrics_lyricwiki.rb:603

Report

Rede

10 years ago

Thats a lyricwiki problem. Theyre currently having server load issues that causes the server to not respond to requests.

Report

dennismdk

10 years ago

Is it possible to get the lyric in Amarok viewed in full screen? That could be very nice.

Report

Rede

10 years ago

Not that I know of. You can press the "Open in External Browser" button to view them in the browser though.

Report

Rouge8

10 years ago

/home/andy/.kde/share/apps/amarok/scripts/lyrics_lyricwiki/lyrics_lyricwiki.rb:582: warning: don't put space before argument parentheses
/home/andy/.kde/share/apps/amarok/scripts/lyrics_lyricwiki/lyrics_lyricwiki.rb:640: warning: don't put space before argument parentheses
/home/andy/.kde/share/apps/amarok/scripts/lyrics_lyricwiki/lyrics_lyricwiki.rb:653: warning: don't put space before argument parentheses
/home/andy/.kde/share/apps/amarok/scripts/lyrics_lyricwiki/lyrics_lyricwiki.rb:677: warning: don't put space before argument parentheses
/home/andy/.kde/share/apps/amarok/scripts/lyrics_lyricwiki/lyrics_lyricwiki.rb:473:in `searchLyricWiki': undefined method `+' for nil:NilClass (NoMethodError)
from /home/andy/.kde/share/apps/amarok/scripts/lyrics_lyricwiki/lyrics_lyricwiki.rb:656
from /home/andy/.kde/share/apps/amarok/scripts/lyrics_lyricwiki/lyrics_lyricwiki.rb:592:in `loop'
from /home/andy/.kde/share/apps/amarok/scripts/lyrics_lyricwiki/lyrics_lyricwiki.rb:592

Report

UncleOwen

10 years ago

Same error here. Just to make debugging easier, here's a small patch that fixes the warnings:

--- lyrics_lyricwiki.rb 2006-11-05 18:39:04.000000000 +0100
+++ lyrics_lyricwiki.rb.fixed 2006-11-05 18:33:59.000000000 +0100
@@ -579,7 +579,7 @@
path = '/' + path.slice(0..pathsliceend)

xmlpath = '/index.php?title=Special:Export' + path
- urlsource = fetchLyricsXML (path,proxyEnabled,proxyIP,proxyPort )
+ urlsource = fetchLyricsXML(path,proxyEnabled,proxyIP,proxyPort)
end

return urlsource
@@ -637,7 +637,7 @@
#Retrieve URL Source from http://lyricwiki.org/Artist_Name:Song_Name
path = '/' + artist.gsub( ' ', '_' ) + ':' + title.gsub( ' ', '_' )

- urlsource = fetchLyricsXML (path,proxyEnabled,proxyIP,proxyPort )
+ urlsource = fetchLyricsXML(path,proxyEnabled,proxyIP,proxyPort)

if urlsource == 'error'
`dcop amarok contextbrowser showCurrentTrack`
@@ -650,7 +650,7 @@
#Retrieve URL Source from http://lyricwiki.org/Artist_Name:Song_Name
path = '/' + artist.gsub( ' ', '_' ) + ':' + title.gsub( ' ', '_' )

- urlsource = fetchLyricsXML (path,proxyEnabled,proxyIP,proxyPort )
+ urlsource = fetchLyricsXML(path,proxyEnabled,proxyIP,proxyPort)

if urlsource.index('') == nil
searchLyricWiki( artist, title ) #page doesn't exist, search LyricWiki and display results
@@ -674,7 +674,7 @@
proxyIP = settingsarray[2].strip
proxyPort = settingsarray[3].strip

- urlsource = fetchLyricsXML (path,proxyEnabled,proxyIP,proxyPort )
+ urlsource = fetchLyricsXML(path,proxyEnabled,proxyIP,proxyPort)

if urlsource == 'error'
`dcop amarok contextbrowser showCurrentTrack`

No idea about the real error, though, since I don't know ruby. However, I noticed that lyricswiki.org seems to be very slow today, I've even seen some internal server errors. Maybe that's what's causing the error?

Report

Rouge8

10 years ago

No, I get that error even when the site is fine.

Report

Rede

10 years ago

I believe this is a problem because the format on LyricWiki changed.

I've got an exam to do tomorrow, so I'll investigate further and fix it tomorrow night or the day after.

Sorry for the problems.

Report

Eleniel

11 years ago

Hi,

I decided update to the version 0.8 on Kubuntu Dapper. For it, before, I uninstalled the previous version and installed the library that you mention: libqt0-ruby1.8 , but dont work:

«The script 'LyricWiki' finished with the error code: 1»

Detail says:

«$HOME/.kde/share/apps/amarok/scripts/lyrics_lyricwiki.rb:17:in `require': no such file to load -- Qt (LoadError) from $HOME/.kde/share/apps/amarok/scripts/lyrics_lyricwiki.rb:17»

It means that QtRuby is not installed, really? So, I think that I committed an error, but as?

Report

Rede

11 years ago

In order to make it work, you require QtRuby. To install it in Dapper:

sudo apt-get install libqt0-ruby1.8

Report

Eleniel

10 years ago

Yes, but I have it installed. Stranger, no?

Report

Rede

10 years ago

I really don't know why it isn't working for you. You could probably try installing QtRuby manually (not from .deb) but other than that I'm at a loss.

Have you tried using version 1.1? Version 1.1 SHOULDN'T crash the script (it didn't crash when i uninstalled qtruby and tried it) and should just use the defaults if it isn't finding QtRuby. You won't be able to alter the settings, but you should be able to run the script.

Report

Eleniel

10 years ago

OK, thanks, the new version 1.1 work and is sufficiently for me :)

Report

Eleniel

11 years ago

I love LyricWiki.

Report

haeber

11 years ago

There is a problem with the utf-8 encoding/decoding. line 95:
root.text = lyrics.unpack('C*').pack('U*') #Convert to UTF-8
will destroy already utf-8 encoded chars.

if you only set:
root.text = lyrics
it doesn't destory utf-8 encodings.

Report

haeber

11 years ago

seems to be fixed in version 0.7, thanks.

Report

Rede

11 years ago

That it is. Enjoy!

Report

11 years ago

v2.0
====

* New: LyricWiki.org's SOAP API has been implemented, improving performance and reliability.
* Bugfix: Search results no longer yeild duplicate song entries.
* Bugfix: Script will check bands starting with "The" by switching the order when using SOAP. Ex: "The Used" will also try searching for "Used, The"

v1.2
====

* Bugfix: Suggestions when no exact match is found should now function reliably.
* Bugfix: Following page redirects would sometimes fail due to spaces in song or artist names.
* Bugfix: Search results no longer yeild links to albums.

v1.1
====

* Bugfix: Missing QTRuby is now handled by the error handling.
* Bugfix: Bug in removal of category information may have truncated lyrics.
* Package fix: Script is now tarred as a directory for easier removal/update.

v1.0
====

* New: Error Handling. The script should no longer crash if unable to connect to LyricWiki.org.
* New: LyricWiki's page redirects are now automatically followed.
* New: Attempts to both find lyrics with case of ID3 tag characters unmodified and with the first letters of words capitalized before searching.
* Bugfix: Category information was sometimes displayed with lyrics.
* Bugfix: Empty lines before and after the lyrics are now removed.

See the full changelog in the About dialog found in Amarok's Script Manager.

File (click to download) Version Description Filetype Packagetype License Downloads Date Filesize OCS-Install DL
Details
version
2.0
updated Nov 04 2007
added May 24 2006
downloads today
0
page views today 0