Kodi Community Forum
[RELEASE] xbmclyrics script - automatically grabs lyrics online - Printable Version

+- Kodi Community Forum (http://forum.kodi.tv)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: Add-ons Help and Support (/forumdisplay.php?fid=27)
+---- Forum: Lyrics Add-ons (/forumdisplay.php?fid=146)
+---- Thread: [RELEASE] xbmclyrics script - automatically grabs lyrics online (/showthread.php?tid=10187)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24


- Talus - 2006-04-26 17:08

the quick and dirty fix worked.

what it does is that it does not wrap the text to the next line if it is too long. so you end up losing the text at the end of long lines of lyrics.

but that is much better than losing an entire line of lyrics due to overlapping Wink

good job! :thumbsup:


- Talus - 2006-04-26 17:16

now this certainly isn't the most elegant fix, but it sure helped.

(keeping in mind that i edited the file as posted above to remove word wrapping)

i changed this line:
Quote: def showcontrols(self):

self.textbox = xbmcgui.controltextbox(int(self.xratio*190),int(self.yratio*130),int(self.xratio​*400),int(self.yratio*350), 'font14', '0xffffffff')
self.addcontrol(self.textbox) # starting in show_text mode

to this:
Quote: def showcontrols(self):

self.textbox = xbmcgui.controltextbox(int(self.xratio*190),int(self.yratio*130),int(self.xratio​*500),int(self.yratio*350), 'font14', '0xffffffff')
self.addcontrol(self.textbox) # starting in show_text mode

...and it made the lines of text wider so that they extended beyond the borders of the on-screen text box graphic. it also results in the page up/down button being outside of the graphic as well. but at least now less text is cut off from long lines of lyrics.

another option would be to leave the text box size alone and shrink the font size..but for some people, it may make the lyrics more difficult to read. but, you can try this instead.

change:
Quote: def showcontrols(self):

self.textbox = xbmcgui.controltextbox(int(self.xratio*190),int(self.yratio*130),int(self.xratio​*400),int(self.yratio*350), 'font14', '0xffffffff')
self.addcontrol(self.textbox) # starting in show_text mode

to:
Quote: def showcontrols(self):

self.textbox = xbmcgui.controltextbox(int(self.xratio*190),int(self.yratio*130),int(self.xratio​*400),int(self.yratio*350), 'font10', '0xffffffff')
self.addcontrol(self.textbox) # starting in show_text mode

..or just change font10 to any font# you want to see if you can find the size that suits you best.


- Talus - 2006-04-29 18:19

well, the latest cvs still doesn't fix this issue even with the new python changes.

i have made a few changes that seem to fix the problem, although the fix involves adding a character to the end of each line...in this case i used '/' as is sometimes used in poetry.

anyway, here is the part that is fixed...it seems to be a great temporary fix...not perfect, but i know diddly about python.

Quote: def parse_lyrics(self, lyrics):
try:
query = re.compile('</font><br>(.*)<p><hr size=1', re.ignorecase | re.dotall)
full_lyrics = re.findall(query, lyrics)
self.final = full_lyrics[0].replace("\r","\\").replace("<br />"," ")
except:
try:
query = re.compile('</font><br>(.*)<br><br><a href="#', re.ignorecase | re.dotall)
full_lyrics = re.findall(query, lyrics)
self.final = full_lyrics[0].replace("\r","\\").replace("<br />"," ")
except:
print lyrics
self.final = "unusual page layout, no parsing built in yet..."
return str(self.final)



- Nuka1195 - 2006-04-29 18:51

thanks for the fixes.

when posting python scripts, some of the code can be messed up. ( eg. def --init--(self): )

it's better if you could post a zip and link to it. there are many free file hosting sites.


- Talus - 2006-04-30 14:23

uploaded here:
http://rapidshare.de/files/19261839/xbmclyrics.zip.html

and please...let me know if it works or not so that i can get confirmation that it is not 'just my system' or if i need to tweak it a bit more.

i used it all day yesterday (it still doesn't make me a better singer Big Grin) and had no problems whatsoever.


- Talus - 2006-04-30 15:00

actually, this bug is affecting all sorts of scripts.

e.g. xmbcmail - the text wrapping in e-mails is all screwed up in the exact same way.

e.g. xbmcscripts - the text wrapping in the script descriptions is overlapping also


- thor918 - 2006-04-30 20:11

hi there. if there is someone that is developing on this script still, please consider to redo the code that detects media change. last time i checked the code. it had a codeloop that where sleeping and checking. there is a much more efficient way to do this.

http://www.xboxmediaplayer.de/cgi-bin....t=20234

Big Grin


- Talus - 2006-05-19 14:30

just to update:

from the cvs
Quote: - 29-04-2006 fixed: [ 1478354 ] python "overlapping of lines"

so no need for these 'fixes' anymore..just update xbmc Big Grin


Is this being developed anymore? - Rudepooch - 2006-07-26 20:47

Just wondering if there is any work going into this anymore... great script but, 2005?

I am trying to update the image to go with my flavor of mc360... anyone interested?


- SleepyP - 2006-07-26 22:09

what do you mean "2005"? the guy just posted not even 2 months ago...
it works just fine for me, and i love it Smile


- Rudepooch - 2006-07-28 03:50

The version at xbmcscripts is dated 2005... Is there a newer one??


XBMCLyrics - guibuilder test - smuto - 2006-08-02 00:15

can sameone take a look?

XBMCLyrics - guibuilder


- Nuka1195 - 2006-08-02 00:28

Very nice smuto. Smile

I like the layout. Nice use of language files also.

The first script using guibuilder. Smile Any options you would like for that let me know. I added a fastMethod option, if True it won't use Includes.xml or References.xml. A slight speed improvement if your skin files don't have any <include> tags and all options are set.


- smuto - 2006-09-17 21:47

Lyrics - skin MC360

[Image: LyricsMC360.jpg]

problem
cover art for next song is not update


- MajorTom - 2006-09-18 11:48

this is great smuto, hope you can work out the problem with the cover art.