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

sveakul

  • Hero Member
  • *****
  • Posts: 3260
Anybody, Mayibongwe, Naireem, any luck on the new Metal Archives YML yet??

hiccup

  • Hero Member
  • *****
  • Posts: 9107
Anybody, Mayibongwe, Naireem, any luck on the new Metal Archives YML yet??
Mayibongwe already said he would take a look at it. (less than a week ago)
To me he doesn't seem the kind of person that needs much reminding or pushing about stuff like this.

sveakul

  • Hero Member
  • *****
  • Posts: 3260
To me he doesn't seem the kind of person that needs much reminding or pushing about stuff like this.
To me either, I fell victim to over-anxiousness like our Newbies.

Normally you would never notice a source like this was being missed, due to the supply of so many first-class cross-genre plugins now available, like Genius, LRCLIBee, etc.  I had Metal Archives listed first; when switching to another player (Foobar) where it's also first in the ESLyric plugin, it was showing lyrics for "Hydra - Lone Wolf" coming from M.A. when the same song had shown none in MusicBee--or any other LR/slonopot lyrics source.  Same thing in Foobar--of all the normally double-referenced new API sources, only that ONE lonely lyric scraper by Mayibongwe at the ONE source had it!  "And then, there was none.."

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
For metal archives, this works when it queries the website directly:

Code
name: Metal Archives
loader: search

variables:
    artist:
        type: artist
        filters:
        - [regex, '\s', '_']

config:
    identity url: "https://www.metal-archives.com/albums/{artist}/{album}"
    identity pattern: ['\n(\s+)?{title}.*?\n.*?id="song(?<identity>.*?)"', 'is']
    lyrics url: "https://www.metal-archives.com/release/ajax-view-lyrics/id/"
    lyrics pattern: ['(?<lyrics>.*)', 's']
    
post-filters:
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- trim

But sveakul, I think it won't help much in your case because the direct searching requires an <album> field which most radio streams don't provide.
I believe this is what you listen to most of the time?
Also if memory serves well, I'd initially designed this yml around a google search in order to get around the absence of the <album> field.

The google search is still not coming to the party, possibly a result of this change from a month ago:
https://techcrunch.com/2025/01/17/google-begins-requiring-javascript-for-google-search/

Others have gotten around this using some user-agents which still seem to work, but that luck has not favoured this static-html-based plugin as yet.
I'll continue to poke at it and let you know if I find a workaround (as this has affected the other providers using a google search as well).
Last Edit: February 15, 2025, 06:03:05 AM by Mayibongwe
Strength and Honour (2025)

sveakul

  • Hero Member
  • *****
  • Posts: 3260
Thanks Mayibongwe for the detailed info and how the failure must be connected to the new javascript requirement for Google.  Definitely makes sense as Foobar's Openlyrics and ESLyric plugins still return Metal Archives lyrics, and both use javascript. FWIW the foo_multisouce  plugin for LSP3 still works there also.

Metallum has never required an album name to be included on its own website search page, where I find that my MB Internet link
Code
https://www.metal-archives.com/search/advanced/searching/songs?songTitle=<Title>&bandName=<Artist>#songs
will still take me to a page if the song is found whereby clicking the js square to the right of the song entry will drop the lyrics, so that's still a poor man's method of getting AT the lyrics in MusicBee even if not via LR.

Is MusicBee compatible at all with javascript plugins or does its code just not allow for it?

slonopot

  • Jr. Member
  • **
  • Posts: 94
I've been summoned to the YML enjoyers club to fix Metal Archives for exactly 1 user (as it seems after reading some of the most recent pages). LyricsReloaded is a mess and y'all fans not making it any better. It took me more time to understand which plugin to install and how is it configured than to fix the issue itself. I can only suggest to properly fork the correct ancestor on Github and push the up-to-date sources there, make a wiki, assign the most active non-developers of this thread as editors and let them handle the up-to-date yamls in there, also to make the explanations of how to set this all up, maybe put up some docs that will cover the newest features and loaders, at least by example. The project legacy has outgrown this forum a long time ago.

And now for the rescue mission.

Code
name: Metal Archives
loader: search

