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

sveakul

  • Hero Member
  • *****
  • Posts: 3288
I have completed some testing of a newly modified version of the v1.26 mb_LyricsReloaded.dll from slonopot that includes changes over his first modified version, mainly a reduced size log file and improvements in some of the YML handling.

The original intent of the modified DLL was to allow the functioning of new YML "scraper" files for the Genius and Metal Archives sites, when the first Metal Archive YML file and both the built-in Genius scrapers had recently failed.  This worked fine until the introduction of a captcha on the metallum website, and the defeat yet again of the revised Genius scripts.

Since then, metallum has (temporarily?) dropped its URL captcha allowing functioning of the Metal Archives YML again.  The Genius scrapers remain stymied by whatever changes have been made there, and do not work.  However, the separate "Beenius" plugin, which uses API-based searching, continues to function smoothly, and I recommend installing it for problem-free searching of the Genius site.  It co-exists just fine with the LyricsReloaded plugin.

You will need both the revised DLL and recently re-written YML (below) to access Metal Archives.  There is no interference with the DLL's functioning on other sites (barring the Genius exception), and enhanced performance with Bing, etc.  As always, the DLL goes in the Plugins folder and the YML in the providers folder.  Thank you, slonopot.

https://mega.nz/file/2FwD0bxL#eRsayTKH-YEyvCkpk9YEs426rS892ksQ4IGYiOsM6KA

P.S. Mayibongwe, are you still out there?
Last Edit: May 01, 2025, 08:43:51 AM by sveakul

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
P.S. Mayibongwe, are you still out there?
I've had a rough couple of weeks outside the forum.
Today was a huge squeeze on its own. Hopefully, I can keep the momentum going.
Will be able to relook at plugins at the earliest, on the weekend - there's a bit of catching up I have to do on this thread.
Strength and Honour (2025)

hiccup

  • Hero Member
  • *****
  • Posts: 9149
an updated Genius yml

I probably haven't followed the latest changes and developments of Lyrics Reloaded very well, but I noticed that in the latest version (1.2.7) Genius doesn't seem to work anymore?

So I took it upon myself to create a new Genius yml.
It's already working pretty good, but I'll probably refine it some more in the coming weeks.

To further improve on the success rate of Genius I tried to also create a new 'fuzzy' version.
But I can't get that one to work at all.
I'll probably need some help from Mayibongwe or frankz to figure out what is wrong, but both have (regrettably) been AWOL for a while, so it looks like I am stuck for now for a 'fuzzy' version.

To use this new Genius yml:

-  create a new textfile
-  copy/paste the code below into it
-  rename the file to: Genius (update).yml
-  copy that file into:
   AppData > mb_LyricsReloaded > providers
-  restart MusicBee
-  Edit > Preferences > Tags (2) > uncheck 'Genius', and check 'Genius (update)'

That's pretty much it.

If you want to help improving this Genius yml, let me know if you run into songs that don't get their lyrics fetched.
  if you are sure that Genius has them
  (provide the artist, title, and the Genius weblink to that song)

- - -

Note:

This Genius (update) yml is 'exact'.
Meaning that any misspelling of a name or title will result in failing to retrieve the lyrics.

So if your artists and titles are tagged correctly (e.g. by using MusicBrainz/Picard), this yml will deliver very good results.
But if your artist/title tags are 'somewhat sloppy', or you are using radio streams (often providing simplified and modified names/titles ), 'Genius (update)' will say "no", and will not retrieve lyrics.

To accommodate for such misspellings or variations of names/titles, some 'fuzzy' matching is required.
For that, an (additional) 'fuzzy' version of a Genius yml is required.
Regrettably, the currently existing 'fuzzy' yml's don't seem to work anymore, and even after trying my best, I reached my ceiling, and am unable to create a functioning fuzzy version.

But…
Luckily there is also the Beenius plugin.
That one uses the official Genius API, that happens to have 'fuzziness' build-in, that allows for some variations or misspellings. (with a very small chance of retrieving the wrong lyrics)

So my advice would be to set 'Genius (updated)' as the first provider (precise), and Beenius as second. (slightly fuzzy)

