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

frankz

  • Sr. Member
  • ****
  • Posts: 3834
I take them out because they're not lyrics.  

Every provider is configurable.  Search the thread this has been asked and answered before. Create a second (differently named) YML for Genius and take out the line referenced in that post, then use that one instead of the one built into the plugin.
Last Edit: October 28, 2020, 12:53:39 PM by frankz

lucytea

  • Newbie
  • *
  • Posts: 7
Sorry for that, thanks for linking the answer anyway.
To be clear, the initial stripping of paragraph breaks is just as big a problem for me - some lyrics don't have any [labels], and this process leaves them without any paragraph breaks at all. Other songs still have more breaks than [labels] so the formatting is not very good.
I should be able to handle this from here though, thanks for the link.

frankz

  • Sr. Member
  • ****
  • Posts: 3834
To be clear, the only thing I stripped was things that showed up wrapped in [] like Verse 1, Chorus, etc.  That entry is taken out and replaced with a blank line. Then the \n\n -> \n replacement takes the double breaks that creates and makes them a single break.  There's nothing else that that would take out line breaks.

lucytea

  • Newbie
  • *
  • Posts: 7
Then the \n\n -> \n replacement takes the double breaks that creates and makes them a single break.
Ok, this is the issue. A regular line of text will already end with \n, so if there's a line of text followed by a single empty line, this will remove the single line. The aim is to remove double empty lines left by removing the [labels], so the replacement should instead be \n\n\n -> \n\n
I've already tested this as fixing my case, and behaving properly in lyrics with a mix of labelled and unlabelled empty lines.
Perhaps instead of exactly three \n it should be three or more, though?

frankz

  • Sr. Member
  • ****
  • Posts: 3834
Ok, this is the issue. A regular line of text will already end with \n, so if there's a line of text followed by a single empty line, this will remove the single line. The aim is to remove double empty lines left by removing the [labels], so the replacement should instead be \n\n\n -> \n\n
I've already tested this as fixing my case, and behaving properly in lyrics with a mix of labelled and unlabelled empty lines.
Perhaps instead of exactly three \n it should be three or more, though?
The \n\n to \n replacement and trim command were user submissions from here. I don't obsess over line spacing one way or the other - if the words are there and I can look at them then I personally don't need it to look any certain way - but I tested it and saw that it worked and figured it would be useful so I put it in.  I'm not seeing any problem such as you describe with the spacing, but as I said I'm not really looking for one either.

Rather than go back and forth with \n\n to \n, or \n\n\n to \n\n, or however many \ns the next person thinks should or shouldn't be there, I'm inclined to either leave it replacing the way it is or remove the replacement completely and live with the two blank lines between sections that ShotgunStev3 noted earlier.

Again, the plug-in is built so that any provider file can be copied locally, modified to taste, and then inserted into the provider list.  You'd just want to disable the built in one and enable the modified local one.

To be clear, the only thing I stripped was things that showed up wrapped in [] like Verse 1, Chorus, etc.  That entry is taken out and replaced with a blank line.
I think I said this wrong in that reply.  It just takes out the [.....] and replaces it with nothing, not a blank line.  The blank line is formed by the \n that's already there.  The change the other user made was to account for the space left, not an extra blank line created by the replacement.
Last Edit: October 28, 2020, 07:04:02 PM by frankz

lucytea

  • Newbie
  • *
  • Posts: 7
The current /n/n -> /n replacement causes issues when lyrics are formatted something like this:
Code
[chorus]
Line 1
Line 2

Line 3
Line 4

[bridge]
Line 5
Line 6

Line 7
Line 8
The current setup will transform that to this:
Code
Line 1
Line 2
Line 3
Line 4

Line 5
Line 6
Line 7
Line 8
My change will convert it to this:
Code
Line 1
Line 2

Line 3
Line 4

Line 5
Line 6

