Poll

Should I add Musixmatch Lyrics support?

Sure
11 (91.7%)
Nope
1 (8.3%)

Total Members Voted: 12

Author Topic: Beenius - Genius for MusicBee  (Read 1350 times)

slonopot

  • Newbie
  • *
  • Posts: 14
Read more here

Features
Using Genius API instead of webpage parsing.
Author and track title in the library should be the same as in the Genius page. There's a 5-character tolerance for minor edits.

Installation
Get a release and extract two .dll files into MusicBee/Plugins/ directory
Last Edit: June 13, 2022, 01:26:33 PM by slonopot

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7867
Thanks for this, I think.

I wanted to give this a try, but you really need to provide more information. There should have some instructions as to how to install and use.

Such as:
- Where to place the Zipped files? In a sub-directory under MB\Plugins?  I placed the three files individually in the Plugins directory.
- Upon launching MB, I got this popup, which isn't very helpful. Perhaps "slonopot" means something in your language, but not mine. And Google Translate doesn't recognize it. This also pops up every time I open Preferences > Plugins, which is quite annoying.

- How to invoke it, especially if the Lyrics Reloaded (Updated) plugin is installed?
- I selected a few files that had no lyrics > auto-tag by track > update missing lyrics and got nothing.
- There should be some feedback from the plugin that it's searching.

At this point I have uninstalled it from MB and deleted the files I copied to MB's plugin directory.

Furthermore, I can't recommend this to anyone, especially those who are using the Lyrics Reloaded (Updated) plugin, since I have no way of knowing if it even works.

EDIT: I now notice that ""slonopot" is the name of the developer of this plugin.
Last Edit: June 11, 2022, 09:20:51 PM by phred
Download the latest MusicBee v3.4 patch from here.
Download the latest MusicBee v3.5 beta patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
Check out the MusicBee Wiki.
How to post screenshots is here

Redearth

  • Jr. Member
  • **
  • Posts: 30
I was surprised by how well this plugin was working and that there were no responses to this, then one showed up right as I was about to post this earlier today. I had been using it non-stop for a few hours and haven't experienced a single error or noticed any weirdness so far in how it performs (except for that popup window).

I was also happy you made your source code available, and I had a look. I really favor Genius as a lyrics source but knew future plugins would need to use APIs, I   never looked into it and hoped someone else would.

Like phred mentioned, I've also been using lyrics-reloaded because for the time being it's been able to survive with minor updates. Website updates have brought that plugin down several times, but at any point withing the next five years there'll be changes that's it won't be capable to survive on old page hacks.

It's a brand new plugin, so minor things to address upfront:

1. Add more and very basic documentation, even when redundant with MusicBee. You're familiar with how MusicBee works since you were able to make the plugin, and you designed it according to MusicBee's original specification. So step them through the process of copying the two files the the plugins folder, opening musicbee, going to preferences -> plugins -> enable Beeniuus. Then it should be an option in preferences -> Tags(2) -> lyrics drop-down.

Also, I'm not sure if other lyric plugins need to be disabled, but lyrics-reloaded should be disabled. With them both enabled, lyrics-reloaded just doesn't seem to work, but benius is fine. (I wouldn't be surprised if it's because of how hacky lyrics-reloaded gets so that it can import those config files and pretend they are providers.)

2. To get rid of that popup window about loading your plugin,, I think you maybe need to implement the ReceiveNotification() function since your plugin is configured to receive startup notifications, and while I'm not sure, it seems like MusicBee might be creating that popup since nothing handled it. If I'm 100% wrong I am sorry. Haven't looked into it much.

3. Highly recommend adding a logger. They are incredibly helpful for plugins, especially if people are having issues, e.g. getting results, your config file settings or whatever. Especially since it's a new plugin, people cab also refer to it to help you.

There were actually a few more things I preferred to ask about, but this is getting long and it seems most important to ask about your use of your client-side auth using your token with your token insecurely used by the plugin and also it being stored in the source code repo. Kinda only  getting away with it now since the plugin isn’t getting used much,-------. But it is in your public repo.

Otherwise, nice plugin. Really hoping it can stick around.

EDIT: Mistyped words.
Last Edit: June 14, 2022, 01:55:45 AM by Redearth

