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

sveakul

  • Sr. Member
  • ****
  • Posts: 2463
Maybe I'm misremembering but finding lyrics worked flawlessly some years ago for me while cycling through the providers option. As for the artist pictures, I'm just content with getting the lyrics and album artwork tag, so no worries there. At least the album art works almost always.
You still haven't said if you downloaded the latest version of the plugin.  Also, if you read the latter part of this forum as I initially advised, you'll see that some sources that went inactive due to site changes have since been fixed through contributions of newer yml files--Genius and MusixMatch are two of these--that now produce all kinds of results if downloaded from the relevant posts and put in your "C:\...\AppData\mb_LyricsReloaded\providers" directory.

Tybot

  • Sr. Member
  • ****
  • Posts: 336
The updated yml's are very much appreciated! My lyrics fetching have been kind of shitty for a while now and I couldn't be bothered to fix it, but the last pages of this thread solved everything.

Don't know if this is something Genius added recently, but there's a string just above the lyrics "(song title) Lyrics" that are being fetched as well by the latest yml. Example: https://genius.com/Britney-spears-toxic-lyrics

If someone has a regex that could remove the first line (good/bad solution?), then that would be awesome.

sveakul

  • Sr. Member
  • ****
  • Posts: 2463
The following (complete) yml has the fix by LazR that removes the "(title) Lyrics" line in Genius.  You will have to re-select it in your prefs if keeping the name-with-date, or change it in code to match what you use now:

Code
name: Genius (2022-1-27)

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__Container-sc-1ynbvzw-6 jYfhrf">(?<lyrics>.*)<div class="Lyrics__Footer-sc-', 's']

post-filters:
- br2nl
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- [regex, '\[.{1,75}\]', ""]
- [regex, '\n{2,}',"\n\n", 's']
- trim

Tybot

  • Sr. Member
  • ****
  • Posts: 336
The following (complete) yml has the fix by LazR that removes the "(title) Lyrics" line in Genius.  You will have to re-select it in your prefs if keeping the name-with-date, or change it in code to match what you use now:

Code
name: Genius (2022-1-27)

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__Container-sc-1ynbvzw-6 jYfhrf">(?<lyrics>.*)<div class="Lyrics__Footer-sc-', 's']

post-filters:
- br2nl
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- [regex, '\[.{1,75}\]', ""]
- [regex, '\n{2,}',"\n\n", 's']
- trim

Great. Now I feel really stupid. Thought I was using the latest one but it was 2021-11-30. 2022-01-27 worked perfectly. Thanks a lot to both of you!

SkyZippr

  • Jr. Member
  • **
  • Posts: 121
This is more of a note to myself.
In case anyone prefers to keep those section headers (stuff like [Verse 1:], [Chorus:]) from Genius, but also hates that sometimes there's no blank line between the sections to properly set them apart, here's what my post-filters look like:
Code
post-filters:
- br2nl
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- [regex, '\[',"\n["]
- [regex, '\n{2,}',"\n\n", 's']
- trim
I don't know much about regex, but this is working for me so far.

LazR

  • Jr. Member
  • **
  • Posts: 20
This is more of a note to myself.
In case anyone prefers to keep those section headers (stuff like [Verse 1:], [Chorus:]) from Genius, but also hates that sometimes there's no blank line between the sections to properly set them apart, here's what my post-filters look like:
Code
post-filters:
- br2nl
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- [regex, '\[',"\n["]
- [regex, '\n{2,}',"\n\n", 's']
- trim
I don't know much about regex, but this is working for me so far.

Thank you for that, for some reason I could not figure that one out!

belomeclone

  • Jr. Member
  • **
  • Posts: 45
I've seen some posts with the data printout, but how can I see why Lyrics Reloaded is failing to scrape a song? I have a song that it fails to scrape from Genius and I can't understand why. I don't NEED it to scrape from Genius, but now I'm curious! Everything seems to match just fine!

Is there a way to show that? I don't scrape to add to the files (though I might), I scrape to add to the cache, so if it's a feature that's only visible there I'll have to explore that.

EDIT: I'm guessing it's having trouble with the parentheses when they are part of the song title. Did I miss a fix for that? I don't understand yml or what language it is in, but in my yml file for Genius I see only this for title. I'm guessing it needs to be added on to?
Quote
   title:
        type: title
        filters: artist
Last Edit: March 23, 2022, 05:51:10 AM by belomeclone

sveakul

  • Sr. Member
  • ****
  • Posts: 2463
Copy the code as-is from this post and save it to a text file;  then, rename the file "genius.yml":  https://getmusicbee.com/forum/index.php?topic=25406.msg198321#msg198321 .

Then, move the new file genius.yml into the folder MusicBee\AppData\mb_LyricsReloaded\providers, overwriting any file of the same name.  If you have the Installer version of MB the path is probably like C:\Users\(username)\AppData.. etc.  If you have the Windows Store version you can't do this at all;  I recommend you move to the Portable version.

