Author Topic: LyricsReloaded  (Read 241894 times)

Moshi_

  • Full Member
  • ***
  • Posts: 133
  • http://www.last.fm/user/Moshi_
+1 for genius.com

Exceptional lyrics site!!! We need to have a proper working plugin version for it!

XarsYs

  • Guest
Hi! I would like to request an actual solution to the Genius lyrics - they are such a quality lyric site and I would love it if I would be able to have lyrics from that source. Especially for all my underground rap songs, they are simply not found on other sites.

I tried editing the configuration file but then it won't load the plugin. Probably some hashsum check or something, I really don't know what I am doing :S

Thanks!

I was able to fix it previously, but lost the files that I edited so I am not really sure how I did it, but if I was able to do it then I am sure it is quite an easy fix for the coder of the plugin, however he has known about this issue for quite some time (see my other posts in this thread) and has shown pretty much no interest in fixing it so I wouldn't hold my breath if I were you.

Could you at least remember what program you used to correct it? I tried manually editing, then I tried some weird .dll decompiler but the one I used could not alter everything properly but I was able to find the wrong part at least, just not edit it :S

So that could help, if I manage to fix it you bet I will post the fix here too... Genius is the best, really.


J24

  • Jr. Member
  • **
  • Posts: 75
  • Love music of all genres and cultures
For some reason Genius.com and other sites like A-Z Lyrics and LyricWiki are not able to retrieve the lyrics of songs that have parentheses in them. For example, it can't find "The Miracle (Of Joey Ramone)", "California (There Is No End to Love)", or "Iris (Hold Me Close)". However, SongLyrics.com can find them. Metrolyrics can find them too but stanza divisions are lost.

EDIT: Actually, I think A-Z Lyrics is not working at all, even with songs that don't have parentheses.
Last Edit: May 05, 2015, 02:45:47 PM by Jorge24
I'm addicted to meth, that is, methadata.
Wanna share music recommendations? add me on Last.fm!

J24

  • Jr. Member
  • **
  • Posts: 75
  • Love music of all genres and cultures
I see, would you know why A-Z Lyrics is not working with songs that don't have parentheses either?
Looking at the log file I can see that the right URL was created but it doesn't load the lyrics in MB.

Here's what the log file says:
[DEBUG] The constructed URL: http://www.azlyrics.com/lyrics/u2/thetroubles.html
[DEBUG] gzip compression detected
[DEBUG] lyrics found
I'm addicted to meth, that is, methadata.
Wanna share music recommendations? add me on Last.fm!

J24

  • Jr. Member
  • **
  • Posts: 75
  • Love music of all genres and cultures
The site is not down for me now though, I can open the URLs from the log file in my Firefox browser but still can't retrieve the lyrics in MB.
I'm addicted to meth, that is, methadata.
Wanna share music recommendations? add me on Last.fm!

imnotgerardo

  • Newbie
  • *
  • Posts: 2
  • Yes
Forgive me as I'm not as experienced as the rest of you, but I went to the first page of the thread and downloaded the latest version. Was there ever a fix to every provider showing up as 'MUSICBEE PLUGIN' ? Also I'm pretty sure Genius is still not working as lyrics that are on the site result in No lyrics found.

Just trying to keep this alive so we can all solve this

Moshi_

  • Full Member
  • ***
  • Posts: 133
  • http://www.last.fm/user/Moshi_
Here is how to add Genius.com as a provider with this plugin.

1. Save the following code as a text file named "genius.com.yml"

2. Place the file in <MusicBee's appdata folder>/mb_LyricsReloaded/providers/ folder (the folder already exists if the plugin is enabled)

3. Now you will see "Genius" entry from the lyrics providers list in Preferences> Tags(2)> lyrics setting.


Thank you so much for this!!!

emmaoninternet

  • Jr. Member
  • **
  • Posts: 25
Here is how to add Genius.com as a provider with this plugin.

1. Save the following code as a text file named "genius.com.yml"

2. Place the file in <MusicBee's appdata folder>/mb_LyricsReloaded/providers/ folder (the folder already exists if the plugin is enabled)

3. Now you will see "Genius" entry from the lyrics providers list in Preferences> Tags(2)> lyrics setting.
Indeed, thank you, redwing, for posting that extremely helpful Genius.com provider template. I started using it awhile ago and eventually realized that it was having issues retrieving lyrics for some tracks/artists with various punctuation patterns, so I decided to take a look at the log and see what was up. And then I accidentally spent waaaaaaaay too much time discovering all the annoying variations in how lyrics sites format artist+title strings and flexing my puny regex muscles, with the aid of Pythex.org.