slonopot

  • Newbie
  • *
  • Posts: 14
- Where to place the Zipped files? In a sub-directory under MB\Plugins?  I placed the three files individually in the Plugins directory.
You unzip the archive and put all three individual files in Plugins folder (so mb_Beenius.dll, Topten.JsonKit.dll and beenius.conf (optional) are in Plugins folder).
- Upon launching MB, I got this popup, which isn't very helpful
I'll look into fixing this popup in the next possible updates, dunno why does it show up every time you open Plugins, for now I recommend to ignore this thing and proceed.
- How to invoke it, especially if the Lyrics Reloaded (Updated) plugin is installed?
You should enable a lyrics provider in Tags (2) section of Preferences (you'll see Genius via Beenius not to mix mine with any other custom providers).
- I selected a few files that had no lyrics > auto-tag by track > update missing lyrics and got nothing.
- There should be some feedback from the plugin that it's searching.
There shouldn't be any feedback because you will see it every single time it tries to search for lyrics, it's a hella headache if you have more than a dozen tracks. No results = no lyrics, it's that simple. There are cases when there are lyrics available in the source but the author or something else does not match. You'll have to manually fix these entries because 80% of results in Genius are community-supported and inconsistend. For example, you can see album UNLOCKED from Denzel Curry and you'll see that the author is "Denzel Curry & Kenny Beats". For sure, you'll have to update your entry in MusicBee to suffice this entry and only then it'll match. I had many issues with these features cuz the track might have a dozen of these but in Genius it will only include the album author. MusicBee passes track artist (not the album artist) which includes all the features, 0.0.2 update brings the option to split these out (I have edited the track artists in my audio library to have format like A & B & C so the plugin splits out the "& B & C" part and searches only by A and the track title.
TLDR: There are inconsistencies, yall been warned, don't expect it to magically match 100% of your library. You can make sure that you can manually search your track in Genius and have artist and track title match 100% minus 5-character tolerance (configurable in beenius.conf).
Furthermore, I can't recommend this to anyone, especially those who are using the Lyrics Reloaded (Updated) plugin, since I have no way of knowing if it even works.
It was made only because the latest version of Lyrics Reloaded (Updated) didn't work. You have an option to proceed to mess with regexes, this is the alternative that requires any basic understanding of how MusicBee plugins work. If you were able to use Lyrics Reloaded, you won't have any issues with mine.

1. Add more and very basic documentation, even when redundant with MusicBee. You're familiar with how MusicBee works since you were able to make the plugin, and you designed it according to MusicBee's original specification. So step them through the process of copying the two files the the plugins folder, opening musicbee, going to preferences -> plugins -> enable Beeniuus. Then it should be an option in preferences -> Tags(2) -> lyrics drop-down.
Added this to https://github.com/slonopot/Beenius, thanks

Also, I'm not sure if other lyric plugins need to be disabled, but lyrics-reloaded should be disabled. With them both enabled, lyrics-reloaded just doesn't seem to work, but benius is fine. (I wouldn't be surprised if it's because of how hacky lyrics-reloaded gets so that it can import those config files and pretend they are providers.)
MusicBee passes the data to plugins in the user-managed configurable order until the first hit. If you use LyricsReloaded, you'll have Genius and Genius via Beenius in your settings. Next, when the search is invoked, MusicBee will invoke all the providers sequentially until any valid result. You can configure multiple sources to be requested in the desired order.

2. To get rid of that popup window about loading your plugin,, I think you maybe need to implement the ReceiveNotification() function since your plugin is configured to receive startup notifications, and while I'm not sure, it seems like MusicBee might be creating that popup since nothing handled it. If I'm 100% wrong I am sorry. Haven't looked into it much.
I'll try if it'll need additional updates, the basic idea was to quickly make something that works and fill my library with lyrics. There's not much documentation to the APIs anyways.

3. Highly recommend adding a logger. They are incredibly helpful for plugins, especially if people are having issues, e.g. getting results, your config file settings or whatever. Especially since it's a new plugin, people cab also refer to it to help you.
It's too simple to have any errors that aren't users. Genius might revoke the API key I've borrowed from their Android app and that's it. All the other issues are mismatches in the user library and Genius databases.

There were actually a few more things I preferred to ask about, but this is getting long and it seems most important to ask about your use of your client-side auth using your token with your token insecurely used by the plugin and also it being stored in the source code repo. Kinda only  getting away with it now since the plugin isn’t getting used much,-------. But it is in your public repo.
I'll look into requests if I'll see them in the first place. I've made this plugin for my own purpose and just wanted to share for the community to have an extra chance to mitigate mental damage brought by fixing the regexes in Lyrics Reloaded.
Again, the API key is a public-private anonymous one that you can easily find in the Genius Android app. It's not mine, I don't care, I'll probably move it into config anyways since it could be eventually revoked.

P.S. I've tested the plugin first on my own library of 2060 files and had maximum matches I could've imagined. Minor fixes were brought in the 0.2 update and have maxed out the hits even further. Thanks for your feedback.

Redearth

  • Jr. Member
  • **
  • Posts: 30
Furthermore, I can't recommend this to anyone, especially those who are using the Lyrics Reloaded (Updated) plugin, since I have no way of knowing if it even works.
It was made only because the latest version of Lyrics Reloaded (Updated) didn't work. You have an option to proceed to mess with regexes, this is the alternative that requires any basic understanding of how MusicBee plugins work. If you were able to use Lyrics Reloaded, you won't have any issues with mine.
Agreed. LyricsReloaded as a downloadable plugin doesn't actually work. Users are required to find the forum thread and look through the latest posts to try to piece together the latest version of a yaml file and manually place it in the directory, and every minor change causes it to break. Additionally, almost all of the providers that are placed in the list don't work and can't be deleted. Only people on the LyricsReloaded forum topic are used to this idea as a workable solution, but as a downloadable plugin it's ridiculous.
An API-based plugin won't have any of these issues.

Added this to https://github.com/slonopot/Beenius, thanks
Sure. Is it possible to add that as a readme to the plugin page?

MusicBee passes the data to plugins in the user-managed configurable order until the first hit. If you use LyricsReloaded, you'll have Genius and Genius via Beenius in your settings. Next, when the search is invoked, MusicBee will invoke all the providers sequentially until any valid result. You can configure multiple sources to be requested in the desired order.
That's not what occurs in my testing.
If both plugins are enabled, LyricsReloaded will only work until MusicBee is restarted, and for some reason it tries to load Genius via Beenius but fails. But after a restart, LyricsReloaded will no longer search. And even if the Genius via Beenius provider is unselected, Beenius is still used for some reason.
There's no Beenius log, so I don't know what's going on there.

2. To get rid of that popup window about loading your plugin,, I think you maybe need to implement the ReceiveNotification() function since your plugin is configured to receive startup notifications, and while I'm not sure, it seems like MusicBee might be creating that popup since nothing handled it. If I'm 100% wrong I am sorry. Haven't looked into it much.
I'll try if it'll need additional updates, the basic idea was to quickly make something that works and fill my library with lyrics. There's not much documentation to the APIs anyways.
Yeah I know, hence my caveat about really not being sure. But a quick copy-paste of ReceiveNotification() from LyricsReloaded and some minor editing might knock it out quickly.
I applaud anyone who can make a working plugin based on the state of MusicBee's non-documentation and terse Interface.

3. Highly recommend adding a logger. They are incredibly helpful for plugins, especially if people are having issues, e.g. getting results, your config file settings or whatever. Especially since it's a new plugin, people cab also refer to it to help you.
It's too simple to have any errors that aren't users. Genius might revoke the API key I've borrowed from their Android app and that's it. All the other issues are mismatches in the user library and Genius databases.
Come on now. Your plugin code may be simple, but MusicBee is not, and don't pretend it is guaranteed to be 100% bug free, especially with the proprietary allowedDistance code. If it fails for any reason, be it an application update, an unexpected input string, the Genius server being down, having a log that just outputs some information would be extremely helpful. Additionally, just knowing what it's searching for using the Beenius config would also be nice to have, especially for those really willing to tweak that config file.

There were actually a few more things I preferred to ask about, but this is getting long and it seems most important to ask about your use of your client-side auth using your token with your token insecurely used by the plugin and also it being stored in the source code repo. Kinda only  getting away with it now since the plugin isn’t getting used much,-------. But it is in your public repo.
I'll look into requests if I'll see them in the first place. I've made this plugin for my own purpose and just wanted to share for the community to have an extra chance to mitigate mental damage brought by fixing the regexes in Lyrics Reloaded.
Again, the API key is a public-private anonymous one that you can easily find in the Genius Android app. It's not mine, I don't care, I'll probably move it into config anyways since it could be eventually revoked.

Ah, I didn't realize there was an anonymous one like that, my apologies. If at all configurable, probably a good idea. I would get my own token for this plugin.

slonopot

  • Newbie
  • *
  • Posts: 14
Sure. Is it possible to add that as a readme to the plugin page?
I don't have access to this page, probably Mr. Global Moderator will assist. Found the button, interface design 👍

That's not what occurs in my testing.
If both plugins are enabled, LyricsReloaded will only work until MusicBee is restarted, and for some reason it tries to load Genius via Beenius but fails. But after a restart, LyricsReloaded will no longer search. And even if the Genius via Beenius provider is unselected, Beenius is still used for some reason.
There's no Beenius log, so I don't know what's going on there.
It's strange indeed, I'll test it myself later and see if I can reproduce the behaviour. For now, I've made sure that Beenius doesn't work if I untick Genius via Beenius. I've deleted Lyrics Reloaded once made sure it doesn't work, will include it in future tests and see.

Come on now. Your plugin code may be simple, but MusicBee is not, and don't pretend it is guaranteed to be 100% bug free, especially with the proprietary allowedDistance code. If it fails for any reason, be it an application update, an unexpected input string, the Genius server being down, having a log that just outputs some information would be extremely helpful. Additionally, just knowing what it's searching for using the Beenius config would also be nice to have, especially for those really willing to tweak that config file.
I'll consider this a request and won't argue.

Ah, I didn't realize there was an anonymous one like that, my apologies. If at all configurable, probably a good idea. I would get my own token for this plugin.
GeniusClient.cs -> private string GeniusAnonymousAndroidToken (if you've read through code ofc).
It's not really a public one, but I'll have to make an instruction set for those who wanna use their own tokens. I dunno if Genius allows custom apps and didn't want to read through the ToS. In my case it was faster to implement the same logic as in the Android app search and mark the job done.
Last Edit: June 13, 2022, 12:42:51 PM by slonopot

slonopot

  • Newbie
  • *
  • Posts: 14
Found out I can actually add Musixmatch alongside Genius, added a poll.

frankuaku

  • Newbie
  • *
  • Posts: 13
  • MusicBee lover
Found out I can actually add Musixmatch alongside Genius, added a poll.
Bear in mind that with the Free API you can retrieve only 30% of the lyrics. You also have a daily API call limit. Anyway it would be a great idea!

slonopot

  • Newbie
  • *
  • Posts: 14
Found out I can actually add Musixmatch alongside Genius, added a poll.
Bear in mind that with the Free API you can retrieve only 30% of the lyrics. You also have a daily API call limit. Anyway it would be a great idea!

There's, again, an Android app with private API which has little protection and zero limits. I've already reversed everything they had done there, I think I'll extend Beenius with it later it if there's a demand.
They have some kind of ratelimit with "captcha" but I've not seen it anywhere other than in responses to malformed requests, 100 cosecutive searches had 0 "captchas" so it should be fine, at least as a fallback to Genius.

frankuaku

  • Newbie
  • *
  • Posts: 13
  • MusicBee lover
There's, again, an Android app with private API which has little protection and zero limits. I've already reversed everything they had done there, I think I'll extend Beenius with it later it if there's a demand.
Looks cool!  :-*

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7867
@slonopot- I appreciate the time you put into address all my questions/observations. I have tried the plugin again and tested with the same tracks I initially tested with. One track out of seven returned lyrics. I uninstalled your plugin and reactivated Lyrics Reloaded (Updated) and got seven out of seven.

Thanks for trying.
Download the latest MusicBee v3.4 patch from here.
Download the latest MusicBee v3.5 beta patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
Check out the MusicBee Wiki.
How to post screenshots is here

slonopot

  • Newbie
  • *
  • Posts: 14
@slonopot- I appreciate the time you put into address all my questions/observations. I have tried the plugin again and tested with the same tracks I initially tested with. One track out of seven returned lyrics. I uninstalled your plugin and reactivated Lyrics Reloaded (Updated) and got seven out of seven.

Thanks for trying.
I might try and explain why your exact tracks couldn't be found if I'll have a list of artists and titles.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7867
I might try and explain why your exact tracks couldn't be found if I'll have a list of artists and titles.
Is your plugin also looking at <Album>? If so, that may be the reason as the tracks I'm testing with are from a Paul McCartney live bootleg. I assume if it were only looking are <Artist> and <Title> It would come up with lyrics.
Here what I was testing:
Got Back Boston - Paul McCartney - Can't Buy Me Love
Got Back Boston - Paul McCartney - Junior's Farm
Got Back Boston - Paul McCartney - Letting Go
Got Back Boston - Paul McCartney - Got To Get You Into My Life
Got Back Boston - Paul McCartney - Come On To Me
Got Back Boston - Paul McCartney - Let Me Roll It
Got Back Boston - Paul McCartney - Getting Better

And I repeat - Lyrics Reloaded (Updated) worked for all these tracks. And has multiple sources from which to search.
Download the latest MusicBee v3.4 patch from here.
Download the latest MusicBee v3.5 beta patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
Check out the MusicBee Wiki.
How to post screenshots is here

slonopot

  • Newbie
  • *
  • Posts: 14
I might try and explain why your exact tracks couldn't be found if I'll have a list of artists and titles.
Is your plugin also looking at <Album>? If so, that may be the reason as the tracks I'm testing with are from a Paul McCartney live bootleg. I assume if it were only looking are <Artist> and <Title> It would come up with lyrics.
It does not look at Album, it only searches with track title and artist

Here what I was testing:
1. Paul McCartney - Can't Buy Me Love - hit via plugin
2. Paul McCartney - Junior's Farm - unavailable under this title, only like this (different artist with a feature)
3. Paul McCartney - Letting Go - can confirm an issue, hits this but it seems you'll need this which fits the previous inconsistency
4. Paul McCartney - Got To Get You Into My Life - search returns different options and none fits this exact title. Searching it as "The Beatles - Got To Get You Into My Life" does the job both in Genius and via plugin.
5. Paul McCartney - Come On To Me - hit via plugin
6. Paul McCartney - Let Me Roll It - mixed issue as with 2 and 4
7. Paul McCartney - Getting Better - only live version available via search

I'll fix an issue for 3 and probably will include an option to filter data coming from Genius the same way as the data coming from the client to suffice Live and DJ versions if those are available only.

Main issue is that my plugin does not consider such names as "Getting Better (Live / 2002)" or "Got to Get You into My Life (Live / 1989)" a hit because it might be a different song, like a radio or DJ edit as with Junior's Farm in Musixmatch. It seems LyricsReloaded allows way broader tolerances and you're fine with false positives.

My plugin is strict and will only ignore case and a minor number of edits to consider song a hit. MusicBee immediately adds lyrics if something is returned from the source so editing false positives was not an option for me, better leave it blank than wrong.

For example, you have a track with a title "Got To Get You Into My Life" and an artist "The Beatles". My plugin then searches Genius with "The Beatles Got To Get You Into My Life" and gets first results. For each of these search results a plugin concatenates the author with the track title to get "<Author> <Title>" the same way it's represented in the search. Then the plugin compares the lowercase versions of the strings and allows up to 5 (configurable) edits in the string (accidental characters, spaces etc). If both yours and one coming from Genius are considered valid by the plugin, only then you'll have a hit and will receive something.

Also have to make sure that we are comparing Genius as a lyrics source in my plugin and in the LyricsReloaded. Maybe some other sources are able to survive artist being seriously different.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 7867
Again I appreciate you taking the time to see if my "sample" tracks worked with your plugin. I used the Genius 2022 yml with Lyrics Reloaded and as I said before, it returned proper lyrics on each one. I didn't matter if the artist was Paul McCartney or The Beatles. Correct lyrics were returned.

I'm not going to spend any more time on this since what I have works well and "If it ain't broke, don't fix it."

No need for you to spend any more of your time addressing my issues.
Download the latest MusicBee v3.4 patch from here.
Download the latest MusicBee v3.5 beta patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
Check out the MusicBee Wiki.
How to post screenshots is here