Googlyrics2

Amarok 1.x Scripts

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

3
Score 50.0%
Description:

I wrote Googlyrics when I was getting sick of the low yield on existing lyrics scripts. A long time ago, I discovered a windows application (EvilLyrics) that had an interesting idea: search a search engine for lyrics, then filter them out of the page. Well, after examining pages from several lyric sites I determined they could be extracted quite easily and quite the original Googlyrics, however, I was never happy with the way Googlyrics was programmed, it wasn't modular and would only work with Amarok. Googlyrics2 is a completely modular rewrite in pure python, it's now simple to add in new lyric sites and modify it for other media players. Googlyrics2 is only the Amarok script with plugins for all the lyrics sites from the original googlyrics (and yes, they all work now and will be much easier to update due to built in mass testing features), a seprate application will later be released which will allow Googlyrics2 to work with any media player. Googlyrics2 currently supports 26 different lyrics sites and can be easily added to. Big thanks to the many people who have contributed code for the original Googlyrics and to everyone who sends me nice comments, I love to know I'm appreciated :D. Googlyrics2 now requires nothing more than a default python 2.5 installation, no more complaints on random forums about WWW::Mechanize.

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.
Last changelog:

10 years ago

See homepage.

jnr

10 years ago

Hi all, the distribution site for this plugin and its mercurial repo both seem to be dead. Could somebody host their copy?

Report

bugmenot1234

9 years ago

There's a mirror on http://rs94.rapidshare.com/files/111595656/googlyrics-0.2.2.amarokscript.tar.bz2

Report

outlikeashoe

10 years ago

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.

Report

souplin

10 years ago

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)

Report

grindi

10 years ago

Could you tell me artist and title of the song which results in fail?

Report

LarsF

10 years ago

For example:
Artist:
Erste Allgemeine Verunsicherung
Title:
BaBaBanküberfall

or
Artist:
Erste Allgemeine Verunsicherung
Title:
Sandlerkönig Eberhard

Report

grindi

10 years ago

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:


cd ~/.kde/share/apps/amarok/scripts
mv Googlyrics2{,_old}
hg clone http://hg.limeskull.org/Googlyrics2/


After these operations restart amarok.

Report

LarsF

10 years ago

That worked.

Thank you very much!

Report

Woshee

10 years ago

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.

Report

Woshee

10 years ago

I confirm shizzledizzle trick works well.

Report

mattepiu

10 years ago

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!!!!)

Report

C

ultramancool

10 years ago

Great work! Do you mind if I include these in the archive?

Report

mattepiu

10 years ago

ouch, I've seen this just now.. .them are there for you to include at will

Report

shizzledizzle

10 years ago

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

Report

tosszyx

10 years ago

This workaround work for me, in the Beta4.

Thanks

Report

C

ultramancool

10 years ago

Thanks, I'll encorporate this and do a release soon.

Report

etechnophile

10 years ago

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.

Report

etechnophile

10 years ago

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

Report

V17

10 years ago

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.

Report

V17

10 years ago

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

Report

RgnKjnVA

10 years ago

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

Report

RgnKjnVA

10 years ago

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.

Report

konne88

10 years ago

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?

Report

arkoldthos

10 years ago

Will be for Amarok 2 soon?

Report

mattepiu

10 years ago

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)

Report

10 years ago

See homepage.

12345678910
product-maker Base: 4 x 5.0 Ratings
souplin
Mar 19 2009
etechnophile
Jan 12 2009
jlpino
Dec 24 2008
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs ocs-url or ocs-store to install things
Pling
0 Affiliates
Details
license
version
Beta4
updated May 06 2009
added Aug 09 2008
downloads 24h
0
page views 24h 3
System Tags addon