config:
    identity url: "https://www.metal-archives.com/search/ajax-advanced/searching/songs?songTitle={title}&bandName={artist}"
    identity pattern: ['\[.*?"(<.*?>)*\s*({artist})\s*(<.*?>)*".*?"(<.*?>)*\s*(?<album>.*?)\s*(<.*?>)*".*?"(<.*?>)*\s*(?<type>.*?)\s*(<.*?>)*".*?"(<.*?>)*\s*({title})\s*(<.*?>)*".*?"(lyricsLink_(?<identity>.*?)\\".*?)?".*?\]', 'is']
    lyrics url: "https://www.metal-archives.com/release/ajax-view-lyrics/id/"
    lyrics pattern: ['(?<lyrics>.*)', 's']
    
post-filters:
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- trim

The full regex:
Code
\[.*?"(<.*?>)*\s*(?<artist>.*?)\s*(<.*?>)*".*?"(<.*?>)*\s*(?<album>.*?)\s*(<.*?>)*".*?"(<.*?>)*\s*(?<type>.*?)\s*(<.*?>)*".*?"(<.*?>)*\s*(?<title>.*?)\s*(<.*?>)*".*?"(lyricsLink_(?<id>.*?)\\".*?)?".*?\]

But it won't work by default for two reasons: LyricsReloaded is ancient and Metal Archives is both older and made by a school CS teacher in 1991 in notepad.exe. You gotta patch CubeIsland.LyricsReloaded.WebClient.executeRequest on line 227 from

Code
if (response.CharacterSet != null)
{
    encoding = Encoding.GetEncoding(response.CharacterSet); // the response encoding specified by the server. this should be enough
}
to
Code
if (!String.IsNullOrEmpty(response.CharacterSet))
{
    encoding = Encoding.GetEncoding(response.CharacterSet); // the response encoding specified by the server. this should be enough
    // lmao it wasn't
}
else encoding = Encoding.UTF8;

Forcing UTF-8 unless stated otherwise should also fix issues like this (Chartlyrics.com).

I'd also like to suggest to log all exceptions, not only WebException, in CubeIsland.LyricsReloaded.Provider.Loader.SearchLoader.getLyrics. The response.CharacterSet for Metal Archives' server is an empty string.

Here's a patched version based on the most recent sources available until Mayibongwe wishes to make an official-unofficial build. The yaml above won't work with any other plugin version out there. Don't use the yaml from gofile, it's not the latest version, take the one in the message.

I have done different tests and I still prefer LyricsReloaded, I will wait for the version Genius and Genius (fuzzy) without brackets to test it.
for example this song

https://genius.com/Cpv-bonita-cancion-de-amor-capitulo-i-lyrics

found by LyricsReloaded and Beenius is not, and I haven't found the reason yet.

Bennius
| Debug | Beenius.GeniusClient.search | artist="El Club de los Poetas Violentos", title="Bonita canción de amor"
| Info | Beenius.GeniusClient.search | Let's check for aliases
| Info | Beenius.GeniusClient.search | No results for this search
| Info | Beenius.GeniusClient.getLyrics | Nothing found at all

Wrong place to report this anyway, but there's a readme section that explains results validation. In your case it's "Bonita canción de amor" matched against "Bonita canción de amor (Capitulo I)", and " (Capitulo I)" exceeds default 5-character difference. Increase it in the config and you'll get a result. It all depends on the quality of your initial database, it's almost flawless if you have correct tags.

sveakul

  • Hero Member
  • *****
  • Posts: 3260
I'll admit to being a bit confused about this, so I'll summarize what I think I heard for my own and hopefully others benefit.  First, thanks slonopot for taking the time to respond and invest more work on our behalf.

1.  The current state of the mbLR DLL code is so old that it's a miracle Mayibongwe has been able to keep it going as well as he has.
2.  The problems with adding sites like Metal Archives and the new Google are not due to a basic incompatibility with MusicBee, but with the fact that the plugin needs a total re-write, a separate GitHub "branch" where the old code can be let go of completely.  That would necessitate a large initial time committment on behalf of its auteurs, and of course the needed coding skills.
3.  A test yml that does work on Metallum was included, as well as a modified mb_LyricsReloaded.dll required to run it.  I can confirm that it DOES work (draw lyrics from Metal Archives), and from what I can see so far at no penalty to the previously existing sources that had still worked after the Metallum/Google problem surfaced, including the 3 separate slonopot plugins (Beenius, etc.).  If anything, obscure sources had returns MORE often than before (lyricsify, lyricsovh, etc.).

