Sorry again for double posting..
And never mind, hitchhiker, I got it working
I just scanned a little the libraries of python and there I found how to do this, here's the working script:
# -*- coding: utf-8 -*-
import encodings.utf_8
import urllib
import urllib2
from xml.dom import minidom
from grabber import LyricProviderBase
class LyricsPlugin(LyricProviderBase):
def GetName(self):
return "Lyrics Plugin"
def GetVersion(self):
return "1"
def GetURL(self):
return "http://www.lyricsplugin.com"
def GetAuthor(self):
return "Hitchhiker427 + Qudeid"
def Query(self, handles, status, abort):
result = []
for handle in handles:
status.Advance()
if abort.Aborting():
return result
artist = handle.Format("[%artist%]")
title = handle.Format("[%title%]")
try:
req = urllib2.Request("http://www.lyricsplugin.com/winamp03/plugin/content.php?artist=%s&title=%s" % (urllib.quote(artist), urllib.quote(title)))
req.add_header('Referer', "http://www.lyricsplugin.com/winamp03/plugin/?artist=%s&title=%s" % (urllib.quote(artist), urllib.quote(title)))
string = urllib2.urlopen(req).read()
start = string.find("<div id=\"lyrics\">") + 18
end = string.find("</div>", start)
lyric = string[start:end].replace("<br />","")
result.append(lyric)
except Exception, e:
traceback.print_exc(file=sys.stdout)
result.append('')
continue
return result
if __name__ == "__main__":
LyricProviderInstance = LyricsPlugin()
Just a quick explanation...
There is another url lib called urllib2 (who would've thought that). There you can make a request, which is basically the same as you did with the old version, but instead of immediately opening the website, you can add headers to the request. If you add the request "Referer" .. well quess what, that's the referer, then you just open it and.. boom, there are your lyrics )
Also i've changed the "end" because otherwise there would have been a "</div>" at the end of the lyrics.
Now... would anyone be so kind and aid me in compiling a working dll, so that it is out of the legacy commands? Thanks!