Author Topic: LyricsReloaded (Latest)  (Read 126930 times)

sveakul

  • Hero Member
  • *****
  • Posts: 3262
The code replacement from Naireem works for the non-fuzzy Genius YML script.

On the fuzzy YML script, where the original code line starts differently ("lyrics pattern" instead of "pattern"), replacing the entire line results in no hits, keeping the "lyrics pattern" beginning results in a hanged search if that point is reached..

It is important to remember that when looking at the check boxes in Tags (2), if you have added these two YML scripts to the Providers folder you will now see FOUR Genius boxes, 2 for the built-in Genius/Genius (fuzzy) and another 2 for the YMLs added to the folder.  To avoid mass confusion, re-name the YML scripts internally on the first line ("name:) to differentiate them in the box display from the built-in ones.

Recommended configuraion at this time:

1.  Remove the 2 YMLs if present in the Providers folder and restart MB
2.  Go to Tags(2) and uncheck the 2 Genius boxes (they will be from the non-working built-in ones)
3.  Make the Naireem change to regular Genius YML script, rename it, and add/check it in the Providers folder

If confused (now who could possibly be confused??), forget the whole thing, use the Beenius plugin, and wait for Mayibongwe to release a sorted new DLL.

Thanks Naireem in any case for making the regular YML script usable with your code substitute.  Below is the working non-fuzzy version, renamed with the fix applied:

Code
name: Genius Headers

variables:
    artist:
        type: artist
        filters:
        - strip_diacritics
        - lowercase
        - [replace, "!!!", "chk-chik-chick"]
        - [regex, '(?<=\W|\s)+(feat.+|ft[\W\s]+|(f\.\s)).+', ""]
        - [regex, '\.+|,+|(\W+(?=$))|(^\W+)', ""]
        - [regex, "'", ""]
        - [regex, '(?<=[a-z0-9%])[^\sa-z0-9%]+(?=[a-z0-9%]+)', "-"]
        - [regex, '((?<=\s)([^a-z0-9\s-])+(\s|\W)+)|((?<=\w)([^a-z0-9-])+(\s|\W)+)', " "]
        - [strip_nonascii, -]
    title:
        type: title
        filters: artist

config:
    url: "https://genius.com/{artist}-{title}-lyrics"
    pattern: ['<div data-lyrics-container="true" class="Lyrics-sc-1bcc94c6-1.*?">(?<lyrics>.*)<div class="LyricsFooter-sc-c3476ba7-0.*?">', 's']

post-filters:
- [regex, 'You might also like</div>', "\n"]
- [regex, '<div class="PrimisPlayer.*?>', "\n"]
- [regex, 'Letra de &quot.*?<br/><br/>', ""]
- [regex, '<inread-ad></inread-ad>', ""]
- [regex, '<div class="StubhubLink.*?</div>', ""]
- br2nl
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- [regex, '\n{2,}',"\n\n", 's']
- [regex, '\[(\[)',"$1", 's']
- trim
Last Edit: December 13, 2024, 07:25:11 PM by sveakul

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
Thank you all.
I've updated the plugin using Naireem's fix - both genius versions should work now.
Strength and Honour (2025)

sveakul

  • Hero Member
  • *****
  • Posts: 3262
Thank you all.
I've updated the plugin using Naireem's fix - both genius versions should work now.
Thanks Mayibongwe!  Both tested and working fine.

Folks--these are now built-in to the MB LyricsReloaded 1.25 DLL;  you can delete any Genius-related *.YML files from your Providers directory before adding the new plugin.  Then when you restart MusicBee, you will see two un-checked boxes in Tags(2), "Genius" and "Genius (fuzzy)".  Those are the new built-in ones, and can be selected and moved in your source list as desired.

catalonia

  • Jr. Member
  • **
  • Posts: 64
thanks for fixing it! but i have been testing it and there is the following bug:
When has the song title integrated in the lyrics in the first line is duplicated the sign [ is duplicated.

https://genius.com/C-tangana-de-pie-lyrics:

[[Intro]
Eso es

[Coro]
Yo solo sé, que de orgullo moriría el primero
Yo solo sé, que antes que doblarme, roto entero

When the song does not have a embed title it does not give this failure and works perfectly.:
https://genius.com/Toteking-andergraun-lyrics
Last Edit: December 15, 2024, 07:50:22 AM by catalonia

sveakul

  • Hero Member
  • *****
  • Posts: 3262
You can't expect every possible "niche" case or personal preference to be accounted for in something as complicated as this.  Lyrics exist is all kinds of permutations and formats, even on the same source servers, and it's just not realistic to expect Mayibongwe to accomodate all of them.  Be happy with 99% instead of considering less than 100% to be a "bug."  SOME manual editing will always be needed in an area like this.

As I've mentioned before, try Beenius, it may deliver more of what you are looking for from this single source.

catalonia

  • Jr. Member
  • **
  • Posts: 64
It is an error that the author solved it by adding [regex, '\[(\[)',“$1”, 's'] at the end of all the code.
I guess that in the rush to offer a version to the users he forgot to put it.
I already have it configured for me, the request was for other users who may encounter the same problem, I'm going to copy the codes in case someone needs them, these are the two codes of the versions that are included:

genius.yml
Code
name: Genius 

variables:
    artist:
        type: artist
        filters:
        - strip_diacritics
        - lowercase
        - [replace, "!!!", "chk-chik-chick"]
        - [regex, '(?<=\W|\s)+(feat.+|ft[\W\s]+|(f\.\s)).+', ""]
        - [regex, '\.+|,+|(\W+(?=$))|(^\W+)', ""]
        - [regex, "'", ""]
        - [regex, '(?<=[a-z0-9%])[^\sa-z0-9%]+(?=[a-z0-9%]+)', "-"]
        - [regex, '((?<=\s)([^a-z0-9\s-])+(\s|\W)+)|((?<=\w)([^a-z0-9-])+(\s|\W)+)', " "]
        - [strip_nonascii, -]
    title:
        type: title
        filters: artist

config:
    url: "https://genius.com/{artist}-{title}-lyrics"
    pattern: ['<div data-lyrics-container="true" class="Lyrics-sc-1bcc94c6-1.*?">(?<lyrics>.*)<div class="LyricsFooter-sc-c3476ba7-0.*?">', 's']

post-filters:
- [regex, 'You might also like</div>', "\n"]
- [regex, '<div class="PrimisPlayer.*?>', "\n"]
- [regex, 'Letra de &quot.*?<br/><br/>', ""]
- [regex, '<inread-ad></inread-ad>', ""]
- [regex, '<div class="StubhubLink.*?</div>', ""]
- br2nl
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- [regex, '\n{2,}',"\n\n", 's']
- [regex, '\[(\[)',"$1", 's']
- trim

Genius (fuzzy).yml
Code
name: Genius (fuzzy)
loader: search

variables:
    artist:
        type: artist
        filters:
        - lowercase
        
    title:
        type: title
        filters: artist

config:
    identity url: "https://www.google.com/search?q=Genius+{title}+{artist}"
    identity pattern: ['(?<identity>https://genius.com.*?-lyrics)', 's']
    lyrics url: ""
    lyrics pattern: ['<div data-lyrics-container="true" class="Lyrics-sc-1bcc94c6-1.*?">(?<lyrics>.*)<div class="LyricsFooter-sc-c3476ba7-0.*?">', 's']

post-filters:
- [regex, 'You might also like</div>', "\n"]
- [regex, '<div class="PrimisPlayer.*?>', "\n"]
- [regex, 'Letra de &quot.*?<br/><br/>', ""]
- [regex, '<inread-ad></inread-ad>', ""]
- [regex, '<div class="StubhubLink.*?</div>', ""]
- br2nl
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- [regex, '\n{2,}',"\n\n", 's']
- [regex, '\[(\[)',"$1", 's']
- trim
Last Edit: December 16, 2024, 07:49:47 AM by catalonia

catalonia

  • Jr. Member
  • **
  • Posts: 64
Here's that Genius config with bracketed text:

Genius headers.yml
Code
name: Genius  no headers

variables:
    artist:
        type: artist
        filters:
        - strip_diacritics
        - lowercase
        - [replace, "!!!", "chk-chik-chick"]
        - [regex, '(?<=\W|\s)+(feat.+|ft[\W\s]+|(f\.\s)).+', ""]
        - [regex, '\.+|,+|(\W+(?=$))|(^\W+)', ""]
        - [regex, "'", ""]
        - [regex, '(?<=[a-z0-9%])[^\sa-z0-9%]+(?=[a-z0-9%]+)', "-"]
        - [regex, '((?<=\s)([^a-z0-9\s-])+(\s|\W)+)|((?<=\w)([^a-z0-9-])+(\s|\W)+)', " "]
        - [strip_nonascii, -]
    title:
        type: title
        filters: artist

config:
    url: "https://genius.com/{artist}-{title}-lyrics"
    pattern: ['<div data-lyrics-container="true" class="Lyrics-sc-1bcc94c6-1.*?">(?<lyrics>.*)<div class="LyricsFooter-sc-c3476ba7-0.*?">', 's']

post-filters:
- [regex, 'You might also like</div>', "\n"]
- [regex, '<div class="PrimisPlayer.*?>', "\n"]
- [regex, 'Letra de &quot.*?<br/><br/>', ""]
- [regex, '<inread-ad></inread-ad>', ""]
- [regex, '<div class="StubhubLink.*?</div>', ""]
- [regex, '\[(\[)',"$1", 's']
- br2nl
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- [regex, '\[.{1,75}\]', ""]
- [regex, '\n{2,}',"\n\n", 's']
- trim

Genius headers (fuzzy).yml
Code
name: Genius no headers(fuzzy)
loader: search

variables:
    artist:
        type: artist
        filters:
        - lowercase
        
    title:
        type: title
        filters: artist

config:
    identity url: "https://www.google.com/search?q=Genius+{title}+{artist}"
    identity pattern: ['(?<identity>https://genius.com.*?-lyrics)', 's']
    lyrics url: ""
    lyrics pattern: ['<div data-lyrics-container="true" class="Lyrics-sc-1bcc94c6-1.*?">(?<lyrics>.*)<div class="LyricsFooter-sc-c3476ba7-0.*?">', 's']

post-filters:
- [regex, 'You might also like</div>', "\n"]
- [regex, '<div class="PrimisPlayer.*?>', "\n"]
- [regex, 'Letra de &quot.*?<br/><br/>', ""]
- [regex, '<inread-ad></inread-ad>', ""]
- [regex, '<div class="StubhubLink.*?</div>', ""]
- [regex, '\[(\[)',"$1", 's']
- br2nl
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- [regex, '\[.{1,75}\]', ""]
- [regex, '\n{2,}',"\n\n", 's']
- trim
Last Edit: December 16, 2024, 08:52:44 PM by catalonia

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
I guess that in the rush to offer a version to the users he forgot to put it.
I had actually, and that's corrected now (though I didn't update the plugin version number).
I'm also in the process of cleaning up and reviving the providers zip which I assume has a lot of corpses at this point.
Strength and Honour (2025)

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
I'm also in the process of cleaning up and reviving the providers zip which I assume has a lot of corpses at this point.
v1.2.6 is now available for download - I fixed up the Bing source (which is like your hybrid between Deezer and Musixmatch).
I have also cleaned up the optional providers zip. To my surprise, most of them were still working despite not having been updated in more than 2 years. These needed fixing:

- Google
- Lyrics_ovh
- Lyricsify (*)
- Metal Archives (sveakul, I'm surprised you never mentioned that this was down)
- RC Lyrics Band (*)

(*) supports synced lyrics by default.
It also dawned on me that those who don't like synced lyrics can simply add a filter to remove the timestamps rather than dismissing the providers altogether.
For that, one can use something like - [regex, '\[.*?\]', ''] under the post-filters before the trim parameter.

__________

teksty.org and smriti.com didn't make the cut. I don't think those domains exist anymore.

Edit: see below.
Last Edit: December 21, 2024, 03:12:13 PM by Mayibongwe
Strength and Honour (2025)

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10266
(*) supports synced lyrics by default.
It also dawned on me that those who don't like synced lyrics can simply add a filter to remove the timestamps rather than dismissing the providers altogether.
For that, one can use something like \[.*?\] under the post-filters before the trim parameter.
Thanks for the update.

I added \[.*?\] to both YMLs you mentioned and neither is loading. Getting an error "Unknown filter". I tried removing the leading \ and got the same result. I know you said "one can use something like \[.*?\] but not being familiar with regex, or whatever you're using, this isn't working.
Edited YML:
Code
post-filters:
- utf8_encode
- entity_decode
- br2nl
- strip_html
- \[.*?\]
- trim

From the log:
Code
21/12/2024 09:54:40 [DEBUG] Loading config from file: G:\MusicBee\AppData\mb_LyricsReloaded\providers\Lyricsify.yml
21/12/2024 09:54:40 [ERROR] Failed to load a configuration:
21/12/2024 09:54:40 [ERROR] Unknown filter \[.*?\]
21/12/2024 09:54:40 [DEBUG] Loading config from file: G:\MusicBee\AppData\mb_LyricsReloaded\providers\RC Lyrics Band.yml
21/12/2024 09:54:40 [ERROR] Failed to load a configuration:
21/12/2024 09:54:40 [ERROR] Unknown filter \[.*?\]
Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Custom Forum Search
Posting screenshots is here

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
I added \[.*?\] to both YMLs you mentioned and neither is loading.
Amateur hour on my part. It should be - [regex, '\[.*?\]', '']
Thanks for bringing this to attention. Will edit my post right now.
Strength and Honour (2025)

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10266
Amateur hour on my part. It should be - [regex, '\[.*?\]', '']
Thanks for bringing this to attention. Will edit my post right now.
That took care of it. I wouldn't consider  what you did to be "amateur hour." What -I- did was amateur hour in that I had no idea how to correct it and you had the knowledge to fix it. :-)
Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Custom Forum Search
Posting screenshots is here

sveakul

  • Hero Member
  • *****
  • Posts: 3262
v1.2.6 is now available for download - I fixed up the Bing source (which is like your hybrid between Deezer and Musixmatch).
I have also cleaned up the optional providers zip. To my surprise, most of them were still working despite not having been updated in more than 2 years. These needed fixing:

- Google
- Lyrics_ovh
- Lyricsify (*)
- Metal Archives (sveakul, I'm surprised you never mentioned that this was down)
- RC Lyrics Band (*)
Thanks Mayibongwe, great job!  I guess I didn't notice Metal Archives being down due to the fact that I had LRCLIBee placed prior and that thing catches like 90% of everything first it seems.

For those who like to live dangerously, this non-included source's YML still works and can be downloaded here (click on the "Download raw file" button):
https://github.com/mbfrankz/LyricsReloaded/blob/master/LyricsReloaded/Configs/azlyrics.com.yml

I noticed that Bandcamp.yml skipped tracks that my modified Bandcamp2.yml then caught.  The difference in the two is that mine does NOT include line 9 from yours (- [regex, '\s', '']), but just looks like the following:

Code
name: Bandcamp2
loader: search

variables:
    artist:
        type: artist
        filters:
        - lowercase
        
    title:
        type: title
        filters: artist

config:
    identity url: "https://bandcamp.com/search?q={artist}%20{title}&item_type=t"
    identity pattern: ['class="artcont" href="(?<identity>https://.*?)\?', 's']
    lyrics url: ""
    lyrics pattern: ['<meta.*?\d{4}.*?(?<lyrics>\w.*?)">', 's']

post-filters:
- utf8_encode
- entity_decode

An example of a track found by BC2 but not BC is "Black Angel - All or Nothing."  In the log the relevant entries are:

21/12/2024 12:39:04 [DEBUG] Lyrics request: Black Angel - All or Nothing - Cathedral XIII - Bandcamp
21/12/2024 12:39:04 [INFO] Bandcamp tries to load the lyrics...
21/12/2024 12:39:04 [DEBUG] The constructed identity URL: https://bandcamp.com/search?q=blackangel%20all or nothing&item_type=t

21/12/2024 12:39:04 [DEBUG] Lyrics request: Black Angel - All or Nothing - Cathedral XIII - Bandcamp2
21/12/2024 12:39:04 [INFO] Bandcamp2 tries to load the lyrics...
21/12/2024 12:39:04 [DEBUG] The constructed identity URL: https://bandcamp.com/search?q=black angel%20all or nothing&item_type=t

21/12/2024 12:39:04 [WARN] The identity pattern class="artcont" href="(?<identity>https://.*?)\? didn't match!
21/12/2024 12:39:04 [FAIL] no lyrics found from Bandcamp

21/12/2024 12:39:05 [SUCCESS] lyrics found from Bandcamp2!

The lyrics successfully returned from Bandcamp2 (and do match the song) are:

All or Nothing
V1
Oh I don’t care
what you wear
I don’t buy what you’re selling
Stop the tease
It’s junkie sleaze
You don’t hear but I keep on telling
Chorus
I don’t care
what you wear
cos I really don’t give a damn
cos it’s all or nothing
You don’t see
What I see
Cos I really don’t give a damn
Cos you’re all or nothing
V2
What is this
In your kiss
I don’t do that for nothing
In my car
It drives so far
But I’d do that for you
Cos I don’t care
what you wear
cos I really don’t give a damn
cos it’s all or nothing
You don’t see
What I see
Cos I really don’t give a damn
Cos you’re all or nothing
V3
So you can’t stay
You won’t change your way
you say it’s all for the taking
Cos your shoes are cheap
And you ain’t that deep
Feels to me like your faking
Chorus
So I don’t care
what you wear
cos I really don’t give a damn
cos it’s all or nothing
You don’t see
What I see
Cos I really don’t give a damn
Cos you’re all or nothing
Cos I don’t care
what you wear
cos I really don’t give a damn
cos it’s all or nothing
No I don’t care
what you wear
cos I really don’t give a damn
cos it’s all or nothing
Cos you’re all or nothing
Cos It’s all or nothing.

sveakul

  • Hero Member
  • *****
  • Posts: 3262
More on Bandcamp:  your YML does catch certain songs, which in turn are also caught by BC2.  But occasionally as posted above, BC2 catches stuff exclusively.

sveakul

  • Hero Member
  • *****
  • Posts: 3262
One more Bandcamp example:  "Sad & Lonely" by Daughter Darling lyrics not found by supplied YML, but found when line 9 of the YML removed.