Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

0
Become a Fan
5.0

Description:
As a Chinese Amarok user, it is impossible to get correct lyrics by default lyrics script.
I wrote this script to deal with the problem, and it get Chinese lyrics from http://mp3.baidu.com (default), as some options, you can fetch lyrics from several other sites now!

>=0.5.0 version supports Traditional Chinese by converting characters.
Last changelog:

06.12.17(0.2.0a):
1.fix a bug that "artist" and "title" show wrong in sidebar under GB locale.
2."fresh button" now is available, click once, lyrics would be refreshed from Baidu, twice would give you options get lyrics form Baidu or Sina or Yahoo(Sina is not stable)

06.12.17(0.2.0b):
1.change key worlds to detect locale
2.kick off sina as an option of getting lyrics
3.add sohu as an option

06.12.20(0.3.0)
1.add two switches in code in order to more automatically
2.add lyricsdot.com as an option for English songs
3.improve the flow of the script
4.some bugs fixed

06.12.25(0.3.1)
1.fix a packing error
2.fix a showing error after clicking the suggestion

07.02.07(0.3.2)
1.http://lyrc.com.ar take the place of lyricsDot as English lyrics search engine
2.enhance the ability of getting English lyrics

07.03.01(0.4.0)
1.improve detecting locale(LC_CTYPE)
2.add Traditional-Chinese lyrics search engine
3.fix a encode bug when fetch English lyrics
4.fix a detecting locale bug

07.03.05(0.4.1)
bug fix version base on 0.4.0

07.08.23(0.5.0)
1.re-structure the script
2.support Traditional Chinese display by converting characters.

07.09.02(0.5.1)
1.fix a bug that occurs after config
2.now kdialog is not necessary, but still recommend
3.script detect locale by itself
4.add some Amarok popup messages

07.10.18(0.5.2)
1.fix a bug that script maybe write scim info into config file
2.fix a bug that script can't convert Simplified Chinese into Traditional Chinese if the lyrics have been modified by hand.
3.now Simplified and Traditional Chinese could convert into each other automatically
4.now English song's lyrics could show ' correctly
5.add internationalization(zh_CN,zh_TW,en_US now are available)

08.03.30(0.5.3)
1.update the rule of fetching baidu's lyrics


Ratings & Comments

37 Comments

grimx

Traceback (most recent call last): File "/root/.kde/share/apps/amarok/scripts/Lyrics_CN/Lyrics_CN", line 16, in <module> gettext.translation('Lyrics_CN',scriptPath+'locale/',languages=[locale.getdefaultlocale()[0]]).install() File "/usr/lib/python2.5/gettext.py", line 480, in translation mofiles = find(domain, localedir, languages, all=1) File "/usr/lib/python2.5/gettext.py", line 437, in find for nelang in _expand_lang(lang): File "/usr/lib/python2.5/gettext.py", line 132, in _expand_lang locale = normalize(locale) File "/usr/lib/python2.5/locale.py", line 298, in normalize fullname = localename.lower() AttributeError: 'NoneType' object has no attribute 'lower' How to fix hmmm ? :p thnx

sanfanling

check the mail. if still can't work, let me know.

ortbit

It works well!

ortbit

It works well !

kennethyeung815

Hi... Just wanted so say thanks for the traditional Chinese support. I'm now running gentoo with zh_HK.utf8 and the scripts works great without any problems.

sanfanling

Hi, welcome. I just say sorry, it too long since last version

feiser

Traceback (most recent call last): File "/home/zyf/.kde/share/apps/amarok/scripts/Lyrics_CN/Lyrics_CN", line 287, in <module> first_run() File "/home/zyf/.kde/share/apps/amarok/scripts/Lyrics_CN/Lyrics_CN", line 249, in first_run lrc_utf8=gb_to_utf8(url) File "/home/zyf/.kde/share/apps/amarok/scripts/Lyrics_CN/Lyrics_CN", line 65, in gb_to_utf8 file=urllib2.urlopen(url) File "/usr/lib/python2.5/urllib2.py", line 121, in urlopen return _opener.open(url, data) File "/usr/lib/python2.5/urllib2.py", line 374, in open response = self._open(req, data) File "/usr/lib/python2.5/urllib2.py", line 392, in _open '_open', req) File "/usr/lib/python2.5/urllib2.py", line 353, in _call_chain result = func(*args) File "/usr/lib/python2.5/urllib2.py", line 1100, in http_open return self.do_open(httplib.HTTPConnection, req) File "/usr/lib/python2.5/urllib2.py", line 1075, in do_open raise URLError(err) urllib2.URLError: <urlopen error (-2, 'Name or service not known')>

sanfanling

Hello, I have this problem too, that is why I can't update this program. This is my post for help http://forums.gentoo.org/viewtopic-t-556507-highlight-.html

sanfanling

Oh my God!! http://hk.music.yahoo.com has redesigned their web, the rule of fetching lyrics of this script now is out of date.

keschan

It's too bad :( But thanks anyway!

keschan