FWIW at this early date:  these Internet radio songs were not found although the lyrics were returned from metallum by the Foobar ESLyric plugin:
Metallica - 72 Seasons ; HolyHell - Armageddon ; Schwarzer Engel - Mitternacht (Club Edit) ; Edenbridge - The Silent Wake

Continuing:

4.  At first download, Firefox gave a virus warning for the DLL, to which I responded proceed anyway.  After downloading the file a scan at VirusTotal showed 0/72 flags, or 100% CLEAN.
5.  The slonopot separate plugins have a "title trim" option that if active would remove various symbols like (), [], & from the title field  when performing a search to keep them from interfering with the search.  This does not seem to be present in the test YML--is it possible to add that option, and if so, where and how?
6.  Kind of a cop-out I know, but would it be possible to release slonopot Metal Archives as a separate plugin like LRCLIBee, Museexmatch, and Beenius, to buy time to keep doing things "as before" until the "YML enjoyers club" can be found to do the work described in #2 above?

The modfied DLL maintains the file version of 1.26 with "Company: Authored by Cube Island" in its pop-up description.

Yes I admit to being one lonely voice asking for this on the forum but if there's one thing I've found is that the  "General Public" doesn't even know what they want much less how to ask for it.  If it makes pretty covers and balls-to-the-wall-dude audio it's all they ever expected--ever KNEW to expect.  And, how do ya use that dang forum anyway??  All I can say is thanks to the BoringNames, hiccups, kamens, mayibongwes and yes slonopots for listening to a wider audience.

P.S.  Also "early but FWIW"--the new DLL creates a huge log file (log.log) compared to the old one (mine is 28MB after just a few hours).  While Mayibongwe had code incorporated into his DLL to delete the log after a certain size  I don't believe the new DLL does.  I'm not sweating it because I run a batch file that completely cleans up those kind of leftovers from MusicBee Portable.  The log file itself is located at C:\MusicBee\AppData\mb_LyricsReloaded\log.log.
Last Edit: February 20, 2025, 05:32:56 AM by sveakul

slonopot

  • Jr. Member
  • **
  • Posts: 94
4.  At first download, Firefox gave a virus warning for the DLL, to which I responded proceed anyway.  After downloading the file a scan at VirusTotal showed 0/72 flags, or 100% CLEAN.

Probably just an unknown file, should be fine.

5.  The slonopot separate plugins have a "title trim" option that if active would remove various symbols like (), [], & from the title field  when performing a search to keep them from interfering with the search.  This does not seem to be present in the test YML--is it possible to add that option, and if so, where and how?

I didn't create a new LyricsReloaded or a separate plugin for a new service, I just made it compatible with Metal Archives' poorly made API and provided a configuration yaml, all the rest remains the same.

6.  Kind of a cop-out I know, but would it be possible to release slonopot Metal Archives as a separate plugin like LRCLIBee, Museexmatch, and Beenius, to buy time to keep doing things "as before" until the "YML enjoyers club" can be found to do the work described in #2 above?

Don't see the point of this, it works and will continue to work with the provided fix and yaml. The other plugins, except LRCLIB one, are provided separatly because they require custom modules to enable the use of the services. When it's just two requests and two responses, you can manage to parse HTML in JSON with regex and not die inside. I still remember about Deezer though, maybe one day it will be done.

The modfied DLL maintains the file version of 1.26 with "Company: Authored by Cube Island" in its pop-up description.

Didn't bother, consider the fix in the previous message a pull request since there's no github to do it properly.