The result of my nerdocity is a modified Genius.com provider config + a config for Musixmatch.com. Neither are 100%, of course, but I tested it with a bunch of stupid character-containing bands and song titles and, while I'm quite sure that both configs could be significantly cleaned up by utilizing some of the built-in plugin filters and less terrible regex skillz, they seem to get the job done most of the time. They will, however, both still fail on song titles with parentheses, as the plugin strips everything on and after the 1st "(" before being scrubbed by the provider config (plus, feat. <artist> patterns are all over the place, so F that).



Anyway, here's my modified code for Genius (see redwing's original instructions for how to install)
Code: genius.com.yml
name: "Genius"

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, '(?<=[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.com/{artist}-{title}-lyrics"
    pattern: ['<div\s+class="lyrics"[^>]*?>(?<lyrics>.*?)</div>', s]

post-filters:
- strip_html
- clean_spaces
- utf8_encode



For Musixmatch, copy/paste below code to a text file named "musixmatch.com.yml", save to MusicBee's <appdata folder>/mb_LyricsReloaded/providers/, open Musicbee and add new Musixmatch provider from Preferences > Tags (2) > Auto-tagging > Lyrics [...]
Code: musixmatch.com.yml
name: "Musixmatch"

variables:
    artist:
        type: artist
        filters:
        - strip_diacritics
        - lowercase
        - [replace, "!!!", "artist-46206"]      # !!! (Chk Chk Chk) artist exception
        - [replace, "+/-", "p%m"]               # +/- artist janky exception (step 1)
        - [regex, '(?<=\W|\s)+(feat.+|ft[\W\s]+|(f\.\s)).+', ""]
                                                # ^ Strip F./ft/eat/uring + everything after
        - [regex, '[’'']+', "%27"]              # URL encode "'/’" bc MM is cool w/ dat shit
        - [regex, '\s&\s(?=the)', " and "]      # ONLY if succeeded by "the", replace " & " with " and "
                                                    ## ^ Currently superfluous bc plugin preemptively replaces "&" with "and"
                                                        ### ^ So MM will choke if <artist> contains "& (?!the)"
        - [regex, '(?<=[a-z0-9%])[^\sa-z0-9%]+(?=[a-z0-9%]+)', "-"]
                                                # ^ Replace medial non-alphanumeric char(s) with single "-" (except "'") e.g., M.I.A. > M-I-A.
        - [regex, '\W+(?=$)', ""]               # Strip end-of-string non-word chars
        - [regex, '((?<=\s)([^a-z0-9\s-])+(\s|\W)+)|((?<=\w)([^a-z0-9-])+(\s|\W)+)', " "]
                                                # ^ Clean up any remaining successive non-alphanumeric char(s) before strip_nonascii
                                                    ## ^ Long & stupid bc couldn't figure out YAML-friendly non-capturing "(?:...)"
                                                        ### EZ version: [regex, '\W+(?:\W)(?<!$)', " "]
        - [strip_nonascii, -]
        - [replace, "-27", "%27"]               # Fix "'/’" URL encoding after strip_nonascii
        - [regex, '(?<=^)p-m', "-"]             # Janky replace for artist +/- after strip_nonascii (step 2)
    title:
        type: title
        filters:                                # Not using identical artist filters due to different treatment of "&" in titles vs artist names
                                                # Musixmatch strips "&" from <title> ALWAYS; from <artist> too, *unless* "& the", then replaced with "and"
                                                    ## ^ see "&" treatment note above, under 'artist'
        - strip_diacritics
        - lowercase
        - [regex, '(?<=\W|\s)+(feat.+|ft[\W\s]+|(f\.\s)).+', ""]
                                                # ^ Strip F./ft/eat/uring + everything after
        - [regex, '[’'']+', "%27"]              # URL encode "'/’" bc MM is cool w/ dat shit
        - [regex, '(?<=[a-z0-9%])[^\sa-z0-9%]+(?=[a-z0-9%]+)', "-"]
                                                # ^ Replace medial non-alphanumeric char(s) with single "-" (except "'") e.g., f**k > f-k
        - [regex, '\W+(?=$)', ""]               # Strip end-of-string non-word chars
        - [regex, '((?<=\s)([^a-z0-9\s-])+(\s|\W)+)|((?<=\w)([^a-z0-9-])+(\s|\W)+)', " "]
                                                # ^ Clean up any remaining successive non-alphanumeric char(s) before strip_nonascii
        - [strip_nonascii, -]
        - [replace, "-27", "%27"]               # Fix "'/’" URL encoding after strip_nonascii