Line 7
Line 8
Note that between the "2" and the "L" there are two \n in the source text, since all lines end with one.
It does seem a bit subjective - or even better the original way - with such a tiny example, but this sucks when you encounter it in the wild.
When there is a double empty line and thus three \n in a row, this behaves the same as the original version. So it's a small change, but really helpful for the readability of songs that have no or very few of these [labels].
If examples are useful, then here are some lyrics I've seen have this issue. One Two.
The downside is it'll do less compacting if for some reason some lyrics have many more newlines in a row, which is why I pondered about capturing 3+ \n instead of strictly 3. This hasn't seemed necessary in my testing - the only occasion I saw with extra lines was when the lyrics were actually broken and needed manual attention.

Of course you're right that I can fix it myself and I've done so, thanks for including that feature. So this is the last I'll post of it. I do hope you'll consider including this change since it's an important readability improvement in my eyes, and brings the actual behaviour closer to how you described it - it "takes the double breaks that creates and makes them a single break". With this spacing fixed I've even conceded that you're right about the [labels], I don't need them at all.
Thanks for your work and time.

frankz

  • Sr. Member
  • ****
  • Posts: 3834
Of course you're right that I can fix it myself and I've done so, thanks for including that feature.
All of the credit for that goes to the plug-in's original author.

As I said, I'm not someone who cares about line spacing almost at all.  I know, though, that on the other end are folks who will obsess over and be legitimately bothered by a button being one pixel to the left or right of where it should be, and I want to respect both outlooks and have the plug-in work the best that it can for everyone.  If you use this over a period of time and notice that it provides a clear benefit over what's there now, I will adopt it assuming there are no objections otherwise.  

I just don't want to get in a position where I'm changing this line for this user and then 6 months later changing it to something else for another user and then 6 months after that changing it back for a third user.  I feel like the easy customization / personalization is much better suited for those kinds of changes than a wholesale built-in change is.

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9303
I just don't want to get in a position where I'm changing this line for this user and then 6 months later changing it to something else for another user and then 6 months after that changing it back for a third user.  I feel like the easy customization / personalization is much better suited for those kinds of changes than a wholesale built-in change is.
Basically different strokes for different folks. I agree with you 100%. If the plugin didn't have the ability for an end user to customize to their liking, then I might feel differently. But since it's available, each user can make it their own. Perhaps with a little guidance from you, but unless you get a cascade of requests for the same customization, the user can do it.