(until I figured out how to get 'my' Genius (fuzzy)' yml working that is ;-)

- - -

Code
name: Genius  (update)
loader: static

variables:
    artist:
        type: artist
        filters:
        - strip_diacritics
        - lowercase
        - [replace, "&", "and"]
        - [replace, "!!!", "chk-chk-chk"]
        - [replace, "†††", "crosses"]
        - [replace, "ac/dc", "ac dc"]
        - [replace, "amenra", "amenra cor"]
        - [replace, "atom™", "atomtm"]
        - [replace, "‐m‐", "m fra"]
        - [replace, "²/", "2 "]
        - [replace, "'", ""]
        - [regex, '^mo$', "mo nld"]
        - [regex, '^saga$', "saga can"]
        - [regex, '\sw\/.*', ""]
        - [regex, '\s?/\s?', " and "]
        - [regex, '(?<=\w)[-‐](?=\w)', " "]
        - [regex, '[\(\)]', ""]
        - [regex, '[\+•]\s', ""]
        - [regex, '†\s?', ""]
        - [regex, '!(?=[a-z])', " "]
        - [regex, '\swith\s.*', ""]
        - [regex, '[ıæø’\.\,"“”=!\?]', ""]
        - [regex, '\$(?=[a-z])', " "]
        - [regex, '\/:\$', ""]
        - [replace, " ", "-"]

    title:
        type: title
        filters:
        - strip_diacritics
        - [replace, "&", "and"]
        - [replace, "×", "x"]
        - [replace, "10,000", "10 000"]
        - [replace, "'", ""]
        - [replace, "%", ""]
        - [regex, '[\u3040-\u309F\u30A0-\u30FF\u4E00-\u9FFF]', ""]
        - [regex, '\sw\/', " w"]
        - [regex, '(\s\/\s|\/)', " "]
        - [regex, '†\s?', ""]
        - [regex, ':\s?', " "]
        - [regex, '[\+=→–]\s', ""]
        - [regex, '\$(?=[a-zA-Z])', " "]
        - [regex, '[\?\(\)\.\,…“”"’!¡@$=°ıæø#]', ""]
        - [regex, '[—‐]', " "]
        - [regex, '(?<=\w\w)·(?=\w\w)', " "]
        - [regex, '_\s?', ""]
        - [regex, '·', ""]
        - trim
        - [replace, " ", "-"]

config:
    url: "https://genius.com/{artist}-{title}-lyrics"
    pattern: ['body\\":{\\"html(?<lyrics>.*)<\\/p>\\\\n\\\\n\\', 's']

post-filters:
- [regex, '\\.*(?=<p>)<p>', "<br>"]
- [regex, '<br>\\\\n', "<br>"]
- br2nl
- [regex, '\\', ""]
- [regex, '<a href.[^>]*>', ""]
- strip_html
- [regex, '\[.{1,75}\]', ""]
- [regex, '\n{2,}',"\n\n", 's']
- [regex, '\[(\[)',"$1", 's']
- [regex, 'Feat\..*', ""]
- trim
last updated:  2025-06-24
Last Edit: June 24, 2025, 05:27:45 PM by hiccup

Hyetal

  • Newbie
  • *
  • Posts: 2
So I took it upon myself to create a new Genius yml.

Popping into the thread to check on the plugin's progress, and I'm met with a happy coincidence. Appreciate the work!

hiccup

  • Hero Member
  • *****
  • Posts: 9149
Popping into the thread to check on the plugin's progress, and I'm met with a happy coincidence. Appreciate the work!
Great.
If you want to try the new Genius.yml from my previous post, I think there was a small error in the code that may have caused the yml to fail loading.
I just now updated the code in that post, so make sure to copy it fresh.

sveakul

  • Hero Member
  • *****
  • Posts: 3288
Thanks for the re-done Genius yml, hiccup.  Seems like forever since the LyricsReloaded plugin had its own working copy of this, and it's working great on my usual radio streams.  I wouldn't worry about not having a "fuzzy" version.  Your regex keeps scoring direct hits and that's the preferred result--well-written to begin with.

hiccup

  • Hero Member
  • *****
  • Posts: 9149
I wouldn't worry about not having a "fuzzy" version.
But I do.

Both Genius.yml and Beenius will fail retrieving lyrics for a substantial amount of songs that have some more complicated and sometimes ambiguous artist names or song titles.

The word 'fuzzy' may scare you off, but when done right its results are very good, and essential for further improving the results.

Naming it 'Genius (smart)' would probably be a better description…
Last Edit: June 17, 2025, 08:20:40 AM by hiccup

Hyetal

  • Newbie
  • *
  • Posts: 2
Popping into the thread to check on the plugin's progress, and I'm met with a happy coincidence. Appreciate the work!
Great.
If you want to try the new Genius.yml from my previous post, I think there was a small error in the code that may have caused the yml to fail loading.
I just now updated the code in that post, so make sure to copy it fresh.

Your initial code worked perfectly on my end, but thanks for the heads up.

hiccup

  • Hero Member
  • *****
  • Posts: 9149
I have updated the Genius (update) yml that I posted here earlier.

-  much improved success-rate for artists/titles that contain non-standard characters and constructions
-  purged the script, cleaned it up, and compacted it.
 

sveakul

  • Hero Member
  • *****
  • Posts: 3288
I have updated the Genius (update) yml that I posted here earlier.

-  much improved success-rate for artists/titles that contain non-standard characters and constructions
-  purged the script, cleaned it up, and compacted it.
 
Thank you, hiccup!  Regex holds no terrors for you!

Any chance of taking on a Bandcamp clean-up?  It's a real "doozie", because some lyrics end up on the page for the record company with a different address path, some on the band's own "name" website page and on the latter with occasional entries requiring an extra regex expression.

I run two different ymls (based on Mayibongwe's work) for it that do produce results on the bandname sites, but neither address the case with the band and lyrics being subsets of the record company URL, such as here:  https://alfamatrix.bandcamp.com/album/deadtime-stories .  You can see the whole album referenced is by Lovelorn Dolls, who also have their own band name site on Bandcamp (lovelorndolls.bandcamp.com), but has been entered under the company name "Alfamatrix,"  This example didn't have lyrics, sorry!  Some bands ONLY have a "company entry."  Adding to my problem here is that with radio stream metadata searches an album name cannot be used.

But just having a single YML that addressed the occasional need for added regex on the "normal" band name sites would be good enough:

Code
name: Bandcamp1
loader: search

variables:
    artist:
        type: artist
        filters:
        - lowercase
        - [regex, '\s', '']   <--SOME SEARCHES NEED THIS LINE, SOME DON'T
        
    title:
        type: title
        filters:
        - lowercase

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

hiccup

  • Hero Member
  • *****
  • Posts: 9149
Any chance of taking on a Bandcamp clean-up?
Sure, I can take a look at it.
edit: Cancelled
I have no confidence that the person who is asking for this is willing or able to provide me with useful and specific information to help him with this.

But I don't use Bandcamp myself.
It be would helpful if you could post a list of maybe some 10  'artist - titles'  that you are interested in that I can use for testing.
A couple of easy ones that are currently working, and a couple of more complicated ones that currently fail?

edit
It's probably me, but searching the Bandcamp website is terrible.
So please include direct web links to these songs.
Last Edit: June 18, 2025, 09:26:51 PM by hiccup

sveakul

  • Hero Member
  • *****
  • Posts: 3288
I can't really do the "interested in listening to" thing because all I listen to basically are radio streams, due to the huge variety of new music I get exposed to that way, and of course have not seen the lyrics before.  In other words, I'm just interested in the script being able to locate songs that appear on Genius, using the artist/title data sent by the metadata..

In that vein here are some examples like you asked for of songs that are on Genius but that were not found by your latest script; artist/title are exactly as sent by the radio station metadata:

Thompson Twins - Lay Your Hands On Me [US Remix]

Soren Juul - Greenpoint

The Dandy Warhols - Autumn Carnival

bob junior - No One Does It Better Than You

Believe me, it took a LOT of browsing to come up with these!!


hiccup

  • Hero Member
  • *****
  • Posts: 9149
Believe me, it took a LOT of browsing to come up with these!!
I added an 'edit' to my previous post just seconds ago…

sveakul

  • Hero Member
  • *****
  • Posts: 3288
Believe me, it took a LOT of browsing to come up with these!!
I added an 'edit' to my previous post just seconds ago…
OK but the examples I gave are NOT from Bandcamp, I was responding to your request in reply #752:  "If you want to help improving this Genius yml, let me know if you run into songs that don't get their lyrics fetched. (if you are sure that Genius has them)"

Sorry for not making that more clear.

hiccup

  • Hero Member
  • *****
  • Posts: 9149
Sorry for not making that more clear.
Ok, so about Genius:
Can you provide the song's artist and title, accompanied by a direct link to the page on Genius that shows the song and its lyrics for that (exact) song?