P.S.  Also "early but FWIW"--the new DLL creates a huge log file (log.log) compared to the old one (mine is 28MB after just a few hours).  While Mayibongwe had code incorporated into his DLL to delete the log after a certain size  I don't believe the new DLL does.  I'm not sweating it because I run a batch file that completely cleans up those kind of leftovers from MusicBee Portable.  The log file itself is located at C:\MusicBee\AppData\mb_LyricsReloaded\log.log.

It probably does, in order to track down the incompatibility issues I made it log all responses. Since you probably load a lot of large pages, it's what populates the file and with time it may become huge. Anyway, just delete it manually for now, Mayibongwe will eventually make it official and this verbose logging will be removed.

sveakul

  • Hero Member
  • *****
  • Posts: 3260
Thanks for your reply!

I mentioned that some tracks confirmed to be at Metal Archives would not be found by metalarchivestest yml--these included:
Schwarzer Engel - Mitternacht (Club Edit)
Imperia - Spirit Chase (Keep Fighting)
Metallica - 72 Seasons

Note the first two include parens in the title field, which is why your e.g. Beenius plugin needed to include the "trim title" option in its .conf file to find similar titles.  Also, I suspect the third was not found due to the fact the title starts with a numeral.  Surely a regex filter line can be added to the YML in variables/title that tells the search to exclude brackets and parens, and their content so these titles will be found?  This would just make it work the same way it always worked, not add a new service.  Thanks for your attention.

On the DLL name, I only mentioned that as a way for users to tell yours apart from Mayibongwe's.

OK on the log!  For others, the following batch script will delete the log and the lyrics cache when run.  Note that is designed for the Portable version of MusicBee;  change the paths to match yours:

Code
cd C:\MusicBee\AppData\mb_LyricsReloaded
del Log.log &

@ECHO OFF

Set dir="c:\MusicBee\AppData\InternalCache\Lyrics"

Echo Deleting all files from %dir%
del %dir%\* /F /Q

Echo Deleting all folders from %dir%
for /d %%p in (%dir%\*) Do rd /Q /S "%%p"
@echo Folder deleted.

exit

slonopot

  • Jr. Member
  • **
  • Posts: 94
"Metallica - 72 Seasons" works.

As for the other ones, we'll need to alter both input and output.

To cut anything in square or round brackets in the output's artist and title we'll add ([\[\(].*?[\)\]])* in the appropriate places (after \s* -- any number or spaces):

Code
\[.*?"(<.*?>)*\s*(?<artist>.*?)\s*([\[\(].*?[\)\]])*(<.*?>)*".*?"(<.*?>)*\s*(?<album>.*?)\s*(<.*?>)*".*?"(<.*?>)*\s*(?<type>.*?)\s*(<.*?>)*".*?"(<.*?>)*\s*(?<title>.*?)\s*([\[\(].*?[\)\]])*(<.*?>)*".*?"(lyricsLink_(?<id>.*?)\\".*?)?".*?\]

And we'll do almost the same for the input, but it will cut anything in round or square brackets after a space in the end.

Code
name: Metal Archives
loader: search

variables:
    artist:
        type: artist
        filters:
        - [regex, '\s([\[\(].*?[\)\]])*$', '']
    title:
        type: title
        filters:
        - [regex, '\s([\[\(].*?[\)\]])*$', '']

config:
    identity url: "https://www.metal-archives.com/search/ajax-advanced/searching/songs?songTitle={title}&bandName={artist}"
    identity pattern: ['\[.*?"(<.*?>)*\s*({artist})\s*([\[\(].*?[\)\]])*(<.*?>)*".*?"(<.*?>)*\s*(?<album>.*?)\s*(<.*?>)*".*?"(<.*?>)*\s*(?<type>.*?)\s*(<.*?>)*".*?"(<.*?>)*\s*({title})\s*([\[\(].*?[\)\]])*(<.*?>)*".*?"(lyricsLink_(?<identity>.*?)\\".*?)?".*?\]', 'is']
    lyrics url: "https://www.metal-archives.com/release/ajax-view-lyrics/id/"
    lyrics pattern: ['(?<lyrics>.*)', 's']
    
post-filters:
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- trim