I still think this is the second most useful plugin for MB. (Boroda's Additional Tagging & Reporting Tools is the first.)
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

Comtezero

  • Newbie
  • *
  • Posts: 4
Hi !

I use this plugin, very nice one, but sometimes I get the error "gzip compression detected" and the lyrics are not found, while the URL take me to the lyrics.

See the following example, the Genius lyrics are there but still it says not found.

09/12/2020 10:07:11 [DEBUG] Lyrics request: Neal Morse - Warmer Than the Sunshine - Sola Gratia - Genius
09/12/2020 10:07:11 [INFO] Genius tries to load the lyrics...
09/12/2020 10:07:11 [DEBUG] The constructed URL: http://genius.com/neal-morse-warmer-than-the-sunshine-lyrics
09/12/2020 10:07:11 [DEBUG] Lyrics request: Neal Morse - Warmer Than the Sunshine - Sola Gratia - MetroLyrics
09/12/2020 10:07:11 [INFO] MetroLyrics tries to load the lyrics...
09/12/2020 10:07:11 [DEBUG] The constructed URL: http://www.metrolyrics.com/warmer-than-the-sunshine-lyrics-neal-morse.html
09/12/2020 10:07:11 [DEBUG] Lyrics request: Neal Morse - Warmer Than the Sunshine - Sola Gratia - Musixmatch
09/12/2020 10:07:11 [INFO] Musixmatch tries to load the lyrics...
09/12/2020 10:07:11 [DEBUG] The constructed URL: http://www.musixmatch.com/lyrics/neal-morse/warmer-than-the-sunshine
09/12/2020 10:07:11 [DEBUG] Lyrics request: Neal Morse - Warmer Than the Sunshine - Sola Gratia - Urban Lyrics
09/12/2020 10:07:11 [INFO] Urban Lyrics tries to load the lyrics...
09/12/2020 10:07:11 [DEBUG] The constructed URL: http://www.urbanlyrics.com/lyrics/nealmorse/warmerthanthesunshine.html
09/12/2020 10:07:11 [DEBUG] Lyrics request: Neal Morse - Warmer Than the Sunshine - Sola Gratia - A-Z Lyrics Universe
09/12/2020 10:07:11 [INFO] A-Z Lyrics Universe tries to load the lyrics...
09/12/2020 10:07:11 [DEBUG] The constructed URL: http://www.azlyrics.com/lyrics/nealmorse/warmerthanthesunshine.html
09/12/2020 10:07:11 [INFO] No lyrics found.
09/12/2020 10:07:11 [DEBUG] no lyrics found from A-Z Lyrics Universe
09/12/2020 10:07:11 [DEBUG] gzip compression detected
09/12/2020 10:07:11 [WARN] The pattern <div id="lyrics-body">(?<lyrics>.*?)</div> didn't match!
09/12/2020 10:07:11 [INFO] No lyrics found.
09/12/2020 10:07:11 [DEBUG] no lyrics found from MetroLyrics
09/12/2020 10:07:12 [DEBUG] gzip compression detected
09/12/2020 10:07:12 [WARN] The pattern <p class="mxm-lyrics__content ">\s*(?<lyrics>.*?)</span> didn't match!
09/12/2020 10:07:12 [INFO] No lyrics found.
09/12/2020 10:07:12 [DEBUG] no lyrics found from Musixmatch
09/12/2020 10:07:12 [DEBUG] gzip compression detected
09/12/2020 10:07:12 [WARN] The pattern <div\s+class="song_body-lyrics"[^>]*?>[\s\S]*?<p>(?<lyrics>[\s\S]*?)</p> didn't match!
09/12/2020 10:07:12 [INFO] No lyrics found.
09/12/2020 10:07:12 [DEBUG] no lyrics found from Genius

frankz

  • Sr. Member
  • ****
  • Posts: 3834
"gzip compression detected" is not an error or even a warning.  It is a bit of information.

Update (overwrite) your DLL for the plugin (with musicbee closed) with the new from the first post, as the Genius problem has been addressed.

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9303
09/12/2020 10:07:11 [INFO] A-Z Lyrics Universe tries to load the lyrics...
09/12/2020 10:07:11 [DEBUG] The constructed URL: http://www.azlyrics.com/lyrics/nealmorse/warmerthanthesunshine.html
09/12/2020 10:07:11 [INFO] No lyrics found.
09/12/2020 10:07:11 [DEBUG] no lyrics found from A-Z Lyrics Universe
09/12/2020 10:07:11 [DEBUG] gzip compression detected
09/12/2020 10:07:11 [WARN] The pattern <div id="lyrics-body">(?<lyrics>.*?)</div> didn't match!
09/12/2020 10:07:11 [INFO] No lyrics found.
Most often than not, AZ Lyrics is using a Captcha before allowing the user to see lyrics. I can't speak about the other errors you're seeing.
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

frankz

  • Sr. Member
  • ****
  • Posts: 3834
Most often than not, AZ Lyrics is using a Captcha before allowing the user to see lyrics. I can't speak about the other errors you're seeing.

A to Z Lyrics Universe isn't even a provider in the plugin any more.  I removed it two versions ago.

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9303
A to Z Lyrics Universe isn't even a provider in the plugin any more.  I removed it two versions ago.
And the reason you suggested that the OP update.

But (I believe) AZLyrics is and when searching manually, it throws the Captcha
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

frankz

  • Sr. Member
  • ****
  • Posts: 3834
These are the current providers:

Cušpajz
Genius
Letras de músicas
Metrolyrics
Musixmatch_Asian
Musixmatch
Oldies Lyrics
Smriti
Song Lyrics
Teksty
Urban Lyrics
Hindi Lyrics

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9303
Thanks for the providers list. I'm assuming that AZ is built in the MB, correct? I checked my providers directory and bing is the only yml that's active. I have (had) AZ there, but changed the file extension to .OLD yet it is still appearing in Tags (2) Settings for lyrics.
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