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

MujikMusical

  • Newbie
  • *
  • Posts: 13
Full documentation, written by the original plug-in author, is in this post.

I think that reference to variables means you can put things like <Artist> or <Title> in the pattern, but you'd have to play with it to make sure.

If you ever get it working feel free to contribute it here and I'll build it in.
Thank you for this information. I will check on this also.

Mauser69

  • Full Member
  • ***
  • Posts: 134
First, I want to thank frakz for taking the lead in keeping this great plugin available to all of us.  Finding correct lyrics can really be a chore sometimes, and this helps a lot.

I do want to comment that the Search Next Provider function for lyrics in MB ONLY works if there are no saved lyrics for a track.  Similarly, if you have options set to automatically save lyrics or use Auto-Tag to update lyrics, then you will ONLY ever see lyrics from the first provider in your list that has lyrics for the track in question, since MB will automatically save the first lyrics it finds, and then it stops looking.  Furthermore, Auto-Tag>Update lyrics from web may find and save lyrics from a source that never shows up if you use Search Next Provider to check each one on your list.  I do not know why that is the case, but I have seen it happen.

It is kind of a drag that there is no way to have MB search for new lyrics without first having to delete any saved ones you have, but I guess that is an issue with the core MB code and not this plugin.

And now just adding a comment on something strange I have encountered:
(not asking for anything, just adding the information here in case it helps someone else understand if they also see it.

I was doing a lot of repetitive testing on one song where several sites had totally wrong lyrics, but GENIUS alone had the correct ones.  I repeated the Search Next Provider function many, many times over a couple of days (getting consistent results each time).  Suddenly, for the same track I had been testing, the returned lyrics totally changed.  CHARTLYRICS, which had been showing  a completely wrong set of lyrics, began returning a totally different wrong set of lyrics.  At the same time, GENIUS suddenly stopped returning any lyrics for that song at all.  I went direct to the GENIUS site and verified the lyrics for that song were still there, so I have no idea why this plugin no longer finds them.  I suspected maybe so many repeats of the lookup I was doing might have triggered something that stopped GENIUS from responding to queries from my address, but that is not the case; I still get lyrics from GENIUS for other tracks on the same album I was testing.

So finding correct lyrics for many songs is still a tedious process, but this plugin does help.  I never used to pay any attention to the lyrics automatically displayed by MB, but now I try to watch them to see if they are correct.  I am now making it a point to save the correct lyrics (when I find them), since it seems that you just cannot trust finding them again tomorrow from the same location!
Last Edit: March 21, 2021, 12:52:31 PM by Mauser69

Crash

  • Newbie
  • *
  • Posts: 6
First, I want to thank frakz for taking the lead in keeping this great plugin available to all of us.  Finding correct lyrics can really be a chore sometimes, and this helps a lot.

I do want to comment that the Search Next Provider function for lyrics in MB ONLY works if there are no saved lyrics for a track.  Similarly, if you have options set to automatically save lyrics or use Auto-Tag to update lyrics, then you will ONLY ever see lyrics from the first provider in your list that has lyrics for the track in question, since MB will automatically save the first lyrics it finds, and then it stops looking.  Furthermore, Auto-Tag>Update lyrics from web may find and save lyrics from a source that never shows up if you use Search Next Provider to check each one on your list.  I do not know why that is the case, but I have seen it happen.

It is kind of a drag that there is no way to have MB search for new lyrics without first having to delete any saved ones you have, but I guess that is an issue with the core MB code and not this plugin.

And now just adding a comment on something strange I have encountered:
(not asking for anything, just adding the information here in case it helps someone else understand if they also see it.

I was doing a lot of repetitive testing on one song where several sites had totally wrong lyrics, but GENIUS alone had the correct ones.  I repeated the Search Next Provider function many, many times over a couple of days (getting consistent results each time).  Suddenly, for the same track I had been testing, the returned lyrics totally changed.  CHARTLYRICS, which had been showing  a completely wrong set of lyrics, began returning a totally different wrong set of lyrics.  At the same time, GENIUS suddenly stopped returning any lyrics for that song at all.  I went direct to the GENIUS site and verified the lyrics for that song were still there, so I have no idea why this plugin no longer finds them.  I suspected maybe so many repeats of the lookup I was doing might have triggered something that stopped GENIUS from responding to queries from my address, but that is not the case; I still get lyrics from GENIUS for other tracks on the same album I was testing.

So finding correct lyrics for many songs is still a tedious process, but this plugin does help.  I never used to pay any attention to the lyrics automatically displayed by MB, but now I try to watch them to see if they are correct.  I am now making it a point to save the correct lyrics (when I find them), since it seems that you just cannot trust finding them again tomorrow from the same location!
Thank you.

I'm trying to import my basedata from minilyrics :P

For the record, the next v3.4 update will accurately record the plugin provider in cached lyrics (for newly cached lyrics, not existing ones) and hence the Next Provider function will work as expected (for the newly cached lyrics)

Nice !
I'm launching a clean install with just some settings like my "lyrics cache folder" and my old <MediaField> settings
Hoping this shit will run fine
Last Edit: April 01, 2021, 05:35:03 AM by Crash

ShotgunStev3

  • Newbie
  • *
  • Posts: 3
Hey frankz! I'm back with another fix for Genius.com  ;D

For both the artist and title filters, add this line:
Code
        - [replace, "&", "and"]
This should go right after the line "-lowercase"
This helps to find any '&' symbols in the artists and titles and replaces them with the word "and" for the URL search.

before: https://genius.com/Mumford-sons-hot-gates-lyrics (no match!)
after: https://genius.com/Mumford-and-sons-hot-gates-lyrics (target acquired!)

Love to see this wonderful plugin still active!

cheezweasel

  • Newbie
  • *
  • Posts: 1
I am having issues getting any of the plugin providers to work.

I deselected the two stock providers (chartlyrics, LoloLyrics) and selected all of the lyrics from the plugin (Genius, etc.). None of my songs are returning lyrics - "Lyrics not found". When i select the two stock lyric providers, the lyrics come up, but are wrong a lot of the time.

The songs are popular songs by bands like Led Zeppelin, The Doors, 311, Marcy Playground, etc. I can also find these lyrics on genius.com with no issue.

I just dl'd the plugin today, so it should be the newest version.

Any ideas?

brandonluciano824

  • Newbie
  • *
  • Posts: 11
Just wondering if there's now a way to fix the Genius Lyrics not showing up. They did a redesign of their website so imagine it can't fetch the lyrics like it did before.

dtcsong

  • Newbie
  • *
  • Posts: 2
Just wondering if there's now a way to fix the Genius Lyrics not showing up. They did a redesign of their website so imagine it can't fetch the lyrics like it did before.

Also seeking a fix for this. 

Thanks for the amazing plugin.

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9356
Not only did Genius update their website, but they made it so you can't highlight and copy the lyrics. Fortunately with Firefox, I can enable Reader Mode and then can copy.

It's quite possible that what they did will prevent frankz from updating the plugin.
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: 3876
Phred is correct. Genius now seems to provide the lyrics in an unusable format (not as html).  See below.  They also seem to be screening for "device type" in the process, which I'm guessing would not even provide this wall of code to a scraper.

There may be a way to handle content of this nature, but if there is it is beyond my meager skills to figure it out as the plugin is not structured to handle it from what I can see.

I'd suggest getting comfortable with the other sources. 
Code
    <script>
      window.__PRELOADED_STATE__ = JSON.parse('{\"currentPage\":\"songPage\",\"deviceType\":\"desktop\",\"session\":{\"cmpEnabled\":false,\"ccpaEnabled\":true,\"showAds\":true,\"logClientMetrics\":false,\"fringeEnabled\":true,\"taboolaEnabled\":false},\"songPage\":{\"song\":3593511,\"pinnedQuestions\":[],\"lyricsData\":{\"body\":{\"children\":[{\"children\":[\"[Verse 1]\",{\"tag\":\"br\"},\"Oh, you think you\'ve got it?\",{\"tag\":\"br\"},\"You know everything about it\",{\"tag\":\"br\"},\"What I do and what I say and what I dream\",{\"tag\":\"br\"},\"But the second I am hungry\",{\"tag\":\"br\"},\"Tappin\' on your window\",{\"tag\":\"br\"},\"Askin\' for my lover, there\'s nothing\",{\"tag\":\"br\"},\"\",{\"tag\":\"br\"},\"[Chorus]\",{\"tag\":\"br\"},\"Now I\'m kickin\' at the concrete\",{\"tag\":\"br\"},\"Wishin\' you would get me\",{\"tag\":\"br\"},\"But that thinkin\' never got me very far\",{\"tag\":\"br\"},\"So I\'ll do us both a favor\",{\"tag\":\"br\"},\"I\'ll catch up with ya later\",{\"tag\":\"br\"},\"It\'s better if I don\'t know where ya are\",{\"tag\":\"br\"},\"\",{\"tag\":\"br\"},\"[Verse 2]\",{\"tag\":\"br\"},\"Now I\'ve been under water\",{\"tag\":\"br\"},\"Watchin\' it all happen\",{\"tag\":\"br\"},\"Tried to count the stars but they just blurred\",{\"tag\":\"br\"},\"In Tulsa, Oklahoma\",{\"tag\":\"br\"},\"I tried to take the spotlight\",{\"tag\":\"br\"},\"Hung my head and wished I was a bird\",{\"tag\":\"br\"},\"\",{\"tag\":\"br\"},\"[Chorus]\",{\"tag\":\"br\"},\"Now I\'m kickin\' at the concrete\",{\"tag\":\"br\"},\"Wishin\' you would get me\",{\"tag\":\"br\"},\"But that thinkin\' never got me very far\",{\"tag\":\"br\"},\"So I\'ll do us both a favor\",{\"tag\":\"br\"},\"I\'ll catch up with ya later\",{\"tag\":\"br\"},\"It\'s better if I don\'t know where ya are\",{\"tag\":\"br\"},\"\",{\"data\":{\"name\":\"desktop_song_lyrics_inread\"},\"tag\":\"inread-ad\"},\"[Bridge]\",{\"tag\":\"br\"},\"The more I tried to own it\",{\"tag\":\"br\"},\"The more your heart went roamin\'\",{\"tag\":\"br\"},\"Hopin\' it would be more than a scar\",{\"tag\":\"br\"},\"\",{\"tag\":\"br\"},\"[Chorus]\",{\"tag\":\"br\"},\"So I\'ll do us both a favor\",{\"tag\":\"br\"},\"I\'ll catch up with ya later\",{\"tag\":\"br\"},\"It\'s better if I don\'t know where ya are\"],\"tag\":\"p\"},\"\"],\"tag\":\"root\"}},\"featuredQuestion\":null,\"showFeaturedQuestion\":false,\"pendingQuestionCount\":0,\"dfpKv\":[{\"values\":[\"3593511\"],\"name\":\"song_id\"}
[many many many lines truncated for length]

ma_t14

  • Sr. Member
  • ****
  • Posts: 2493
Phred is correct. Genius now seems to provide the lyrics in an unusable format (not as html).  

Are you sure about that? I can see both forms in the code.

For example for Manic Street Peachers - She Is Suffering

I can see the following html code, in addition to the script you mentioned:

Code
<div class="Lyrics__Container-sc-1ynbvzw-6 krDVEH">
  <a
    href="/17672105/Manic-street-preachers-she-is-suffering/Verse-1"
    class="ReferentFragment__ClickTarget-oqvzi6-0 evuxZm"
    ><span class="ReferentFragment__Highlight-oqvzi6-1 eZruqd"
      >[Verse 1]</span
    ></a
  ><br />Beauty finds refuge in herself<br />Lovers wrapped inside each others
  lies<br /><a
    href="/4200019/Manic-street-preachers-she-is-suffering/Beauty-is-such-a-terrible-thing-she-is-suffering-yet-more-than-death"
    class="ReferentFragment__ClickTarget-oqvzi6-0 evuxZm"
    ><span class="ReferentFragment__Highlight-oqvzi6-1 eZruqd"
      >Beauty is such a terrible thing<br />She is suffering yet more than
      death</span
    ></a
  ><br /><br />[Chorus]<br /><a
    href="/2214260/Manic-street-preachers-she-is-suffering/She-is-suffering-she-sucks-you-deeper-in-she-is-suffering"
    class="ReferentFragment__ClickTarget-oqvzi6-0 evuxZm"
    ><span class="ReferentFragment__Highlight-oqvzi6-1 eZruqd"
      >She is suffering<br />She sucks you deeper in<br />She is suffering</span
    ></a
  ><br />You exist within her shadow<br /><br />[Verse 2]<br />Beauty she is
  scarred into man's soul<br />A flower attracting lust, vice and sin<br />A
  vine that can strangle life from a tree<br />Carrion, surrounding, picking on
  leaves<br /><br />[Chorus]<br /><a
    href="/2214260/Manic-street-preachers-she-is-suffering/She-is-suffering-she-sucks-you-deeper-in-she-is-suffering"
    class="ReferentFragment__ClickTarget-oqvzi6-0 evuxZm"
    ><span class="ReferentFragment__Highlight-oqvzi6-1 eZruqd"
      >She is suffering<br />She sucks you deeper in<br />She is suffering</span
    ></a
  ><br />You exist within her shadow<br /><br />[Verse 3]<br /><a
    href="/15096087/Manic-street-preachers-she-is-suffering/Beauty-she-poisons-unfaithful-all-stifled-her-touch-is-leprous-and-pale"
    class="ReferentFragment__ClickTarget-oqvzi6-0 evuxZm"
    ><span class="ReferentFragment__Highlight-oqvzi6-1 eZruqd"
      >Beauty she poisons unfaithful all<br />Stifled, her touch is leprous and
      pale</span
    ></a
  ><br />The less she gives the more you need her<br />No thoughts to forget
  when we were children<br />
</div>
<div class="RightSidebar-pajcl2-0 eGLQob">
  <div class="SidebarAd__Container-sc-1cw85h6-0 fzyndU">
    <div class="SidebarAd__Ad-sc-1cw85h6-1 feqDwM">
      <div
        id="div-gpt-ad-desktop_song_lyrics_sidebar-desktop_song_lyrics_sidebar-1"
        class="DfpAd__Container-sc-1tnbv7f-0 kthwUN"
      ></div>
    </div>
  </div>
</div>
<div class="Lyrics__Container-sc-1ynbvzw-6 krDVEH">
  <div class="InreadAd__Container-sc-1pp8jgt-0 hFVRqM">
    <div
      id="div-gpt-ad-desktop_song_lyrics_inread-desktop_song_lyrics_inread-1"
      width="300"
      height="250"
      class="DfpAd__Container-sc-1tnbv7f-0 hpiJis"
    ></div>
  </div>
</div>
<div class="Lyrics__Container-sc-1ynbvzw-6 krDVEH">
  [Chorus]<br /><a
    href="/2214260/Manic-street-preachers-she-is-suffering/She-is-suffering-she-sucks-you-deeper-in-she-is-suffering"
    class="ReferentFragment__ClickTarget-oqvzi6-0 evuxZm"
    ><span class="ReferentFragment__Highlight-oqvzi6-1 eZruqd"
      >She is suffering<br />She sucks you deeper in<br />She is suffering</span
    ></a
  ><br /><a
    href="/13140817/Manic-street-preachers-she-is-suffering/Natures-lukewarm-pleasure"
    class="ReferentFragment__ClickTarget-oqvzi6-0 evuxZm"
    ><span class="ReferentFragment__Highlight-oqvzi6-1 eZruqd"
      >Nature's lukewarm pleasure</span
    ></a
  >
</div>

frankz

  • Sr. Member
  • ****
  • Posts: 3876
I missed that.  In my "View Source" (chrome) it looks very different.  It's all one line when I paste it into Notepad++.

But it's a positive development.  If anyone can come up with a YML that captures the lyrics from that I will gladly integrate it into the plugin and update.  You can test by placing it with the extension YML in your providers folder under the plugin's folder.  The original Genius YML to use as a starting point is here.  Documentation about how to create YML files is here. You'll need to update the "pattern:" line.

Alternately, if someone wants to fork the plugin and take over maintenance, I'd be happy to close this thread with a link to the new version's thread.  The scope of the requests to update seems to have gone beyond the scope of my ability to satisfy them, and I feel bad about it.  I've been pretty clear that I'm limited by skill to adding new providers with scripts provided by others, deleting old outdated providers, and pushing new versions.  I'm an OK tinkerer but a pretty terrible creator.
Last Edit: June 03, 2021, 01:00:10 PM by frankz

LazR

  • Jr. Member
  • **
  • Posts: 20
I was able to find a site that seems to just scrape lyrics from Genius or some user is just copy and pasting them straight over with the correct HTML formatting. Here is the code for it. Only problems I have noticed are that sometimes there are ads in-between the lyrics so it has a bunch of extra spaces and the googleads link -- couldn't regex it. Also there isn't always two space breaks before a new lyric section (ex [Chorus], [Verse], etc) so it doesn't look super clean. But a start, for some artists not included in other large sites.  


Code
name: "Genius Lyrics Ripoff"

variables:
    artist:
        type: artist
        filters:
        - strip_diacritics
        - lowercase
        - [replace, "!!!", "chk-chik-chick"]    # !!! (Chk Chk Chk) artist exception
        - [regex, '(?<=\W|\s)+(feat.+|ft[\W\s]+|(f\.\s)).+', ""]
                                                # ^ Strip F./ft/eat/uring + everything after
        - [regex, '\s&(?=\s)', " and"]          # Replace " &" with " and"
                                                    ## ^ Currently superfluous (for ARTIST) bc plugin preemptively replaces "&" with "and"
                                                        ### ^ But still necessary for <title> "&" replacement
        - [regex, '\.+|,+|(\W+(?=$))|(^\W+)', ""]   # Strip "." + "," + beginning/end of string non-word chars
        - [regex, "'", ""]                      # Separate expression bc of annoying way YAML escapes '
        - [regex, '(?<=[a-z0-9%])[^\sa-z0-9%]+(?=[a-z0-9%]+)', "-"]
                                                # ^ Replace medial non-alphanumeric char(s) with single "-" e.g., f**k > f-k
        - [regex, '((?<=\s)([^a-z0-9\s-])+(\s|\W)+)|((?<=\w)([^a-z0-9-])+(\s|\W)+)', " "]
                                                # ^ Clean up any remaining successive non-alphanumeric chars before strip_nonascii
                                                    ## ^ Long & stupid bc couldn't figure out YAML-friendly non-capturing "(?:...)"
                                                        ### ^ EZ version: [regex, '\W+(?:\W)(?<!$)', " "]
        - [strip_nonascii, -]
    title:
        type: title
        filters: artist

config:
    url: "http://genius-lyrics.com/{title}-lyrics-{artist}"
    pattern: ['<p style="text-align: center;">(?<lyrics>.+?)<h2 style="text-align: center;">', s]

post-filters:
- strip_html
- clean_spaces
- utf8_encode
- [regex, '<!-- 2020 POST 3 -->', ""]

- [regex, 'googletag.*\);', "\n"]

frankz

  • Sr. Member
  • ****
  • Posts: 3876
Thanks for putting that together.  I'm going to hold off on adding it for the time being because I'm not sure how I feel about building something into the plugin itself that will unavoidably insert spam text into lyrics.   I'm going to have to think on that.

Also, the site seems to be quite minor. As near as I can tell, the English side only has lyrics for about 17,000 songs, and English is the high point.  Spanish language is about 330 songs, Italian 130, etc.

I appreciate the effort and skill though and, as a reminder, anyone can copy this to a text file on their computer, save it with a .yml extension, and put it into the "providers" folder that sits under the plugin's folder to use it right now.

Good work.

Redearth

  • Jr. Member
  • **
  • Posts: 38
I was able to find a site that seems to just scrape lyrics from Genius or some user is just copy and pasting them straight over with the correct HTML formatting. Here is the code for it. Only problems I have noticed are that sometimes there are ads in-between the lyrics so it has a bunch of extra spaces and the googleads link -- couldn't regex it. Also there isn't always two space breaks before a new lyric section (ex [Chorus], [Verse], etc) so it doesn't look super clean. But a start, for some artists not included in other large sites.

Thanks for putting that together.  I'm going to hold off on adding it for the time being because I'm not sure how I feel about building something into the plugin itself that will unavoidably insert spam text into lyrics.   I'm going to have to think on that.

Also, the site seems to be quite minor. As near as I can tell, the English side only has lyrics for about 17,000 songs, and English is the high point.  Spanish language is about 330 songs, Italian 130, etc.

I appreciate the effort and skill though and, as a reminder, anyone can copy this to a text file on their computer, save it with a .yml extension, and put it into the "providers" folder that sits under the plugin's folder to use it right now.

I got excited for a moment cos I thought it was a fix for the real Genius, but I went ahead and fixed it anyway cos I'm tired of nothing working:

Code
name: "Genius-Lyrics"

variables:
    artist:
        type: artist
        filters:
        - strip_diacritics
        - lowercase
        - [replace, "!!!", "chk-chik-chick"]    # !!! (Chk Chk Chk) artist exception
        - [regex, '(?<=\W|\s)+(feat.+|ft[\W\s]+|(f\.\s)).+', ""]
        - [regex, '\s&(?=\s)', " and"]
        - [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: "http://genius-lyrics.com/{title}-lyrics-{artist}"
    pattern: ['<p style="text-align: center;">(?<lyrics>.+?)<h2 style="text-align: center;">', s]

post-filters:
- [regex, "<div class='code-block.*?</script></div>", "", s]
- strip_html
- clean_spaces
- utf8_encode
- [regex, '^\[', "\n[", m]
- clean_spaces
- trim

It actually works really well for the artists that are on the site. No ads, only lyrics, properly spaced.

I think I'm getting a yaml for the actual Genius too, but it's really complicated. Just nothing else works anymore, this plugin needs updating.
Last Edit: August 22, 2021, 12:42:30 AM by Redearth

Redearth

  • Jr. Member
  • **
  • Posts: 38
Hi, I have been trying to work on adding Darklyrics as a provider and there is one thing that would make it easier. In the example configuration there is a comment that says that variables are also allowed in the pattern, does anyone knows how? Thanks
Full documentation, written by the original plug-in author, is in this post.

I think that reference to variables means you can put things like <Artist> or <Title> in the pattern, but you'd have to play with it to make sure.

If you ever get it working feel free to contribute it here and I'll build it in.
Thank you for this information. I will check on this also.

Unfortunately this doesn't look to be correct.
I responded to the Github issue here: https://github.com/mbfrankz/LyricsReloaded/issues/7
Might help to update that part of the documentation.