
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
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.
13 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.
13 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
11 years ago
"
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
11 years ago
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
13 years ago
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
13 years ago
Example: http://lyricwiki.org/Wise_Guys:K
Report
stifi
13 years ago
Report
thmwarp
13 years ago
..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
12 years ago
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
12 years ago
Report
Rouge8
14 years ago
/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
14 years ago
Report
dennismdk
14 years ago
Report
Rede
14 years ago
Report
Rouge8
14 years ago
/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
Rede
14 years ago
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
UncleOwen
14 years ago
--- 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
14 years ago
Report
Eleniel
14 years ago
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
14 years ago
sudo apt-get install libqt0-ruby1.8
Report
Eleniel
14 years ago
Report
Rede
14 years ago
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
14 years ago
Report
Eleniel
14 years ago
Report
haeber
14 years ago
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
14 years ago
Report
Rede
14 years ago
Report