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

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1061
  • Heal The World
Copy and paste the content below into an empty text file.
And then save it with a .yml extension e.g. Genius.yml in the following folder ...\MusicBee\AppData\mb_LyricsReloaded\providers
I did not test it yet but this should override the built-in genius version and leave in the square bracket headers (let me know if you'd like the same change done with the fuzzy version).

Code
name: Genius

variables:
    artist:
        type: artist
        filters:
        - strip_diacritics
        - lowercase
        - [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.*?">(?<lyrics>.*)<div class="Lyrics__Footer-sc-', 's']

post-filters:
- br2nl
- [regex, 'You might also like</div>', "\n"]
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- [regex, '\n{2,}',"\n\n", 's']
- trim

Edit: Tested and works as expected for me.
Last Edit: March 12, 2023, 09:18:17 AM by Mayibongwe
I already spend hours on end on social media. Might as well spare a few of those to a greater purpose here.

belomeclone

  • Jr. Member
  • **
  • Posts: 45
Thank you for your help! I made the yml file and copied all that in, but now when I search it's not pulling anything up. The log shows it's finding the URL correctly as well.

sveakul

  • Sr. Member
  • ****
  • Posts: 2469
Check that you have the new yml you made both selected, and in the order you want in Tags(2)/lyrics.  You might want to re-name it first (genius-2.yml, etc.) too to make it easy to distinguish from the built-in one.

BTW, the Beenius plugin for Genius (https://getmusicbee.com/forum/index.php?topic=36605.0) also leaves in the bracketed headers and works fine alongside LyricsReloaded as an additional choice in the sources list.  Be sure to follow the installation directions carefully.

belomeclone

  • Jr. Member
  • **
  • Posts: 45
Check that you have the new yml you made both selected, and in the order you want in Tags(2)/lyrics.  You might want to re-name it first (genius-2.yml, etc.) too to make it easy to distinguish from the built-in one.

BTW, the Beenius plugin for Genius (https://getmusicbee.com/forum/index.php?topic=36605.0) also leaves in the bracketed headers and works fine alongside LyricsReloaded as an additional choice in the sources list.  Be sure to follow the installation directions carefully.

Beenius worked very well in this setup! I do not understand why LyricsReloaded would skip the bracketed information by default, the guidelines for Genius request including it on every song. If you're going to scrape from there that's what you're expecting to see.

sveakul

  • Sr. Member
  • ****
  • Posts: 2469
Glad Beenius is working out for you!

The reason the bracketed portions were taken out was by request, several posters (including me!) preferred the cleaner look.  At the time only one line in the genius.yml affected this, you can try just removing that from the original yml instead of replacing the whole thing: https://getmusicbee.com/forum/index.php?topic=25406.msg200911#msg200911 .  I use both Beenius and the LR version now.

Sekt0r

  • Jr. Member
  • **
  • Posts: 27
Copy and paste the content below into an empty text file.
And then save it with a .yml extension e.g. Genius.yml in the following folder ...\MusicBee\AppData\mb_LyricsReloaded\providers
I did not test it yet but this should override the built-in genius version and leave in the square bracket headers (let me know if you'd like the same change done with the fuzzy version).

Code
name: Genius

variables:
    artist:
        type: artist
        filters:
        - strip_diacritics
        - lowercase
        - [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.*?">(?<lyrics>.*)<div class="Lyrics__Footer-sc-', 's']

post-filters:
- br2nl
- [regex, 'You might also like</div>', "\n"]
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- [regex, '\n{2,}',"\n\n", 's']
- trim

Edit: Tested and works as expected for me.

Thanks for this, I've tested it with a few songs so far and it's working (installed as per your instructions), if it's not too much trouble can I get a fuzzy version as well?

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1061
  • Heal The World
Here you go man.

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

post-filters:
- br2nl
- [regex, 'You might also like</div>', "\n"]
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- [regex, '\n{2,}',"\n\n", 's']
- trim
I already spend hours on end on social media. Might as well spare a few of those to a greater purpose here.


sveakul

  • Sr. Member
  • ****
  • Posts: 2469
It appears that the built-in Genius code in the latest version of the LyricsReloaded plugin is no longer working.  The Beenius plugin continues to draw lyrics from Genius.

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1061
  • Heal The World
Hi sveakul, yeah, looks like Genius made a recent change to their page. Thanks for picking it up.
Redownload the plugin - it should work now.

@Sekt0r and @belomeclone

You guys have to make a change to the code I supplied a few posts back.
In this piece of the lyrics pattern, remove the digit (6) and things should run smoothly again.

class="Lyrics__Container-sc-1ynbvzw-6.*?"
I already spend hours on end on social media. Might as well spare a few of those to a greater purpose here.

sveakul

  • Sr. Member
  • ****
  • Posts: 2469
Hi sveakul, yeah, looks like Genius made a recent change to their page. Thanks for picking it up.
Redownload the plugin - it should work now.
Thank you, working fine now.
Last Edit: March 24, 2023, 08:13:14 PM by sveakul

Sekt0r

  • Jr. Member
  • **
  • Posts: 27
Hi sveakul, yeah, looks like Genius made a recent change to their page. Thanks for picking it up.
Redownload the plugin - it should work now.

@Sekt0r and @belomeclone

You guys have to make a change to the code I supplied a few posts back.
In this piece of the lyrics pattern, remove the digit (6) and things should run smoothly again.

class="Lyrics__Container-sc-1ynbvzw-6.*?"

Thanks, working here too.

Probably unrelated to the recent Genius change but I've noticed some little things with the bracket-enabled versions.

Using this song as an example:
Roy Woods - Don't Love Me - https://genius.com/Roy-woods-dont-love-me-lyrics

1. There is no line break between the first [Verse 1] heading and the first [Chorus] heading (line breaks are fine after that). Happens on any song I've tried, fuzzy and non-fuzzy version. No line-break issues using the built-in ones. Screenshot - https://i.imgur.com/BJac9Il.jpg

2. Only have this one example so far but that same song doesn't get pulled when using the non-fuzzy version but does when using the built-in non-fuzzy version.

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1061
  • Heal The World
My bad. The YML's I gave you earlier were not actually from the latest built-in versions.
Try these ones (both #1 and #2 should be fixed for you):

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

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

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

post-filters:
- [regex, 'You might also like</div>', "\n"]
- [regex, '<div class="PrimisPlayer.*?>', "\n"]
- [regex, 'Letra de &quot.*?<br/><br/>', ""]
- br2nl
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- [regex, '\n{2,}',"\n\n", 's']
- trim
I already spend hours on end on social media. Might as well spare a few of those to a greater purpose here.

Sekt0r

  • Jr. Member
  • **
  • Posts: 27
My bad. The YML's I gave you earlier were not actually from the latest built-in versions.
Try these ones (both #1 and #2 should be fixed for you):

Sweet, all good now. Thanks.

ECHO

  • Newbie
  • *
  • Posts: 2
I couldn't find the information elsewhere so I'll post it here.
For the Windows Store version of MusicBee, I found my plugins folder @:
C:\Users\username\AppData\Local\Packages\StevenMayall.MusicBee\LocalCache\Roaming\MusicBee\Plugins
Where Italics in the path name indicate possible variables according to your installation.
So for adding the yml files from the providers.zip the path was ...\LocalCache\Roaming\MusicBee\\mb_LyricsReloaded\providers

Maybe in a different post as a suggestion it would be nice to change Help --> Support --> Open AppData Folder to open the relevant folder depending on the type of installation, isntead of producing an error when using the Windows Store version.