Author Topic: LyricsReloaded (Updated)  (Read 164066 times)

sveakul

  • Sr. Member
  • ****
  • Posts: 2438
I originally removed LyricWiki from the plug-in because it's now native to MB and seemed to be redundant. I don't remember why I put it back in, maybe someone asked or maybe because I put the Gracenote portion back in and figured I'd throw it back in too just in case,

Actually it was to fix a situation with the "built-in" pugin reported by "moi" (https://getmusicbee.com/forum/index.php?topic=26211.0), and much appreciated!  Thanks for your comments on the new situation there, what a shame.  Looks like they've joined the ranks of sites like Metal Archives with no way to get a result to appear in the normal manner.

GoodMorning

  • Newbie
  • *
  • Posts: 11
Hi, just a small bug report, I was having problems with a song with round brackets in its (official) name. The song in question was "Phantom Divine (Shadow Empire)" by Kamelot and I was not able to get any lyrics for it, but worked when I renamed it to "Phantom Divine Shadow Empire"
Parenthesis should be stripped out of the constructed url when they'll cause a problem at the site. If you look in the log for the plug-in (%AppData%/Roaming/MusicBee/mb_LyricsReloaded) it should tell you the constructed URL for each site the plug-in accessed and which sites could and couldn't find the lyrics.  If you go to each URL you'll see why the lyrics were and weren't found there.

Is it possible that the lyrics came from one of the native sources? They use a different method (API) to retrieve lyrics.  The plug-in is basically a web browser that pulls one specific text portion of the retrieved page.

It looks like it's also stripping the text that's inside the parentheses. I just checked my LyricsReloaded log and found this:

Code
20-05-2020 03:35:42 [DEBUG] Lyrics request:  - Weezer -  Good Thing - Weezer (White Album) - Genius
20-05-2020 03:35:42 [DEBUG] Lyrics request:  - Weezer -  Good Thing - Weezer (White Album) - MetroLyrics
20-05-2020 03:35:42 [INFO] MetroLyrics tries to load the lyrics...
20-05-2020 03:35:42 [DEBUG] The constructed URL: http://www.metrolyrics.com/-good-thing-lyrics-weezer.html
20-05-2020 03:35:42 [DEBUG] Lyrics request:  - Weezer -  Good Thing - Weezer (White Album) - LyricWiki Reloaded
20-05-2020 03:35:42 [INFO] LyricWiki Reloaded tries to load the lyrics...
20-05-2020 03:35:42 [DEBUG] The constructed URL: http://lyrics.wikia.com/Weezer:_Good_Thing
20-05-2020 03:35:42 [INFO] Genius tries to load the lyrics...
20-05-2020 03:35:42 [DEBUG] The constructed URL: http://genius.com/weezer-good-thing-lyrics
20-05-2020 03:35:42 [DEBUG] gzip compression detected
20-05-2020 03:35:42 [WARN] The pattern <div id="lyrics-body">(?<lyrics>.*?)</div> didn't match!
20-05-2020 03:35:42 [INFO] No lyrics found.
20-05-2020 03:35:42 [DEBUG] no lyrics found

The lyrics I was requesting were for "(Girl We Got A) Good Thing" by Weezer. One of the URLs it constructed was http://genius.com/weezer-good-thing-lyrics which leads to an error page, but if the URL is changed to restore the text in the parentheses like http://genius.com/weezer-girl-we-got-a-good-thing-lyrics then it leads to the song's lyrics.

frankz

  • Sr. Member
  • ****
  • Posts: 3834
It looks like it's also stripping the text that's inside the parentheses. I just checked my LyricsReloaded log and found this:
.com/weezer-girl-we-got-a-good-thing-lyrics then it leads to the song's lyrics.
OK..that's interesting.  The parenthetical part is actually stripped somewhere before this point, before it's used to construct the URL.  This part..
Code
20-05-2020 03:35:42 [DEBUG] Lyrics request:  - Weezer -  Good Thing - Weezer (White Album) - Genius
...prints back exactly what the plugin thinks is received by MB.  Here's the code.
Code
lyricsReloaded.getLogger().debug("Lyrics request: {0} - {1} - {2} - {3} - {4}", source, artist, title, album, providerName);
Incidentally, not that it matters, but it's also not getting "source," which I'm assuming is the filename or URL, and I think it's not needed because we don't do anything with it.  So when I figure this out I'll take that out of the logger because having that "-" to start is ugly and I don't like it.  That's beside the point.

So it's nothing in the YML that's stripping it out before it's getting it sent to the provider, because it's not making it that far.

When I get a minute I'll look into whether there's something somewhere else in the code that's stripping it out before it gets here.  I know that the parenthetical makes it from MB to last.fm so MB sends it in some context.

This could be a while FYI.  Do the built-ins retrieve lyrics for these songs? That would be a big hint.

GoodMorning

  • Newbie
  • *
  • Posts: 11
This could be a while FYI.  Do the built-ins retrieve lyrics for these songs? That would be a big hint.

No, at least not the ones I've enabled. They either fail to retrieve anything or retrieve the wrong song. On some songs the lyrics are successfully retrieved, but I think it's only because the provider has a matching URL that omits the text in the parentheses as well. e.g. https://genius.com/The-beach-boys-dont-talk-lyrics for the song "Don't Talk (Put Your Head On My Shoulders)"

frankz

  • Sr. Member
  • ****
  • Posts: 3834
No, at least not the ones I've enabled. They either fail to retrieve anything or retrieve the wrong song. On some songs the lyrics are successfully retrieved, but I think it's only because the provider has a matching URL that omits the text in the parentheses as well. e.g. https://genius.com/The-beach-boys-dont-talk-lyrics for the song "Don't Talk (Put Your Head On My Shoulders)"

MB processes the title and removes parenthetical statements.  See this thread for details.

frankz

  • Sr. Member
  • ****
  • Posts: 3834
I've updated the plug-in.

1.1.8 Changes
Fixed missing field reference in the log
Added Provider Name to log messages so people will know where lyrics were and weren't found
Removed provider LyricWiki Reloaded as it no longer provides lyrics in plain text
Removed provider LyricWiki Gracenote Reloaded as it no longer provides lyrics in plain text
Updated revision from 1.1.7 to 1.1.8


Latest Version and source is at: https://github.com/mbfrankz/LyricsReloaded/releases/tag/1.1.8

sveakul

  • Sr. Member
  • ****
  • Posts: 2438
Thanks frankz the extra logging is very helpful indeed.  BTW, for those who still want to check lyrics at LyricWiki you can use the "poor man's workaround" of adding an entry in MusicBee's Internet/Custom Web Links section that will open your web browser and at least get you to the page where the lyrics are (if they're there!) and you can copy/paste from there:

http://lyrics.fandom.com/wiki/<Artist>:<Title>

frankz

  • Sr. Member
  • ****
  • Posts: 3834
BTW, for those who still want to check lyrics at LyricWiki you can use the "poor man's workaround" of adding an entry in MusicBee's Internet/Custom Web Links section that will open your web browser and at least get you to the page where the lyrics are (if they're there!) and you can copy/paste from there:

http://lyrics.fandom.com/wiki/<Artist>:<Title>
Good tip, yes. They can't take that away from us!

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9301
Added Provider Name to log messages so people will know where lyrics were and weren't found
Thanks very much for the update and for this specifically.
Download the latest MusicBee v3.5 or 3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Posting screenshots is here
Searching the forum with Google is  here

EGraf

  • Newbie
  • *
  • Posts: 5
thanks for the update, will check the log for future problems, for now I'm ok :)
just a heads-up, it seems the fix that was implemented in 1.1.7 not only strips double or redundant line breaks, but intended blank lines too... is a feature or a bug?

frankz

  • Sr. Member
  • ****
  • Posts: 3834
Added Provider Name to log messages so people will know where lyrics were and weren't found
Thanks very much for the update and for this specifically.

You're welcome.  One thing I noticed is that it will report each source that found results, but does not indicate which of the results is actually being used in the event that more than one set of lyrics was found.  I don't know that there's a way around that (within my abilities) but at least you can look and see which sources are always "no lyrics found" and maybe deactivate them to save bandwitdh or something.  Seemed like a useful addition to me even with limitations.

thanks for the update, will check the log for future problems, for now I'm ok :)
just a heads-up, it seems the fix that was implemented in 1.1.7 not only strips double or redundant line breaks, but intended blank lines too... is a feature or a bug?

It shouldn't. It just takes two breaks (/n/n) and replaces it with one (/n).  Should leave a single /n alone. Works fine here (most of my lyrics come from Genius it's my first listed source).
Last Edit: May 22, 2020, 04:17:49 AM by frankz

EGraf

  • Newbie
  • *
  • Posts: 5
