
PLEASE COMMENT IF YOU VOTE BAD! Also, this script is in beta so all comments are appreciated.
A new experimental pre-beta5 is out, unfortunately I don't have a copy of amarok 1.x at my disposal at the moment but I figured the community really needed this update. I hope it works. If this works it should fix the most complained about bugs (specifically encoding bugs). Major thanks goes out to grindi who has contributed much code for this release. I cannot thank you enough, I did nothing but struggle with character set issues.
Ratings & Comments
46 Comments
Hi all, the distribution site for this plugin and its mercurial repo both seem to be dead. Could somebody host their copy?
There's a mirror on http://rs94.rapidshare.com/files/111595656/googlyrics-0.2.2.amarokscript.tar.bz2
Hi, great and well working project, I have used for a certain period this program, but after some months without updating, I have a little issue: sometimes the html structure of sites changes and the regex for a site is no longer valid. To avoid problems of this kind, I've write this script that is part of lrcShow-X (under GPL) you could take a look at it. Basically, it searches on google like yours, removes the obvious wrong sites like youtube, yahoo and others. Get the others links and, in order, tries to parse the page stripping some tags, and splitting into different parts the code, and taking the longest of these. Checks for obvious wrong massages (like "lyrics cannot be displayed due to copyright licences" and so on). If the extracted lyrics could be valid returns it, otherwise skip to the next google link. You can find the code at http://www.sanfanling.cn/svn/lrcShow-X/branches/outlikeashoe/lrcShow-X/engines/plain_lyrics.py . Hope this helps.
Beta4 sometimes the script crashes, when the song/band name contains a öäüÖÄÜ character. /usr/lib/python2.6/urllib.py:1216: UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal res = map(safe_map.__getitem__, s) Traceback (most recent call last): File "/home/souplin/.kde/share/apps/amarok/scripts/Googlyrics2/Googlyrics2.py", line 50, in <module> a.run() File "/home/fidol/.kde/share/apps/amarok/scripts/Googlyrics2/Googlyrics2.py", line 45, in run doctxt = doc.toxml() File "/usr/lib/python2.6/xml/dom/minidom.py", line 45, in toxml return self.toprettyxml("", "", encoding) File "/usr/lib/python2.6/xml/dom/minidom.py", line 60, in toprettyxml return writer.getvalue() File "/usr/lib/python2.6/StringIO.py", line 270, in getvalue self.buf += ''.join(self.buflist) UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
Could you tell me artist and title of the song which results in fail?
For example: Artist: Erste Allgemeine Verunsicherung Title: BaBaBanküberfall or Artist: Erste Allgemeine Verunsicherung Title: Sandlerkönig Eberhard
It's seems that the problem was already solved and will be fixed in the nearest release. If you don't want to wait you can fetch the latest version from repo. First you need install mercurial (something like "sudo apt-get install mercurial" on debian-based systems) and then type in console: After these operations restart amarok.
That worked. Thank you very much!
Hello, Using Opensuse 11.0, with amarok 1.4.10. Two things: - When I install googlyrics2 beta4 from the built in browser of amarok, there are plenty of *.py that are displayed in the "General" section of the installed scripts. When I uninstall googlyrics, they seem to vanish with it. - I had a problem with unusual characters, but it seems you have already a work around. Good job for this app.
I confirm shizzledizzle trick works well.
Amarok2 is actually working here (amd64 gentoo), these are my scripts: 1) lyricserver.py http://pastebin.com/f63d55d4c usage: put in googlyrics folder and run python lyricserver.py [port] , default port is 8801. to test: in a browser insert url: http://localhost:8801/html+_+artist+_+title 2) main.js http://pastebin.com/f5d20b9af script to give to amarok 2 the ability to get lyrics from lyricserver (which must be loaded!!!!)
Great work! Do you mind if I include these in the archive?
ouch, I've seen this just now.. .them are there for you to include at will
changing line 44 of Googlyrics2.py from doc.documentElement.appendChild(doc.createTextNode(saxutils.escape(outlyric.lyrics)) to doc.documentElement.appendChild(doc.createTextNode(saxutils.escape(outlyric.lyrics).encode('UTF-8'))) seems to have fixed the special character issue for me
Thanks, I'll encorporate this and do a release soon.
This workaround work for me, in the Beta4. Thanks
When I initially installed this script, if it could not find the lyrics of a song, it used to crash with a message "unboundlocalerror local variable 'outlyric' referenced before assignment". Looks like this is similar to the bug reported by qacek on Sep 26 2008. Now (approx 2 hours later) if Googlyrics2 beta 3 can't find the lyrics of a song, it displays the last successfully found lyrics. This may be the same bug as reported by StMPA3b on Oct 8 2008.
I've got the whole error message this time. Maybe this can be of more help. Traceback (most recent call last): File "/home/username/.kde/share/apps/amarok/scripts/Googlyrics2/Googlyrics2.py", line 47, in <module> a.run() File "/home/username/.kde/share/apps/amarok/scripts/Googlyrics2/Googlyrics2.py", line 30, in run if outlyric is None: UnboundLocalError: local variable 'outlyric' referenced before assignment
Wonderfull job, I try to test LyricsMania: i have remove all sites from config.ini and i have test only LyricsMania.... it doesn't work.
I have find the error: In file ~/.kde/share/apps/amarok/scripts/Googlyrics2/sites/LyricsMania.py at line 8 replace: </strong> :</br> with: </strong> :<br /> Now LyricsMania work fine Enjoy
Finally, a lyrics plug-in for Amarok that actually works! Thank you. However, I also experienced the non-english results issue, the first two songs as a matter of fact, so here's my I'm-not-a-developer-but-this-simple-solution-seems-like-it-would-be-so-easy two cents worth... I presume the problem (from an english-speaking perspective) is that the plug-in just displays the lyrics of the first search result which is sometimes not an English site. If so, how about a Re-search function that wouldn't return previously presented results? That presumes you track or can easily track either the domains that source the lyric searches or the number of the search result used to retrieve lyrics. That might be a pain to develop but that's all I've got. heh heh There's no guarantee the next result would be in English either but at least users wouldn't be stuck with lyrics they can't read without some form of recourse. Overall, I'm just happy to have a lyrics plug-in that returns results at all and is in English more often than not! Thanks again
For others who are frustrated with the non-English lyricstime.com results, I have a simple work-around. Banish the domain from your machine so it can't receive results from the domain. Add the following to /etc/hosts (on Linux) file... 127.0.0.1 www.lyricstime.com It solved the problem for me.
I just discovered you awesome application and I would like to use it in one of my projects. Is there any way that I can acces the app using the shell, like passing the artist and trackname as program parameters and receiving the result songtext via the standard output?
Will be for Amarok 2 soon?
Well, I actually have a version adapted to amarok2, however is quite "different": amarok devs decided to not expose lyrics/cover mechanism to dbus and to allow scripting only in QtScript language (wich sadly means just javascript), don't ask me why as I was shocked when I discovered this, and still asking myself. My solution was to transform Googlyrics into a little webserver (running in background and accepting connections only from localhost) and to use a really dumb javascript just to retrieve lyrics from this simple webserver. Issue is now how to cache data, as I'm unsure if it's legally allowed to have them exposed into a computer folder. Once I'll have sorted all the issues I'll ask to ultramancool to "upgrade" Googlyrics with my solution (one lyricserver script and one javascript)