IPB

Welcome Guest ( Log In | Register )

12 Pages V  « < 9 10 11 12 >  
Reply to this topicStart new topic
Lyrics Grabber Feedback & Discussion, Proper place for Feedback & Discussion for foo_lyricsgrabber
Qudeid
post Aug 6 2010, 10:34
Post #251





Group: Developer
Posts: 113
Joined: 28-March 08
From: Dornbirn
Member No.: 52369



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.
Go to the top of the page
+Quote Post
Hitchhiker427
post Aug 6 2010, 11:31
Post #252





Group: Members
Posts: 232
Joined: 11-December 09
Member No.: 75848



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.
Go to the top of the page
+Quote Post
Qudeid
post Aug 6 2010, 11:58
Post #253





Group: Developer
Posts: 113
Joined: 28-March 08
From: Dornbirn
Member No.: 52369



QUOTE (Hitchhiker427 @ Aug 6 2010, 11:31) *
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 smile.gif

Edit:

could you please tell me, what "timestamp" is in that URL you provided a few posts ago?

This post has been edited by Qudeid: Aug 6 2010, 12:08
Go to the top of the page
+Quote Post
Qudeid
post Aug 6 2010, 12:24
Post #254





Group: Developer
Posts: 113
Joined: 28-March 08
From: Dornbirn
Member No.: 52369



Sorry again for double posting..

And never mind, hitchhiker, I got it working smile.gif
I just scanned a little the libraries of python and there I found how to do this, here's the working script:

CODE
# -*- 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 biggrin.gif)
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!

This post has been edited by Qudeid: Aug 6 2010, 12:32
Go to the top of the page
+Quote Post
Shemuel
post Aug 6 2010, 14:36
Post #255





Group: Members
Posts: 21
Joined: 13-December 09
Member No.: 75899



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.
Go to the top of the page
+Quote Post
Qudeid
post Aug 6 2010, 14:47
Post #256





Group: Developer
Posts: 113
Joined: 28-March 08
From: Dornbirn
Member No.: 52369



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 smile.gif

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.. sad.gif

This post has been edited by Qudeid: Aug 6 2010, 15:44
Go to the top of the page
+Quote Post
Qudeid
post Aug 6 2010, 16:15
Post #257





Group: Developer
Posts: 113
Joined: 28-March 08
From: Dornbirn
Member No.: 52369



Only one hour time to edit a post? sad.gif

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?

This post has been edited by Qudeid: Aug 6 2010, 16:35
Go to the top of the page
+Quote Post
Qudeid
post Aug 6 2010, 17:18
Post #258





Group: Developer
Posts: 113
Joined: 28-March 08
From: Dornbirn
Member No.: 52369



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.

This post has been edited by Qudeid: Aug 6 2010, 17:23
Go to the top of the page
+Quote Post
Hitchhiker427
post Aug 6 2010, 18:14
Post #259





Group: Members
Posts: 232
Joined: 11-December 09
Member No.: 75848



QUOTE (Qudeid @ Aug 6 2010, 11:18) *
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.
Go to the top of the page
+Quote Post
Qudeid
post Aug 6 2010, 18:26
Post #260





Group: Developer
Posts: 113
Joined: 28-March 08
From: Dornbirn
Member No.: 52369



QUOTE (Hitchhiker427 @ Aug 6 2010, 18:14) *
QUOTE (Qudeid @ Aug 6 2010, 11:18) *
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. sad.gif
Maybe I check for that string... I try fixing it.
Go to the top of the page
+Quote Post
tedgo
post Aug 6 2010, 18:36
Post #261





Group: Members
Posts: 1089
Joined: 16-April 04
From: Bavaria, Germany
Member No.: 13548



Works for me too.
Thanks for this update smile.gif
Go to the top of the page
+Quote Post
icedtea
post Aug 6 2010, 18:39
Post #262





Group: Members
Posts: 87
Joined: 26-January 10
Member No.: 77538



QUOTE (Qudeid @ Aug 6 2010, 17:18) *
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.
Go to the top of the page
+Quote Post
Qudeid
post Aug 6 2010, 18:40
Post #263





