Image 01


Manuel Fernandez
hi... i've been having some issues lately with the lyrics, they were retrieved with some weird ASCII encryption or something... anyway i've inserted a little function to clean up that issue and to erase the "Send the song to your cell" lines... anyway here's the function:

def cleanLyric(lyric):
resp = lyric.lstrip()
if resp.startswith('Send'):
cell = resp.find('Cell')
end = resp.find('<!--')
if cell > 0:
start = cell + 4
resp = resp[start:end]
for i in range(32, 255):
num = '%i'%(i)
rep = '&#'+num+';'
resp = resp.replace( rep, chr(i))
return resp
and i call it like this in line 635:
text = cleanLyric(text)

...hope this helps anyone - Nov 04 2009