It shouldn't. It just takes two breaks (/n/n) and replaces it with one (/n).  Should leave a single /n alone. Works fine here (most of my lyrics come from Genius it's my first listed source).

Check this lyric. The way it looks on Genius:
Quote
Before you
My home was in the wind and surf
The birds and rain, voices of the northern lights

Then you came
I joined you beyond the aeons
As you blew your cave bear bone
And began to hum

But the lyric is imported like this:
Quote
Before you
My home was in the wind and surf
The birds and rain, voices of the northern lights
Then you came
I joined you beyond the aeons
As you blew your cave bear bone
And began to hum


another bug (sorry!). Musixmatch is not getting any lyrics even if the log says it does.

Quote
22/05/2020 05:16:25 [DEBUG] Lyrics request: Nightwish - Pan - Human. :II: Nature. - Musixmatch
22/05/2020 05:16:25 [INFO] Musixmatch tries to load the lyrics...
22/05/2020 05:16:25 [DEBUG] The constructed URL: http://www.musixmatch.com/lyrics/nightwish/pan
22/05/2020 05:16:26 [DEBUG] gzip compression detected
22/05/2020 05:16:26 [DEBUG] lyrics found from Musixmatch!

still MusicBee says it didn't found the lyric
Last Edit: May 22, 2020, 04:23:05 AM by EGraf

frankz

  • Sr. Member
  • ****
  • Posts: 3834
It shouldn't. It just takes two breaks (/n/n) and replaces it with one (/n).  Should leave a single /n alone. Works fine here (most of my lyrics come from Genius it's my first listed source).

Check this lyric. The way it looks on Genius:
Quote
Before you
My home was in the wind and surf
The birds and rain, voices of the northern lights

Then you came
I joined you beyond the aeons
As you blew your cave bear bone
And began to hum

But the lyric is imported like this:
Quote
Before you
My home was in the wind and surf
The birds and rain, voices of the northern lights
Then you came
I joined you beyond the aeons
As you blew your cave bear bone
And began to hum


another bug (sorry!). Musixmatch is not getting any lyrics even if the log says it does.

Quote
22/05/2020 05:16:25 [DEBUG] Lyrics request: Nightwish - Pan - Human. :II: Nature. - Musixmatch
22/05/2020 05:16:25 [INFO] Musixmatch tries to load the lyrics...
22/05/2020 05:16:25 [DEBUG] The constructed URL: http://www.musixmatch.com/lyrics/nightwish/pan
22/05/2020 05:16:26 [DEBUG] gzip compression detected
22/05/2020 05:16:26 [DEBUG] lyrics found from Musixmatch!

still MusicBee says it didn't found the lyric

The good thing about the plugin is that if a certain configuration isn't working as expected for you, you can customize it to your liking.  All of the YMLs for the providers (even the ones I've removed, for the time being) are located here.  Download the one you want to modify, rename it, retitle it, edit it to taste and put it in the providers folder for the plug-in. It will be available as an option for you in MB set just the way you like it.

As far as that set of lyrics not loading from Musixmatch, I'm sorry this is happening to you.  I can't really speculate as to why those particular lyrics didn't show up, but if you find that a provider is regularly giving you problems there are many others.  If you find that it's a case of the site having changed from what is expected as a pattern as the start to the lyrics display (for Musixmatch, it's "['<p class="mxm-lyrics__content ">\s*(?<lyrics>.*?)</span>', s]"), feel free to submit the new pattern the site is using and I will gladly adopt it into the plugin.  I've been clear from the get-go that I am of very little use when it comes to constructing the kind of regex needed to produce the matching patterns but have been very responsive to adopting changes when they're proposed.  MusixMatch seems to block "View Source," which makes it harder.
Last Edit: May 22, 2020, 05:44:57 AM by frankz

EGraf

  • Newbie
  • *
  • Posts: 5
Thanks, will look at it when I have the time! Is great your plugin has this flexibility.

BTW, sorry if I gave you the impression of been a little demanding, far from it! I really appreciate your time and effort!

frankz

  • Sr. Member
  • ****
  • Posts: 3834
Thanks, will look at it when I have the time! Is great your plugin has this flexibility.

BTW, sorry if I gave you the impression of been a little demanding, far from it! I really appreciate your time and effort!
Think nothing of it.  It's really not my plug-in.  It was developed by someone much smarter than me.  I just took over maintaining it when he no longer had reason to.