Group: Developer
Posts: 113
Joined: 28-March 08
From: Dornbirn
Member No.: 52369



QUOTE (tedgo @ Aug 6 2010, 18:36) *
Works for me too.
Thanks for this update smile.gif


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

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.

This post has been edited by Qudeid: Aug 6 2010, 18:42
Go to the top of the page
+Quote Post
grimes
post Aug 6 2010, 18:40
Post #264





Group: Developer
Posts: 302
Joined: 12-November 07
From: Frankfurt
Member No.: 48701



Thanks for your hard work, Qudeid.

Works here flawlessly.
Go to the top of the page
+Quote Post
tedgo
post Aug 6 2010, 18:48
Post #265





Group: Members
Posts: 1089
Joined: 16-April 04
From: Bavaria, Germany
Member No.: 13548



@Qudeid
Ah, if you're Mortanse i just linked to your own update... biggrin.gif

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.

This post has been edited by tedgo: Aug 6 2010, 18:57
Go to the top of the page
+Quote Post
Qudeid
post Aug 6 2010, 19:13
Post #266





Group: Developer
Posts: 113
Joined: 28-March 08
From: Dornbirn
Member No.: 52369



QUOTE (tedgo @ Aug 6 2010, 18:48) *
@Qudeid
Ah, if you're Mortanse i just linked to your own update... biggrin.gif

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 biggrin.gif

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

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!)


This post has been edited by Qudeid: Aug 6 2010, 19:15
Go to the top of the page
+Quote Post
tedgo
post Aug 6 2010, 20:36
Post #267





Group: Members
Posts: 1089
Joined: 16-April 04
From: Bavaria, Germany
Member No.: 13548



Thanks again smile.gif
Go to the top of the page
+Quote Post
cartman(2vd)
post Aug 6 2010, 23:24
Post #268





Group: Members
Posts: 240
Joined: 10-August 06
Member No.: 33888



@Qudeid:

Thanks you so so SO much

(btw works perfectly)

This post has been edited by cartman(2vd): Aug 6 2010, 23:25
Go to the top of the page
+Quote Post
Jny
post Aug 7 2010, 08:45
Post #269





Group: Members
Posts: 56
Joined: 1-June 08
Member No.: 53960



finally! thanks Qudeid!
Go to the top of the page
+Quote Post
Qudeid
post Aug 7 2010, 09:06
Post #270





Group: Developer
Posts: 113
Joined: 28-March 08
From: Dornbirn
Member No.: 52369



@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.
Go to the top of the page
+Quote Post
grimes
post Aug 7 2010, 10:04
Post #271





Group: Developer
Posts: 302
Joined: 12-November 07
From: Frankfurt
Member No.: 48701



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.

This post has been edited by grimes: Aug 7 2010, 10:11
Go to the top of the page
+Quote Post
Qudeid
post Aug 7 2010, 10:12
Post #272





Group: Developer
Posts: 113
Joined: 28-March 08
From: Dornbirn
Member No.: 52369



Then.. why not add those 3 suggested plus DarkLyrics (as I use it quite often myself biggrin.gif).
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.
Go to the top of the page
+Quote Post
grimes
post Aug 7 2010, 10:31
Post #273





Group: Developer
Posts: 302
Joined: 12-November 07
From: Frankfurt
Member No.: 48701



Testing: LeosLyrics Script doesn't work anymore, but AZLyrics and LyrDB work.
Can't test DarkLyrics (I'm mother's darling).
Go to the top of the page
+Quote Post
Hitchhiker427
post Aug 7 2010, 10:59
Post #274





Group: Members
Posts: 232
Joined: 11-December 09
Member No.: 75848



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.
Go to the top of the page
+Quote Post
Qudeid
post Aug 7 2010, 11:04
Post #275





Group: Developer
Posts: 113
Joined: 28-March 08
From: Dornbirn
Member No.: 52369



QUOTE (Hitchhiker427 @ Aug 7 2010, 10:59) *
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.

This post has been edited by Qudeid: Aug 7 2010, 11:15
Go to the top of the page
+Quote Post

12 Pages V  « < 9 10 11 12 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 23rd April 2014 - 10:37