config:
    url: "http://www.musixmatch.com/lyrics/{artist}/{title}"
    pattern: ['<span\s+id="lyrics-html"[^>]*?>(?<lyrics>.*?)</span>', s]

post-filters:
- utf8_encode

* I included my comments, just in case anyone wants to take stab at updating or modifying my very silly regex and wants to know what the hell I was thinking (delete at will - they have no effect on functionality).

So, yeah, with both Genius and Musixmatch as my #1 & #2 lyrics providers, I wanna say like 90% of my 25K songs now come with bonus words. Yay and thanks again redwing and, of course, quick_wango!


* Edit: 2015.09.02 10:30 PST - added featured artist stripping to both configs
* Edit: 2015.09.11 13:10 PST - updated both configs to handle curly apostrophes like straight ( -> ' )
Last Edit: September 11, 2015, 09:12:35 PM by emmaoninternet

Moshi_

  • Full Member
  • ***
  • Posts: 133
  • http://www.last.fm/user/Moshi_
Thank you, emmaoninternet!!!

This genius.com modification is really better!!

Have you found a way to ignore features in the artist field? Because they screw up the search and nothing is found.

Before your modification, I couldn't grab lyrics from genius for this song:

Macklemore & Ryan Lewis - Wing$

Because genius.com had it as Macklemore And Ryan Lewis. Now it grabs it perfectly fine.

But for this:

Macklemore & Ryan Lewis feat. Ray Dalton - Can't Hold Us

I still can't grab it because it has feat. in it. Is there a way to make it ignore feat.?

emmaoninternet

  • Jr. Member
  • **
  • Posts: 25
But for this:

Macklemore & Ryan Lewis feat. Ray Dalton - Can't Hold Us

I still can't grab it because it has feat. in it. Is there a way to make it ignore feat.?
Ah, yes, most of of my recent library has all artists cleaned up to have "feat" artists in the separate <Artists: Guest> tag, so I didn't bother much with that originally, but yeah it probably makes a difference if you have it all in the artist field or at the end of the song title. Genius, especially tends to not include any of that in the URL, whereas Musixmatch seems to be pretty good about redirecting and/or will even have 2 separate listings (1 with feat artist crap, 1 without), but that's more inconsistent.

I updated both in their respective code sections in my previous post so they'll now strip everything on/after f./ft./feat/./featuring.

cubedparadox

  • Guest
Thanks emmaoninternet, I can't believe someone actually implemented musixmatch support! Now I just need lyric syncing, and I'll be able to ditch minilyrics!

Moshi_

  • Full Member
  • ***
  • Posts: 133
  • http://www.last.fm/user/Moshi_
Wow! It works beautifully now, emmaoninternet!!!

Thank you so much!!


Bigmelwalter

  • Jr. Member
  • **
  • Posts: 106
Here is how to add Genius.com as a provider with this plugin.

1. Save the following code as a text file named "genius.com.yml"

2. Place the file in <MusicBee's appdata folder>/mb_LyricsReloaded/providers/ folder (the folder already exists if the plugin is enabled)

3. Now you will see "Genius" entry from the lyrics providers list in Preferences> Tags(2)> lyrics setting.
Indeed, thank you, redwing, for posting that extremely helpful Genius.com provider template. I started using it awhile ago and eventually realized that it was having issues retrieving lyrics for some tracks/artists with various punctuation patterns, so I decided to take a look at the log and see what was up. And then I accidentally spent waaaaaaaay too much time discovering all the annoying variations in how lyrics sites format artist+title strings and flexing my puny regex muscles, with the aid of Pythex.org.

The result of my nerdocity is a modified Genius.com provider config + a config for Musixmatch.com. Neither are 100%, of course, but I tested it with a bunch of stupid character-containing bands and song titles and, while I'm quite sure that both configs could be significantly cleaned up by utilizing some of the built-in plugin filters and less terrible regex skillz, they seem to get the job done most of the time. They will, however, both still fail on song titles with parentheses, as the plugin strips everything on and after the 1st "(" before being scrubbed by the provider config (plus, feat. <artist> patterns are all over the place, so F that).



Anyway, here's my modified code for Genius (see redwing's original instructions for how to install)
Code: genius.com.yml
name: "Genius"

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.com/{artist}-{title}-lyrics"
    pattern: ['<div\s+class="lyrics"[^>]*?>(?<lyrics>.*?)</div>', s]

post-filters:
- strip_html
- clean_spaces
- utf8_encode