Hi! First I would like to say "thank you" for your effort of writing such a great addon for Amarok - my favorite KDE music app! However I have a little problem... my system locate is zh_TW.Big5, and my music collection have mp3 tag v2.4 in UTF8, when I try to fetch lyrics using Lyrics_CN, I always get "Lyrics for track not found" message... Wondering if you can give me some hints on this problem? Again, thanks for your greate script!

sanfanling

I tested under big5 environment, but not sufficiently. Please give me two information. 1.make sure your amarok is playing, and the track's tag is Traditional Chinese, then type in console "dcop amarok player title" and "dcop amarok player artist", give me the two result. 2.in console type "python", in python-console-mode, type: import locale #return print locale.getdefaultlocale() then give me the result Thanks

keschan

$ dcop amarok player title 在我身邊 $ dcop amarok player artist 李克勤 $ python Python 2.4.3 (#1, Jul 26 2006, 20:13:39) [GCC 3.4.6] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> print locale.getdefaultlocale() ('zh_TW', 'big5') >>> Thanks!!

magisu

I am using en_US.UTF-8 and cannot use your script just because of Amarok says that it do not support the locale. can you deal with it?

sanfanling

Yes. Open the source,and find line 274-281, delete them(include 274 and 281),and add: user_locale=('zh_CN','utf8') or user_locale=('zh_TW','utf8') Just cheat computer :)

magisu

rather, it did not work. then I modified all user_locale[0]=='zh_CN' with 'en_US', still it did not work. I have no python or perl programming experience. well, I suppose you may consider us chinese who prefer english environment. thanks a lot.

sanfanling

No no, just del line 274-281, and replaced by "user_locale=('zh_CN','utf8').It's OK, I tested. not user_locale[0]=xxxxx Otherwise, you can mail me

PeterLim

A KDialog to ask for encodings? Wow... thanks lol. Thanks for improving our chinese Amarok experience I can't wait for the next version XD One more question... i know all of my items on the playlist are encoded fully in unicode only. I've personally seen to that so that i can read it anywhere else. I've a title that was mistakenly taken as a english song. 張學友 - I Don't Wanna Be Is there any way around that? Traceback (most recent call last): File "/home/madpete/.kde/share/apps/amarok/scripts/Lyrics_CN/Lyrics_CN", line 333, in ? (list_url_english,list_artist_english,list_title_english)=suggestions_english(web_english) File "/home/madpete/.kde/share/apps/amarok/scripts/Lyrics_CN/Lyrics_CN", line 147, in suggestions_english suggestions_show+='''<suggestion artist="%s" title="%s" url="%s" />\n''' %(list_artist_english[h],list_title_english[h],list_url_english[h]) IndexError: list index out of range

PeterLim

in addition to that, among the 4 links, (baidu, sohu etc) none of them can find it but i'd try to do it manually. and they were there. It crashed with the error above when i tried to use the one with lyrc.com.ar

sanfanling

I see you are traditional Chinese user, so you have to use hk.music.yahoo to fetch Jacky's song though it's English song. I will fix this error. Of course you can use baidu to fetch lyrics, but baidu returns you Simplified-Chinese lyrics, do you really want even you are a Traditional-Chinese user? To ensure the lyrics you fetch is according with user's locale, I hide the baidu sohu etc engine under zh_TW.* locale.

sanfanling

I know why you can't find lyrics of "I don't wanna be", because in the title have a "'", in English song it's ok.I do not have such song, so I ignored this problem.

PeterLim

I've limited capabilities to type in chinese, a lot of my songs are a mix of traditional and simplified chinese that i've gotten from online sources. My system locale itself is english. Everything in there is in unicode since my other players(with different system locales) can read it. I've edited the script to skip the check for user_locale. Although I can read both traditional and simplified, I feel more comfortable with the simplified one. so the problem is due to the "apostrophe" character? hmmm... will renaming the title work for it?

sanfanling

I remember, you had left a comment on my blog, :) you can read the source,14 and 15 lines,I did not consider this problem about chinese songs have " ' " in title, so 15 line is "pass", infact after+='%27' is better, then it could find the right url. I have tried, but have difficult in show lyrics because of complex colons matching, maybe use xml is better. Maybe next version I will add Simplified search engine under Traditional locale and add a line by line lrc show module or 0.4.1 is final

PeterLim

Sorry for this late reply xP I've tried using after+=%27, at least it doesn't crash now. But it's not retrieving the lyrics as it should... baidu returns something like server is not reachable. Might try it out later on again. Thanks for everything XD

sanfanling

A mistake was found in this version(0.4.0), I will fix it as soon as possible.

Pling
0 Affiliates
Details
license
version 0.5.3
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 1

More Amarok 1.x Scripts from sanfanling:

lrcShow-II
sanfanling
last update date: 16 years ago

Score 5.0

Other Amarok 1.x Scripts:

Gnome Play Video in Totem
mwheatland
last update date: 19 years ago

Score 5.0

editLyrics-gnome
ZeeD
last update date: 19 years ago

Score 5.0

amarok Alarm
aroth
last update date: 16 years ago

Score 5.0

amaroK Web Collection V xmms
pti-jean
last update date: 16 years ago

Score 5.0

SongLogger
lucatnt
last update date: 17 years ago

Score 5.0

amaroK Web Collection
pti-jean
last update date: 16 years ago

Score 5.0



System Tags