Author Topic: LyricsReloaded  (Read 241009 times)

iokoni

  • Newbie
  • *
  • Posts: 6
Ok, I got the artist tags part, but as far as I can tell, all of my files have display value the same as tag artist. So if I don't want to reedit every files manually so it seperate artist and guest artist, I think my best bet is to have a working code line to filter out any name after the first coma.

Alright so here's the full code I'm using:

Code
name: "Genius"

variables:
    artist:
        type: artist
        filters:
        - strip_diacritics
        - lowercase
        - [replace, "!!!", "chk-chik-chick"]
- [regex, '(?=,).*',""]
        - [regex, '(?<=\W|\s)+(feat.+|ft[\W\s]+|(f\.\s)).+', ""]
        - [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:
        - strip_diacritics
        - lowercase
        - [replace, "!!!", "chk-chik-chick"]
        - [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, -]

config:
    url: "http://genius.com/{artist}-{title}-lyrics"
    pattern: ['<div\s+class="song_body-lyrics"[^>]*?>[\s\S]*?<p>(?<lyrics>[\s\S]*?)</p>', s]

post-filters:
- strip_html
- clean_spaces
- utf8_encode
- [regex, 'googletag.*\);', "\n"]
- [regex, "’", "'"]

I still can't get it to work, still not remove any. So if you don't mind, could you share the full code that you got working. Thanks

iokoni

  • Newbie
  • *
  • Posts: 6
If you want to fix your tags in one shot, it's easy. Select tracks and run Tools> Tagging Tools> Search and replace command. Find "," for "Artist" Replace with";". Then those artist tags will be all separated to individual artist tags. And you won't need that code any longer.
oh yes, this is brilliant. Thank you so much! All my problems are now solved and I couldn't be happier :)

iokoni

  • Newbie
  • *
  • Posts: 6
I'll look into it later, but I'm fine with everything is right now. Thank for the suggestion.

Wormmy

  • Newbie
  • *
  • Posts: 3
So what's the 100% working script? Sorry, it's all scattered in this thread..

Alumni

  • Sr. Member
  • ****
  • Posts: 1007
Here's the updated code for Musixmatch.com.

Thanks for this script redwing. How does Musixmatch compare to Genius in terms of fetching lyrics?

gt55gt

  • Newbie
  • *
  • Posts: 1
MusicBee v3.1.6590.32668 (Win10.0), 23 Apr 2018 4:42:

System.NullReferenceException: Object reference not set to an instance of an object.
   at CubeIsland.LyricsReloaded.LyricsReloaded.shutdown()
   at CubeIsland.LyricsReloaded.LyricsReloaded.Finalize()



can anyone here help me to solve this problem??

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9343
@gt55gt- I moved your post to this sub-forum so the author of the plugin would see it.
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
After a few months of C# study I think I'm to the point where I'm competent enough to poke around in someone else's code and do housekeeping on it.   Mostly as an experiment and to prove to myself that I could, I decided to download the source to this plugin since (as far as I know) it's not actively maintained anymore and in need of a little provider maintenance (last update was nearly 4 years ago!) to see what happened. Much to my surprise, I was able to do a couple of things to it and actually produce a working updated copy for my own personal use.  

Here's what I've done:

Embedded redwing's "musixmatch_updated" and "Genius" ymls as hard coded providers.  

Removed tekstowo_pl as a provider since the site doesn't seem to work (got Chrome message about endless redirects).

I did make one change to the Genius code: I added a post-filters line for [regex, '\[.{1,20}\]', ""].  This is to filter out things like [Pre-Chorus], [Verse], [Verse 2 female], etc.  I did this for three reasons:
1. Those aren't lyrics. I'm a big believer in lyrics panels only displaying actual lyrics.
2. They're not consistent with what any other providers furnish so you wind up getting different results based on source, which is ugly.
3. They're not even furnished by Genius in any consistent way or with regularity

Once I've used my new custom built version for a while and am confident it's not going to screw anything up (so far so good - it's pulling lyrics without errors) I'd be willing to do a cleanup / addition to be made public.   To do this I'd need some information:

1. A list of providers in there which aren't working any more
2. Links to code in this thread for providers which weren't initially included but have been added by users via YAML
3. Any generally agreed-upon YAML updates for the plug-in's existing providers
4. Someone to tell me what to do with it when I'm done

I hope I'm not stepping on toes here.  It'll be a looooong time before I'm able to actually update a plug-in's functionality (if ever) or (gulp) create one, but this seemed like a good way to get my feet wet in the plug-in world and expand my programming knowledge base beyond little console programs I can think up to do myself, which is what I've done in C# up until now.

 If anyone's interested, let me know.

Alumni

  • Sr. Member
  • ****
  • Posts: 1007
If anyone's interested, let me know.

Just wanted to say that any efforts you make to maintain this plugin are appreciated.

Wormmy

  • Newbie
  • *
  • Posts: 3
If anyone's interested, let me know.

Yes please! I'm willing to donate if it meets my expecs. :D

frankz

  • Sr. Member
  • ****
  • Posts: 3876
Just wanted to say that any efforts you make to maintain this plugin are appreciated.
There's a learning curve here, but I'm working.

Yes please! I'm willing to donate if it meets my expecs. :D
No need for that.  :)  Can't promise big changes in functionality, only a little clean-up.

Anyway, I've got a working version that I think is ready for prime time.  Here's what I did.
1. Got rid of the "Configure" button that didn't do anything besides confuse a lot of people (me included) and added a message on the Plugins page about where to configure the plug-in.
2. Removed PinkRadio and Tesktowo because the sites don't appear to be functional any more
3. Added code from this thread for Genius (with the edit listed above), MusixMatch and Metrolyrics.  You won't need separate yml files for those any more.
4. Changed the description to something a little less confrontational sounding
5. Updated copyright to -2018, added myself as maintainer while retaining plugin's original author's credit, updated revision from 1.1.2 to 1.1.3

Questions:

1. I think lyrics.wikia, lyrics.wikia (Gracenote) are part of MB.  Do they need to be in the plug-in any more?
2. Did I miss any additions from the thread?
3. Did I miss any dead sites that should be removed?
4. What's the etiquette here: Should I contact OP for his blessing (he appears to have abandoned this plugin and moved on to a stand-alone program years ago) or just let it rip?
5. How do I get this to people?  I don't have a github or bitbucket set up.  It'd just be the dll.

sveakul

  • Sr. Member
  • ****
  • Posts: 2460
Hi frankz, any news on the availability of your update of this plugin?  Much anticipated!!  As far as distribution, could you for now perhaps post it as a link to a Microsoft OneDrive, Google Drive, or similar download location for those of us who would like to try it as-is? :)