For Musixmatch, copy/paste below code to a text file named "musixmatch.com.yml", save to MusicBee's <appdata folder>/mb_LyricsReloaded/providers/, open Musicbee and add new Musixmatch provider from Preferences > Tags (2) > Auto-tagging > Lyrics [...]
Code: musixmatch.com.yml
name: "Musixmatch"

variables:
    artist:
        type: artist
        filters:
        - strip_diacritics
        - lowercase
        - [replace, "!!!", "artist-46206"]      # !!! (Chk Chk Chk) artist exception
        - [replace, "+/-", "p%m"]               # +/- artist janky exception (step 1)
        - [regex, '(?<=\W|\s)+(feat.+|ft[\W\s]+|(f\.\s)).+', ""]
                                                # ^ Strip F./ft/eat/uring + everything after
        - [regex, "'", "%27"]                   # URL encode "'" bc MM is cool w/ dat shit
        - [regex, '\s&\s(?=the)', " and "]      # ONLY if succeeded by "the", replace " & " with " and "
                                                    ## ^ Currently superfluous bc plugin preemptively replaces "&" with "and"
                                                        ### ^ So MM will choke if <artist> contains "& (?!the)"
        - [regex, '(?<=[a-z0-9%])[^\sa-z0-9%]+(?=[a-z0-9%]+)', "-"]
                                                # ^ Replace medial non-alphanumeric char(s) with single "-" (except "'") e.g., M.I.A. > M-I-A.
        - [regex, '\W+(?=$)', ""]               # Strip end-of-string non-word chars
        - [regex, '((?<=\s)([^a-z0-9\s-])+(\s|\W)+)|((?<=\w)([^a-z0-9-])+(\s|\W)+)', " "]
                                                # ^ Clean up any remaining successive non-alphanumeric char(s) before strip_nonascii
                                                    ## ^ Long & stupid bc couldn't figure out YAML-friendly non-capturing "(?:...)"
                                                        ### EZ version: [regex, '\W+(?:\W)(?<!$)', " "]
        - [strip_nonascii, -]
        - [replace, "-27", "%27"]               # Fix "'" URL encoding after strip_nonascii
        - [regex, '(?<=^)p-m', "-"]             # Janky replace for artist +/- after strip_nonascii (step 2)
    title:
        type: title
        filters:                                # Not using identical artist filters due to different treatment of "&" in titles vs artist names
                                                # Musixmatch strips "&" from <title> ALWAYS; from <artist> too, *unless* "& the", then replaced with "and"
                                                    ## ^ see "&" treatment note above, under 'artist'
        - strip_diacritics
        - lowercase
        - [regex, '(?<=\W|\s)+(feat.+|ft[\W\s]+|(f\.\s)).+', ""]
                                                # ^ Strip F./ft/eat/uring + everything after
        - [regex, "'", "%27"]                   # URL encode "'" bc MM is cool w/ dat shit
        - [regex, '(?<=[a-z0-9%])[^\sa-z0-9%]+(?=[a-z0-9%]+)', "-"]
                                                # ^ Replace medial non-alphanumeric char(s) with single "-" (except "'") e.g., f**k > f-k
        - [regex, '\W+(?=$)', ""]               # Strip end-of-string non-word chars
        - [regex, '((?<=\s)([^a-z0-9\s-])+(\s|\W)+)|((?<=\w)([^a-z0-9-])+(\s|\W)+)', " "]
                                                # ^ Clean up any remaining successive non-alphanumeric char(s) before strip_nonascii
        - [strip_nonascii, -]
        - [replace, "-27", "%27"]               # Fix "'" URL encoding after strip_nonascii

config:
    url: "http://www.musixmatch.com/lyrics/{artist}/{title}"
    pattern: ['<span\s+id="lyrics-html"[^>]*?>(?<lyrics>.*?)</span>', s]

post-filters:
- utf8_encode

* I included my comments, just in case anyone wants to take stab at updating or modifying my very silly regex and wants to know what the hell I was thinking (delete at will - they have no effect on functionality).

So, yeah, with both Genius and Musixmatch as my #1 & #2 lyrics providers, I wanna say like 90% of my 25K songs now come with bonus words. Yay and thanks again redwing and, of course, quick_wango!


* Edit: 2015.09.02 10:30 PST - added featured artist stripping to both configs

For some reason both of these don't show up. I saved each text in a separate yml file (via notepad) and put them in <Roaming/MusicBee/LyricsReloaded/Providers/

Then I restarted MB and they aren't in the Tags (2) Lyrics section. Any clue? Using the latest MB (2.5.5721)