Thursday, September 14, 2006

I want my lyrics..

Had some issues with lyrics fetching in Amarok for the last couple of weeks.. Haven't given it a lot of thought, until today - when I actually wanted the lyrics for a track.. (go figure..)
Some hunt it turned out to be..

When clicking the lyrics tab in Amarok, it would bitch about no script would be running.. When attempting to start lyrc - would give me the following error:
      /usr/local/lib/ruby/1.8/net/http.rb:560:in `initialize': Connection refused - connect(2) (Errno::ECONNREFUSED)
from /usr/local/lib/ruby/1.8/net/http.rb:560:in `open'
from /usr/local/lib/ruby/1.8/net/http.rb:560:in `connect'
from /usr/local/lib/ruby/1.8/timeout.rb:48:in `timeout'
from /usr/local/lib/ruby/1.8/timeout.rb:76:in `timeout'
from /usr/local/lib/ruby/1.8/net/http.rb:560:in `connect'
from /usr/local/lib/ruby/1.8/net/http.rb:553:in `do_start'
from /usr/local/lib/ruby/1.8/net/http.rb:542:in `start'
from /usr/local/lib/ruby/1.8/net/http.rb:1032:in `request'
from /usr/local/lib/ruby/1.8/net/http.rb:769:in `get'
from /usr/local/share/apps/amarok/scripts/lyrics_lyrc/lyrics_lyrc.rb:122:in `fetchLyrics'
from /usr/local/share/apps/amarok/scripts/lyrics_lyrc/lyrics_lyrc.rb:187
from /usr/local/share/apps/amarok/scripts/lyrics_lyrc/lyrics_lyrc.rb:172:in `loop'
from /usr/local/share/apps/amarok/scripts/lyrics_lyrc/lyrics_lyrc.rb:172

Basically, how the lyrc script works - it's by looking up a song (title and artist) on www.lyrc.com.ar - and the parsing the lyrics.. (simplified..)
So started out by verifying that I could access the website - which I could.. So it's not a network problem...
Next - check proxy settings.. From #amarok on EfNet, I learned that Amarok gets its proxy settings from the KDE controlpanel.. No proxy settings were specified - as it should be.

Next - I managed to launch the script from Amarok scriptmanager (without actually looking up any lyrics) - and attach truss(1) to the PID - from which I could see that it would trying to connect to localhost on port 8888.... Interesting...
Looking over the lyrics_lyrc.rb source - more specifically the fetchLyrics function - I noticed the following:
    if ( @proxy == nil )
@proxy = `dcop amarok script proxyForProtocol http`
end
Running, the above command - would yield:
http://localhost:8888
Back to KDE control panel and double-check the proxy settings.. still no problems there..
Finally, I did a recursive grep for localhost:8888 in ~/.kde/
Bingo.
The file ~/.kde/share/config/kioslaverc
had ProxyForProtocolHttp="http://localhost:8888"
I have absolutely no idea how it came to be there.. and I don't care.. I removed the file, and restarted Amarok - and voila.. lyrc works again !

Though, now I can't remember which lyrics I was looking for..

8 comments:

bluszcz said...

I had the same problem, and the solution was the same. Weird.

Fabio Varesano said...

same problem here. solved as suggested.

Thanks!

Fabio Varesano

Anonymous said...

Thanks. My lyrics are back.

Anonymous said...

Thanks, works for me!

Anonymous said...

thnx dude... it works 4 me also..

I guess that http://localhost:xxxx
would ve got into way if u had used Proxy Server in Konqueror.
I had the same prob.

Anonymous said...

thanks for the solution, worked for me too. Great !

yogesh said...

Solution worked for me but for fetching wikipedia info about the artist.

Some how it is not working for the lyrics. The very slow internet might be the problem here!

stift said...

Great!
It's january 2008, and it's still the solution to get lyrics back to work.

Thanks!