I didn't test it, but should be fine. You can train to make regexes at regexr.com, grab a sample response from Metal Archives (https://www.metal-archives.com/search/ajax-advanced/searching/songs/?bandName=Schwarzer+Engel&songTitle=Mitternacht), maybe edit search values, paste the JSON in the editor and tweak the provided full regex all you want, once done replace (?<artist>.*?) with ({artist}) and do the same for the title. You can see the parse results in the Details tab, but you'll have to click blue highlighted result first.

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 1733
  • Heal The World
Will properly go through the recent posts on this thread tomorrow or Sunday.
Had some forum catching-up to do today and I've run out of steam for the night.
Strength and Honour (2025)

sveakul

  • Hero Member
  • *****
  • Posts: 3260
Code
name: Metal Archives
loader: search

variables:
    artist:
        type: artist
        filters:
        - [regex, '\s([\[\(].*?[\)\]])*$', '']
    title:
        type: title
        filters:
        - [regex, '\s([\[\(].*?[\)\]])*$', '']

config:
    identity url: "https://www.metal-archives.com/search/ajax-advanced/searching/songs?songTitle={title}&bandName={artist}"
    identity pattern: ['\[.*?"(<.*?>)*\s*({artist})\s*([\[\(].*?[\)\]])*(<.*?>)*".*?"(<.*?>)*\s*(?<album>.*?)\s*(<.*?>)*".*?"(<.*?>)*\s*(?<type>.*?)\s*(<.*?>)*".*?"(<.*?>)*\s*({title})\s*([\[\(].*?[\)\]])*(<.*?>)*".*?"(lyricsLink_(?<identity>.*?)\\".*?)?".*?\]', 'is']
    lyrics url: "https://www.metal-archives.com/release/ajax-view-lyrics/id/"
    lyrics pattern: ['(?<lyrics>.*)', 's']
    
post-filters:
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- trim

I didn't test it, but should be fine. You can train to make regexes at regexr.com, grab a sample response from Metal Archives (https://www.metal-archives.com/search/ajax-advanced/searching/songs/?bandName=Schwarzer+Engel&songTitle=Mitternacht), maybe edit search values, paste the JSON in the editor and tweak the provided full regex all you want, once done replace (?<artist>.*?) with ({artist}) and do the same for the title. You can see the parse results in the Details tab, but you'll have to click blue highlighted result first.
Thanks again slonopot, I've just spent several hours testing this revised new script and it has performed beautifully comparing its returns with those from ESLyric, all on radio station streams,  So good to have Metal Archives back and kicking a' again with the new API based searching.  As I mentioned before, the needed mod of the mbLyricsReloaded.dll has not dimmed/dropped its fast results from its pre-existing YML files and built-in scripts, and the three separate slonopot plugins Beenius-Museexmatch-LRCLIBee still going full throttle.  All in all, the best performing "version" of the MusicBee lyric retrieval engine yet.  Mayibongwe and slonopot, take a bow!

BTW, I appreciated the link to the learn regex site.  I keep telling myself I'm going to do more "learning" and sometimes it ends up never coming together, like how I was going to learn more on AIMP LVU meters to contribute to the VUMeter project.  My only excuse is medical and not worth boring anyone about here.  The energy you guys have is amazing, thanks for sharing it for everyone's benefit.

catalonia

  • Jr. Member
  • **
  • Posts: 64
In the previous message testing providers I have added others that are still working, if you know of any other that I have not listed let me know.

sveakul

  • Hero Member
  • *****
  • Posts: 3260
In the previous message testing providers I have added others that are still working, if you know of any other that I have not listed let me know.
BTW Chartlyrics is one of the old built-in lyrics providers from Steven, that pre-dates mb_LyricsReloaded.  You can see it referenced inside the binary file MusicBee.exe.  Actually, it still works.  Find a common song and then keep hitting "Search Next provider" and eventually it will turn up;  it won't appear at the top of the lyrics panel as a source, but in the context menu "Lyrics source" will show it.  The other one like this (from Steven) is LyricsOvh, but now Mayibongwe has added a proper YML file to cover that source.

catalonia

  • Jr. Member
  • **
  • Posts: 64
is that Charlyrics fails me with the accents, I don't know if it could be fixed, I have spoken with the support of the application and they have sent me here.