Skip to main content

Topic: Lyrics Grabber Feedback & Discussion (Read 206941 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • Qudeid
  • [*][*][*]
  • Developer
Lyrics Grabber Feedback & Discussion
Reply #250
Sorry for double posting...

@Hitchhiker:

for LyricsPlugin there is a possibility to set a referer. That much I found out. Yet, I can't obviously, not test that out, as compiling doesn't make it work in Foobar. Hope someone can point me into the right direction.

Lyrics Grabber Feedback & Discussion
Reply #251
Unfortunately, I can't help when it comes to compiling code for foobar2000, however, I would like to see a proper update to the component.  Having the commands stuck in the "Legacy Commands" submenu is annoying.

But how did you set the referer?  I'm curious so that I can at least update my python script in the meantime.

  • Qudeid
  • [*][*][*]
  • Developer
Lyrics Grabber Feedback & Discussion
Reply #252
Unfortunately, I can't help when it comes to compiling code for foobar2000, however, I would like to see a proper update to the component.  Having the commands stuck in the "Legacy Commands" submenu is annoying.

But how did you set the referer?  I'm curious so that I can at least update my python script in the meantime.


I don't think it is the same with the python script. It is due to cURL lyricsgrabber is using. And in cURL you can set the referer. So I can't tell you about that in python. But I'll look into it.. there seems to be a way. Let me a moment

Edit:

could you please tell me, what "timestamp" is in that URL you provided a few posts ago?
  • Last Edit: 06 August, 2010, 07:08:08 AM by Qudeid

  • Qudeid
  • [*][*][*]
  • Developer
Lyrics Grabber Feedback & Discussion
Reply #253
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:

Code: [Select]
# -*- 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!
  • Last Edit: 06 August, 2010, 07:32:22 AM by Qudeid

  • Shemuel
  • [*]
Lyrics Grabber Feedback & Discussion
Reply #254
It's great for a workaround to be up in such a short time. It shows the quality of the members in this forum.

Thanks Qudeid! I have seen a lack of return breaks on some lyrics, but that's probably not down to the code. I'll mention if it's a recurring problem.

  • Qudeid
  • [*][*][*]
  • Developer
Lyrics Grabber Feedback & Discussion
Reply #255
Anyhow, I'd much rather the original working, than the workaround.
In theory it should, but, as I mentioned, I'm getting the one Error in Foobar that one or more dependencies are missing or build against an old SDK.

As the Code should work, in itself, it seems to be more of a configuration problem than the code, as I haven't changed much. (only the referer thing and the new SDK).
I would appreciate it very much, if someone could point me into the right direction.

And thanks for your approval

Edit: I know the problem now... My Dll requires curllib.dll, while the original doesn't.. But I don't know how I can get that code into the dll... Somehow it must work..
  • Last Edit: 06 August, 2010, 10:44:37 AM by Qudeid

  • Qudeid
  • [*][*][*]
  • Developer
Lyrics Grabber Feedback & Discussion
Reply #256
Only one hour time to edit a post?

Anyway... just for you to know. I got it to compile and it works... now I will face the issue with the legacy commands.
Seems like simply recompiling with the new SDK isn't enough... Anyone able to point me into the right direction?
  • Last Edit: 06 August, 2010, 11:35:05 AM by Qudeid

  • Qudeid
  • [*][*][*]
  • Developer
Lyrics Grabber Feedback & Discussion
Reply #257
Guys.. I've made it! *happy*

But unfortunately I am unable to upload it to that google code project, as I am not a member of that project. So I will upload it, including the license on my webspace, until Mr. Wang changes his own project (or adds me to it).
I will also include the current repository, archived in 7z, so anyone can look at the source code...

Plugin: Download
Source: Download

Fixes:
  • Compiled against the new SDK (05/21/2010)
  • Context menu is no longer in the legacy section
  • Fixed Problem with LyricsPlugin having changed the URL and requiring a referer URL as well

Just a little disclaimer... It works for me, with my own Foobar (Version 1.0). I've only tested it briefly and downloaded a song's lyrics using the LyricsPlugin option and it worked just fine.
Feel free to report anything to me or here. In the google Project Issue Tracker I won't be able to see it.
  • Last Edit: 06 August, 2010, 12:23:11 PM by Qudeid

Lyrics Grabber Feedback & Discussion
Reply #258
Guys.. I've made it! *happy*


Wow, awesome!  Thank you for doing this.

There's one little problem that I noticed.  The Lyrics Plugin command works, however, it still writes the "tunerankings.com" URL to the bottom of the lyrics.  This is particularly annoying when trying to download lyrics that don't exist, but Lyrics Grabber still reports success.

Thank you again.

  • Qudeid
  • [*][*][*]
  • Developer
Lyrics Grabber Feedback & Discussion
Reply #259
Guys.. I've made it! *happy*


Wow, awesome!  Thank you for doing this.

There's one little problem that I noticed.  The Lyrics Plugin command works, however, it still writes the "tunerankings.com" URL to the bottom of the lyrics.  This is particularly annoying when trying to download lyrics that don't exist, but Lyrics Grabber still reports success.

Thank you again.


Very strange... it doesn't do that for me... If there are not Lyrics, it says "failed" to me, and if there are, the lyrics are correctly displayed. So I really can't check that out.
Maybe I check for that string... I try fixing it.

  • tedgo
  • [*][*][*][*][*]
Lyrics Grabber Feedback & Discussion
Reply #260
Works for me too.
Thanks for this update

  • icedtea
  • [*][*]
Lyrics Grabber Feedback & Discussion
Reply #261
Guys.. I've made it! *happy*


Thanks for the update
I would suggest you contact T.P Wang via PM if he is unresponsive start a different project with a similar name like foo_lyricsgrabber2 at google code if you intend to develop this component further. The license is MIT which allows for forking so it shouldn't be a problem.

  • Qudeid
  • [*][*][*]
  • Developer
Lyrics Grabber Feedback & Discussion
Reply #262
Works for me too.
Thanks for this update


Very nice  Now we're even, TedGo . I use your DarkOne (as you might remember our correspondence in DeviantArt ) and you use, well at least something I have a little to do with ...

About the issue hitchhiker is having... I try to get a hold of him, so I can let him test for me, as I don't have that issue (which seems to be either location dependent, or it is because the lyrics themself contain that)

@icedtea:

Well, I don't really intent to develop it further... It's more like I maintain it a little. I don't plan to make any major changes or so. But OM him.. that I could really do, to at least get this version to google code and not a maybe lost thread post.
  • Last Edit: 06 August, 2010, 01:42:29 PM by Qudeid

  • grimes
  • [*][*][*][*]
  • Developer
Lyrics Grabber Feedback & Discussion
Reply #263
Thanks for your hard work, Qudeid.

Works here flawlessly.

  • tedgo
  • [*][*][*][*][*]
Lyrics Grabber Feedback & Discussion
Reply #264
@Qudeid
Ah, if you're Mortanse i just linked to your own update...

Btw. is it possible to integrate some other lyrics sources too?
LyricsWiki doesn't works since a long time and should be removed instead.
With more integrated sources there wouldn't be the need to write scripts in python by the end-user.
  • Last Edit: 06 August, 2010, 01:57:07 PM by tedgo

  • Qudeid
  • [*][*][*]
  • Developer
Lyrics Grabber Feedback & Discussion
Reply #265
@Qudeid
Ah, if you're Mortanse i just linked to your own update...

Btw. is it possible to integrate some other lyrics sources too?
LyricsWiki doesn't works since a long time and should be removed instead.
With more integrated sources there wouldn't be the need to write scripts in python by the end-user.


No. I'm either Qudeid or NamelessOne. *german myself* But was a while back. So no, you didn't

Err... possibly I could. But for the time being just use lyrics plugin as long as it works

btw.

Here are new links... those above don't work anymore!

Plugin: Download
Source: Download

Changes:
  • Hopefully fixed that location-based thing with tunedrankings.com (still works for those that didn't have that issue!)
  • Last Edit: 06 August, 2010, 02:15:16 PM by Qudeid

  • tedgo
  • [*][*][*][*][*]
Lyrics Grabber Feedback & Discussion
Reply #266
Thanks again

Lyrics Grabber Feedback & Discussion
Reply #267
@Qudeid:

Thanks you so so SO much

(btw works perfectly)
  • Last Edit: 06 August, 2010, 06:25:58 PM by cartman(2vd)

  • Jny
  • [*][*]
Lyrics Grabber Feedback & Discussion
Reply #268
finally! thanks Qudeid!

  • Qudeid
  • [*][*][*]
  • Developer
Lyrics Grabber Feedback & Discussion
Reply #269
@Tedgo:

If you would be so kind to suggest some other sites, I could see to it, that they make it into the plugin. Though I'd say not mote than a total of 4-5 (including LyricsPlugin).

Also I'm probably trying to implement a function, which will be available through the context menu, that automatically checks all builtin provider, to find lyrics for a song (or more).
That way, to find the lyrics, if anywhere available, you just have to click once, and not mutiple providers and see, they don't have it. I will see, how this turn out. So priority is more builtin providers.

PS: As suggested, I PMed T.P.Wang, so we'll see, if something is coming from him. Otherwise, as suggested, I open up a whole new repository, as I don't want to have much traffic on my own webspace.

  • grimes
  • [*][*][*][*]
  • Developer
Lyrics Grabber Feedback & Discussion
Reply #270
To get some ideas for sites to implement in lyricsgrabber, i can show you the python-scripts i use with grabberpython:

AZLyrics.py
DarkLyrics.py
Discogs_Genre.py
Discogs_Style.py
LeosLyrics.py
lrcDB.py
LyrDB.py
Lyricist(LRC).py
TTPlayer(LRC).py

Can't find the downloadlink for these script.
If you need those scripts, i can upload them again in Upload-Section.

AZ Lyrics, Leo's Lyrics and LyrDB seem to me useful sites.
  • Last Edit: 07 August, 2010, 05:11:58 AM by grimes

  • Qudeid
  • [*][*][*]
  • Developer
Lyrics Grabber Feedback & Discussion
Reply #271
Then.. why not add those 3 suggested plus DarkLyrics (as I use it quite often myself ).
That would make it then 5.

About the scripts, I have grabberpython, I'll look at the scripts that are already included, if a script is missing, I'll give you a call here.

  • grimes
  • [*][*][*][*]
  • Developer
Lyrics Grabber Feedback & Discussion
Reply #272
Testing: LeosLyrics Script doesn't work anymore, but AZLyrics and LyrDB work.
Can't test DarkLyrics (I'm mother's darling).

Lyrics Grabber Feedback & Discussion
Reply #273
Leo's Lyrics doesn't work due to server problems, not script problems.  There's a thread on their forum here.  Also in that thread is a suggestion to add a line to your hosts file that works in fixing the script. 

On the one hand, it's a pretty hacked way to get the lyrics. On the other hand, the new server supposedly searches Leo's Lyrics, Lyrics Mode, Lyrics Wiki, MetroLyrics, AbsoluteLyrics, SongLyrics, LyricsTime, and possibly DarkLyrics.  Perhaps someone could get in touch with the poster in the linked thread who maintains the server so that we don't need to modify the hosts file.

  • Qudeid
  • [*][*][*]
  • Developer
Lyrics Grabber Feedback & Discussion
Reply #274
On the one hand, it's a pretty hacked way to get the lyrics. On the other hand, the new server supposedly searches Leo's Lyrics, Lyrics Mode, Lyrics Wiki, MetroLyrics, AbsoluteLyrics, SongLyrics, LyricsTime, and possibly DarkLyrics.  Perhaps someone could get in touch with the poster in the linked thread who maintains the server so that we don't need to modify the hosts file.


That would mean adding Leo's Lyrics automatically searches all those other sites, and the output is always the same? That would reduce out need for providers in the Plugin quite a bit...

A quick status report:

I haven't started on implementing the provider yet, but I've implemented a provider, if you will, that combines all other Providers. But I'm not through with testing it yet.
  • Last Edit: 07 August, 2010, 06:15:30 AM by Qudeid