• 1(current)
  • 2
  • 3
  • 4
  • 5
  • 24
  Thread Closed
[RELEASE] xbmclyrics script - automatically grabs lyrics online
Thumbs Up 
xbmclyrics is a script which will grab lyrics from http://www.lyrc.com.ar for the song you are currently playing. it is not a final release, but as i am going away for some days i decided to release it now. there are a lot of bugs i am sure, please report them.

there is one feature that is planned, but i haven't got it done yet. this is automatic updating of lyrics as song changes. i will add that later. the script looks best with pm1 or pm2 as it uses chokemaniac's panel as base (thanks cm). for easy access i suggest either adding it to the submenu or mapping it to a button using keymap.xml (this is possible, right? Wink)

not much more left to say then i guess, i hope you find some use in it. enjoy!

xbmcscripts.com administrator

first of all, great script! i can see this is gonna be a good one, but for now i have found a couple of bugs...

1) the panel doesn't show up. this means it just overlays on the current screen, which can make it difficult to read.

2) it doesn't size correctly for my ntsc tv. i guess it was sized for pal? is there a way to make it automatically resize?

3) if the song lyrics don't exist on the website, it will display the lyrics of a different song by the same artist. i checked the website and it does it too. i don't know if you could fix that in the script somehow?

other that that, this seems to be a great script! well done!
ok, referring to point (1) above, i found the problem. i was running the script from a subdirectory in the scripts folder, but the script looks for the image in the scripts folder only. i edited the script to reflect the change and it works fine now. is there a way to make this automatic?
ok, me again.

referring to point (2) above, i have been fiddling about with the settings for my ntsc tv. i have found some good sizes for ntsc. if you have an ntsc tv, change :

Quote:self.addcontrol(xbmcgui.controlimage(158,25,520,500, 'q:\\scripts\\lyricspanel.png'))

self.textbox = xbmcgui.controltextbox(190,130,400,350, 'font14', '0xffffffff')

self.fadelabel = xbmcgui.controlfadelabel(270,95,255,25, 'font14','0xffffffff')


Quote: self.addcontrol(xbmcgui.controlimage(158,20,520,420, 'q:\\scripts\\xbmclyrics\\lyricspanel.png'))

self.textbox = xbmcgui.controltextbox(190,110,400,290, 'font14', '0xffffffff')

self.fadelabel = xbmcgui.controlfadelabel(270,75,255,15, 'font14','0xffffffff')

it should fit much better! Smile
this is mint well done :bowdown:
hi ! i did not test your script yet ...
anyway, i changed a couple os things to make it instalable anywhere :
add :
Quote:import os
on a new line where you can see other import

add :
Quote: self.home=os.getcwd()[:-1]+'\\'
on a new line just after def in the overlay class

replace the line (a couple of lines after) :
Quote: self.addcontrol(xbmcgui.controlimage(158,25,520,500, 'q:\\scripts\\lyricspanel.png'))
with :
Quote: self.addcontrol(xbmcgui.controlimage(158,25,520,500, self.home+'lyricspanel.png'))

as for the autosize to fit any screen, it is easy to do, but a bit longer... i will do it if none of you made it before.
(tomkun @ feb. 26 2005,03:11 Wrote:2) it doesn't size correctly for my ntsc tv.  i guess it was sized for pal?  is there a way to make it automatically resize?

3) if the song lyrics don't exist on the website, it will display the lyrics of a different song by the same artist.  i checked the website and it does it too.  i don't know if you could fix that in the script somehow?

other that that, this seems to be a great script!  well done!

i am not too sure on how i would implement that. i could put in an "if" check on the resolution, but that's perhaps not the best implementation (by far the easiest though, so i might go with that).


this isn't really something i can do anything about. i might expand the script to work with different sites later, but as it is now it pretty much works just like lyrc.com.ar. if that site gives a wrong, so does the script. lyrc.com.ar has a pretty bad search engine, so it gives wrong quite often if it can't find the actual song.

i will update the script soon (a day or two) with the location fix (thanks solexalex) and probably a size fix.
xbmcscripts.com administrator
to make your script fit any screen size, try this tricks :
1- get the screensize :
2- you know that you made the skin in your own format (i guess it is pal format so 720x540 ; ntsc is 720x480). so the sizes you gave in your script are for pal screen.
just calculate a 'ratio' between your screen size and any other size : (your size is the reference)
3- now you'll have to tell all objects, taht x;y positions and w/h size have to be modified with the ratio. don't forget to say the result should be integer
examples :
atio*500), self.home+'lyricspanel.png'))
self.fadelabel = xbmcgui.controlfadelabel(int(xratio*270),int(yratio*95),int(xratio*255),int(yratio*25), 'font14','0xffffffff')
notice that xratio apply to x position and width
yratio apply to y positions and height

maybe sometimes, you'll prefer to make a position 'fixed' so play a bit wether you should use ratio for a value or not !

i hope this can be understandable...(i.e can you understand what i'm trying to explain Smile )
link has expired. Sad
can it be added to the scriptrunner?
if you want scripts added inside scriptrunner, you have to request the creator of this script : threezee
did a little work on the script today, trying to add support for auto-update of lyrics. however, it seems that xbmc crashes when you call getmusicinfotag() more than once. the weirdest part is that sometimes you can exit the script, and it won't crash until you start a new song. i could be doing something wrong, but i'd have no idea why. anyone else experienced problems using this?

the other things mentioned in this thread will come shortly..
xbmcscripts.com administrator
i've used this script a lot and i have never had it crash yet. even if i play two or more songs in a row and look up the lyrics for all of them. i have to say, i am loving this script! i hope you can get everything working that you want.
well, it could be bad coding on my part. this is the function in a class spawned by threading.thread:

Quote:    def run(self):
       artist_name = ""
       title_name = ""
       tag = self.overlay.get_player().getmusicinfotag()
       while (self.running):
           if tag.gettitle() != title_name:
               artist_name = tag.getartist()
               title_name = tag.gettitle()
               self.overlay.lyrics(artist_name, title_name)

any suggestions?

self.overlay.get_player() returns xbmc.player() from the other class (overlay).
xbmcscripts.com administrator
ok, i have added the two things as "promised". i have a feeling that it won't look correct on a ntsc tv though, but as i have got none to test with it's rather hard to adjust. if you find correct values. please report and i'll of course fix it...

i have got a new server, so hopefully no downtimes anymore:

xbmcscripts.com administrator
  • 1(current)
  • 2
  • 3
  • 4
  • 5
  • 24
  Thread Closed
Thread Rating:
  • 1 Vote(s) - 5 Average

Logout Mark Read Team Forum Stats Members Help
[RELEASE] xbmclyrics script - automatically grabs lyrics online51