frankz

  • Sr. Member
  • ****
  • Posts: 3876
Figured there was little interest since no one responded, so I just continued using it myself here.

One small change since above, I removed Metrolyrics since it didn't handle songs that don't have lyrics on that site very elegantly.

[DELETED BY FRANK]

(you can, of course, download the file and then upload it to VirusTotal.com yourself to verify)

Personally, I'd rename my current mb_LyricsReloaded.dll to something else and keep it for a while rather than overwrite it outright with this one.   It's working flawlessly here on my system with my MB version, but I can't speak to every MB version on every system.

Make sure MB is completely closed and put this new mb_LyricsReloaded.dll wherever your current mb_LyricsReloaded.dll file currently resides.  I believe the two places on desktop type installs are

 /%ProgramFiles%/MusicBee/Plugins
-or-
/%APPDATA%/Roaming/MusicBee/Plugins

(not %APPDATA%/Roaming/MusicBee/mb_LyricsReloaded/.  That's where the log file is.)

Don't know anything about the Windows Store version, so you're on your own there.  It shouldn't be different than replacing any other plugin.

Make sure you only have one copy referenced in MB.  The only problem I ever had with it was when I first put my version in the program files plugin folder while the original was in the roaming plugin folder.  MB complained about the log being in use already and crashed.  If you get this error, it likely means you already have the plugin running from somewhere else.

Consider the above version experimental and act accordingly.
Last Edit: May 21, 2018, 10:38:15 PM by frankz

sveakul

  • Sr. Member
  • ****
  • Posts: 2460
Thanks frankz!  I (and probably many others!) will be trying it out the next few days and will get back to you.  Appreciate the link and the detailed info.

sveakul

  • Sr. Member
  • ****
  • Posts: 2460
You might as well get the "possibly dumb" questions first, haha..  Environment wise, I'm starting with MusicBee Portable (latest 3.2 patch), and no prior install of the original LyricsReloaded plugin.  I added the updated plugin via MB's Add Plugin button and all went smoothly;  in the Portable version, the log file ends up in (drive:)/MusicBee/Appdata/mb_LyricsReloaded.

1.  I read in the original version's documentation that the original ordering of the provider search list would be done automatically according to "best results" whe first installed--is that the case with the new version as well?  If not, do you have any advice as to how to order the given list?

2.  I don't auto-tag anything, so I'm adding lyrics from the Edit/Lyrics/Search Internet button;  is this performing the same type of search I have set up in the Tags(2) prefs for the plugin?

3.  I'm assuming that when lyrics are found after hitting the "Search Internet" button, they are coming from the first hit made on the ordered provider list;  does the search option "hard stop" there unless the provider from the initial hit is unchecked from the list?  I'm thinking of cases where "flaky" results turn up and you'd like to see what a different provider is offering for the same song.

4.  For a future release, would it be possible to institute a maximum size option for the log file?

Thanks frankz!  Initial impressions after an hour:  "Sweet!"  8)