Next, go into MB Preferences/Tags(2)/auto-tagging/lyrics, press the "..." button next to the lyrics box, and in the source choices check "Genius (2022-1-27)", and uncheck any other Genius entry (techniques here may vary, this is what I do).  Hit the "Update" button, then Save.

This will give you working Genius lyrics retrieval.  Follow the same general procedure for A-Z Lyrics Universe (https://getmusicbee.com/forum/index.php?topic=25406.msg196786#msg196786) and MusixMatch (use the second code script from the post at https://getmusicbee.com/forum/index.php?topic=25406.msg195077#msg195077).

Tweaks to the Genius code to provide different results in spacing, etc. can be found in other posts on the thread.


belomeclone

  • Jr. Member
  • **
  • Posts: 45
Copy the code as-is from this post and save it to a text file;  then, rename the file "genius.yml":  https://getmusicbee.com/forum/index.php?topic=25406.msg198321#msg198321 .

Then, move the new file genius.yml into the folder MusicBee\AppData\mb_LyricsReloaded\providers, overwriting any file of the same name.  If you have the Installer version of MB the path is probably like C:\Users\(username)\AppData.. etc.  If you have the Windows Store version you can't do this at all;  I recommend you move to the Portable version.

Next, go into MB Preferences/Tags(2)/auto-tagging/lyrics, press the "..." button next to the lyrics box, and in the source choices check "Genius (2022-1-27)", and uncheck any other Genius entry (techniques here may vary, this is what I do).  Hit the "Update" button, then Save.

This will give you working Genius lyrics retrieval.  Follow the same general procedure for A-Z Lyrics Universe (https://getmusicbee.com/forum/index.php?topic=25406.msg196786#msg196786) and MusixMatch (use the second code script from the post at https://getmusicbee.com/forum/index.php?topic=25406.msg195077#msg195077).

Tweaks to the Genius code to provide different results in spacing, etc. can be found in other posts on the thread.

I have the proper yml for Genius. It just is having trouble with songs that have a parenthesis in their name it seems.

This is my yml

Quote
name: Genius (2022-1-27)

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__Container-sc-1ynbvzw-6 jYfhrf">(?<lyrics>.*)<div class="Lyrics__Footer-sc-', 's']

post-filters:
- br2nl
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- [regex, '\[',"\n["]
- [regex, '\n{2,}',"\n\n", 's']
- trim

LazR

  • Jr. Member
  • **
  • Posts: 20
Wouldn't using
Code
- [regex, '\s&(?=\s)', " and"]
be better than
Code
- [regex, '((?<=\s)([^a-z0-9\s-])(\s|\W)+)|((?<=\w)([^a-z0-9-])+(\s|\W)+)', " "]
for artist filters because Genius changes '&' to 'and' in URLs? Is there something else that the current longer regex also does that I can't figure out?

belomeclone

  • Jr. Member
  • **
  • Posts: 45
Wouldn't using
Code
- [regex, '\s&(?=\s)', " and"]
be better than
Code
- [regex, '((?<=\s)([^a-z0-9\s-])(\s|\W)+)|((?<=\w)([^a-z0-9-])+(\s|\W)+)', " "]
for artist filters because Genius changes '&' to 'and' in URLs? Is there something else that the current longer regex also does that I can't figure out?

I made this change and lyrics are now pulling from Genius for artists like Hall & Oates!! Your knowledge of how Genius works is impressive!
Any idea what in the code is causing it to not recognize parenthesis correctly? I have two songs, one the regular and one with a (Remix) tag at the end. It matches what's on Genius, but it pulls the regular song lyrics for both files.
Last Edit: April 10, 2022, 06:47:41 AM by belomeclone

brazyj

  • Newbie
  • *
  • Posts: 3
Copy the code as-is from this post and save it to a text file;  then, rename the file "genius.yml":  https://getmusicbee.com/forum/index.php?topic=25406.msg198321#msg198321 .

Then, move the new file genius.yml into the folder MusicBee\AppData\mb_LyricsReloaded\providers, overwriting any file of the same name.  If you have the Installer version of MB the path is probably like C:\Users\(username)\AppData.. etc.  If you have the Windows Store version you can't do this at all;  I recommend you move to the Portable version.

Next, go into MB Preferences/Tags(2)/auto-tagging/lyrics, press the "..." button next to the lyrics box, and in the source choices check "Genius (2022-1-27)", and uncheck any other Genius entry (techniques here may vary, this is what I do).  Hit the "Update" button, then Save.

This will give you working Genius lyrics retrieval.  Follow the same general procedure for A-Z Lyrics Universe (https://getmusicbee.com/forum/index.php?topic=25406.msg196786#msg196786) and MusixMatch (use the second code script from the post at https://getmusicbee.com/forum/index.php?topic=25406.msg195077#msg195077).

Tweaks to the Genius code to provide different results in spacing, etc. can be found in other posts on the thread.

I have the proper yml for Genius. It just is having trouble with songs that have a parenthesis in their name it seems.

This is my yml

Quote
name: Genius (2022-1-27)

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__Container-sc-1ynbvzw-6 jYfhrf">(?<lyrics>.*)<div class="Lyrics__Footer-sc-', 's']

post-filters:
- br2nl
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- [regex, '\[',"\n["]
- [regex, '\n{2,}',"\n\n", 's']
- trim

Is there a way to remove [Intro], [Chorus], [Verse], etc ?

sveakul

  • Sr. Member
  • ****
  • Posts: 2463
Is there a way to remove [Intro], [Chorus], [Verse], etc ?
If you mean from Genius, the code at the post below already does that, thanks to a mod by frankz:
https://getmusicbee.com/forum/index.php?topic=25406.msg198321#msg198321

RetroGameReaper

  • Newbie
  • *
  • Posts: 18
Is there a way to make it so the script can read
Code
’ ( )
signs? I don't know how to make my own script since YAML is new to me. I took a script from here
Code
name: Genius (2022-1-27)

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__Container-sc-1ynbvzw-6 jYfhrf">(?<lyrics>.*)<div class="Lyrics__Footer-sc-', 's']

post-filters:
- br2nl
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- [regex, '\[',"\n["]
- [regex, '\n{2,}',"\n\n", 's']
- trim

This is the log file when using tracks with an apostrophe and parenthesis:
Code
18/04/2022 08:28:06 [DEBUG] Lyrics request: Andrew Jackson Jihad - We Didn’t Come Here To Rock - Can’t Maintain - Genius (2022-1-27)
18/04/2022 08:28:06 [INFO] Genius (2022-1-27) tries to load the lyrics...
18/04/2022 08:28:06 [DEBUG] The constructed URL: https://genius.com/andrew-jackson-jihad-we-didn-t-come-here-to-rock-lyrics
18/04/2022 08:28:06 [INFO] No lyrics found.
18/04/2022 08:28:06 [DEBUG] no lyrics found from Genius (2022-1-27)
18/04/2022 08:28:23 [DEBUG] Lyrics request: Andrew Jackson Jihad - Olde(y) Tyme - Can’t Maintain - Genius (2022-1-27)
18/04/2022 08:28:23 [INFO] Genius (2022-1-27) tries to load the lyrics...
18/04/2022 08:28:23 [DEBUG] The constructed URL: https://genius.com/andrew-jackson-jihad-olde-y-tyme-lyrics
18/04/2022 08:28:23 [INFO] No lyrics found.
18/04/2022 08:28:23 [DEBUG] no lyrics found from Genius (2022-1-27)
18/04/2022 08:28:39 [DEBUG] Lyrics request: Andrew Jackson Jihad - Kazoo Sonata In Cmaj - Can’t Maintain - Genius (2022-1-27)
18/04/2022 08:28:39 [INFO] Genius (2022-1-27) tries to load the lyrics...
18/04/2022 08:28:39 [DEBUG] The constructed URL: https://genius.com/andrew-jackson-jihad-kazoo-sonata-in-cmaj-lyrics
18/04/2022 08:28:40 [DEBUG] gzip compression detected
18/04/2022 08:28:40 [WARN] The pattern <div data-lyrics-container="true" class="Lyrics__Container-sc-1ynbvzw-6 jYfhrf">(?<lyrics>.*)<div class="Lyrics__Footer-sc- didn't match!
18/04/2022 08:28:40 [INFO] No lyrics found.
18/04/2022 08:28:40 [DEBUG] no lyrics found from Genius (2022-1-27)
18/04/2022 08:34:03 [DEBUG] Received a notification of type TagsChanging
18/04/2022 08:35:16 [DEBUG] Received a notification of type TagsChanging
18/04/2022 08:39:05 [DEBUG] Received a notification of type TagsChanging
18/04/2022 08:44:43 [DEBUG] Lyrics request: Aimee Mann - That’s Just What You Are - I’m With Stupid - Genius (2022-1-27)
18/04/2022 08:44:43 [INFO] Genius (2022-1-27) tries to load the lyrics...
18/04/2022 08:44:43 [DEBUG] The constructed URL: https://genius.com/aimee-mann-that-s-just-what-you-are-lyrics
18/04/2022 08:44:44 [INFO] No lyrics found.
18/04/2022 08:44:44 [DEBUG] no lyrics found from Genius (2022-1-27)

I noticed that for songs with an apostrophe, Genius ignores the sign in the URL. Ex: That’s Just What You Are --> https://genius.com/Aimee-mann-thats-just-what-you-are-lyrics
The same goes for parenthess: Olde(y) Tyme(y) --> https://genius.com/Ajj-oldey-tymey-lyrics