Author Topic: LyricsReloaded (Updated)  (Read 164124 times)

frankz

  • Sr. Member
  • ****
  • Posts: 3834
Musixmatch is working fine for lyrics through the plugin here.  When I pull up the lyrics to that song and look at the site code in Chrome's Developer Tools->Sources, the tag that proceeds the lyrics is <p class="mxm-lyrics__content "><span class="lyrics__content__ok"> and ends with </span>, which matches fine.  

Maybe it's some regional difference. The only idea I'd have is to look at the site's coding as it comes up for you and create a custom YML to use in the plugin that matches the code as it's shown for you.  Instructions are here.  You'd create the YML and put it in the "providers" folder in the plugin directory.  Name it something different so you can tell the difference between it and the original in the list.

The original MusixMatch YML that you can use as a template/starting point can be found here.

redwing

  • Guest
Hello, I'm having a problem with Musixmatch.  It refuses to work for some reason.

Musixmatch has been using rate limiting per IP for years for security reasons.
So if your access to that site via MB exceeds a certain limit, it redirects to CAPTCHA. And if you fail to solve it, your IP gets blocked for a couple of days. Since it's MB, not your browser, that accesses the site while using the plugin, no way to see the CAPTCHA unless such feature is implemented to the plugin.
But that only applies to your access via MB and you can still access the site if you use a regular browser. That's why you observed this:

The part I don't understand is that if I go to that exact URL there are lyrics available.  Ideas?

Personally I don't include the site into my lyrics providers list since I often fetches lyrics for lots of songs at once, and only include it when I search lyrics manually for songs one by one.

frankz

  • Sr. Member
  • ****
  • Posts: 3834
That's good information to know.  Something to remember when using the plugin is that sites don't want you using plugins like this. They get nothing out of it.  It's a hacked solution.

The plugin is designed to bring up lyrics for songs as you listen to them and then utilize what's built into MB to view or save them.  Like, one song every three or four minutes or so.  That's a reasonable use and not something, I think, that sites would spend much time objecting to or caring much about.  It is not designed (as near as I can tell - I didn't design it) to be a bulk downloading tool. There is some code written for rate limiting, but I don't know how it was meant to work or if it was actually implemented anywhere.

ozzyzak

  • Newbie
  • *
  • Posts: 2
You don't have to edit or remake the DLL at all.  It's set up to be much easier to customize than that (not my doing, but nice anyway).

First, download the Genius YML file from github.  It's in the "Configs" folder.

Then, I guess, rename it to whatever you want (don't know if this is necessary).

Then open it in any text editor.

Change the name field from "Genius" to something like "Genius (with pointless non-standard section headers)"  ;)  so you'll know it is different when you see it in MB.

Delete that line from above from the "post-filter" section and save the file.

Put the YML file in \%AppData%\Roaming\MusicBee\mb_LyricsReloaded\providers

Relaunch MB, and you're set.  Deselect the built-in Genius and activate your custom version.

I am currently trying to do this but according to mb_LyricsReloaded.log:

08/05/2019 04:16:29 [DEBUG] Loading config from file: C:\Users\Scott\AppData\Roaming\MusicBee\mb_LyricsReloaded\providers\oldielyrics2.yml
08/05/2019 04:16:29 [ERROR] Failed to load a configuration:
08/05/2019 04:16:29 [ERROR] (Lin: 591, Col: 25, Chr: 48473) - (Lin: 591, Col: 25, Chr: 48473): Mapping values are not allowed in this context.
08/05/2019 04:16:29 [ERROR] YamlDotNet.Core.SyntaxErrorException: (Lin: 591, Col: 25, Chr: 48473) - (Lin: 591, Col: 25, Chr: 48473): Mapping values are not allowed in this context.
   at YamlDotNet.Core.Scanner.FetchValue()
   at YamlDotNet.Core.Scanner.FetchNextToken()
   at YamlDotNet.Core.Scanner.FetchMoreTokens()
   at YamlDotNet.Core.Scanner.InternalMoveNext()
   at YamlDotNet.Core.Parser.GetCurrentToken()
   at YamlDotNet.Core.Parser.ParseDocumentEnd()
   at YamlDotNet.Core.Parser.StateMachine()
   at YamlDotNet.Core.Parser.MoveNext()
   at YamlDotNet.Core.EventReader.Allow[T]()
   at YamlDotNet.Core.EventReader.Expect[T]()
   at YamlDotNet.RepresentationModel.YamlScalarNode..ctor(EventReader events, DocumentLoadingState state)
   at YamlDotNet.RepresentationModel.YamlNode.ParseNode(EventReader events, DocumentLoadingState state)
   at YamlDotNet.RepresentationModel.YamlDocument..ctor(EventReader events)
   at YamlDotNet.RepresentationModel.YamlStream.Load(TextReader input)
   at CubeIsland.LyricsReloaded.Provider.ProviderManager.loadProvider(TextReader configReader)
08/05/2019 04:16:29 [DEBUG] Received a notification of type PluginStartup
08/05/2019 04:16:29 [DEBUG] Received a notification of type 34
08/05/2019 04:16:30 [DEBUG] gzip compression detected
-----------------------------------------------------------------------------------------------------------------------------------
I get this for any yml file that I add into the providers folder. I know I must be missing something obvious. These files are being added as downloaded from github with no modifications whatsoever. Any ideas?

frankz

  • Sr. Member
  • ****
  • Posts: 3834
Why are you trying to load yml files as downloaded from github?  These are already built into the plugin.

EDIT: I think I know what you're doing wrong.  You're downloading it as a web page and it's coming in like this, right?

Code





<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
  <link rel="dns-prefetch" href="https://github.githubassets.com">
  <link rel="dns-prefetch" href="https://avatars0.githubusercontent.com">
  <link rel="dns-prefetch" href="https://avatars1.githubusercontent.com">
  <link rel="dns-prefetch" href="https://avatars2.githubusercontent.com">
  <link rel="dns-prefetch" href="https://avatars3.githubusercontent.com">
  <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com">
  <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/">



  <link crossorigin="anonymous" media="all" integrity="sha512-3+HOqCwtQal5hOJQ+mdxiq5zmGOTjF6RhjDsPLxbKDYgGlLFeCwzoIanb7j5IiCuXKUqyC2q8FdkC4nmx2P2rA==" rel="stylesheet" href="https://github.githubassets.com/assets/frameworks-a2fba223d5af91496cac70d4ec3624df.css" />
  
    <link crossorigin="anonymous" media="all" integrity="sha512-K1ZDcMAScrII4AIfkC9/MFPu46xORn2/Da/1QlFn28ti4WRM7VyDJsU8A+1HFS1EGl7djTNxgwr3eullJpwm9Q==" rel="stylesheet" href="https://github.githubassets.com/assets/github-391e36018f842d7a4844c9492593e63c.css" />
    
    
  
{Truncated for Space}


Better instructions would be to click the file you want, click "RAW" at the top, and then save the resulting page or copy and paste what's there into a text editor.  Should wind up looking like this.
Code
name: Oldies Lyrics

variables:
    artist:
        type: artist
        filters:
        - strip_diacritics
        - lowercase
        - [regex, '[^\sa-z0-9]\s*', ""]
        - [strip_nonascii, _]
    title:
        type: title
        filters: artist

config:
    url: "http://oldielyrics.com/lyrics/{artist}/{title}.html"
    pattern: ['<div\s+class="lyrics"[^>]*>\s*<p>(?<lyrics>.+)</p>\s*</div>', s]
    
post-filters:
- br2nl
- p2break
- strip_html
- strip_links
- entity_decode
- clean_spaces
- utf8_encode
Last Edit: May 09, 2019, 12:43:06 AM by frankz

ozzyzak

  • Newbie
  • *
  • Posts: 2
Why are you trying to load yml files as downloaded from github?  These are already built into the plugin.

EDIT: I think I know what you're doing wrong.  You're downloading it as a web page and it's coming in like this, right?

Code





<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
  <link rel="dns-prefetch" href="https://github.githubassets.com">
  <link rel="dns-prefetch" href="https://avatars0.githubusercontent.com">
  <link rel="dns-prefetch" href="https://avatars1.githubusercontent.com">
  <link rel="dns-prefetch" href="https://avatars2.githubusercontent.com">
  <link rel="dns-prefetch" href="https://avatars3.githubusercontent.com">
  <link rel="dns-prefetch" href="https://github-cloud.s3.amazonaws.com">
  <link rel="dns-prefetch" href="https://user-images.githubusercontent.com/">



  <link crossorigin="anonymous" media="all" integrity="sha512-3+HOqCwtQal5hOJQ+mdxiq5zmGOTjF6RhjDsPLxbKDYgGlLFeCwzoIanb7j5IiCuXKUqyC2q8FdkC4nmx2P2rA==" rel="stylesheet" href="https://github.githubassets.com/assets/frameworks-a2fba223d5af91496cac70d4ec3624df.css" />
 
    <link crossorigin="anonymous" media="all" integrity="sha512-K1ZDcMAScrII4AIfkC9/MFPu46xORn2/Da/1QlFn28ti4WRM7VyDJsU8A+1HFS1EGl7djTNxgwr3eullJpwm9Q==" rel="stylesheet" href="https://github.githubassets.com/assets/github-391e36018f842d7a4844c9492593e63c.css" />
   
   
 
{Truncated for Space}


Better instructions would be to click the file you want, click "RAW" at the top, and then save the resulting page or copy and paste what's there into a text editor.  Should wind up looking like this.
Code
name: Oldies Lyrics

variables:
    artist:
        type: artist
        filters:
        - strip_diacritics
        - lowercase
        - [regex, '[^\sa-z0-9]\s*', ""]
        - [strip_nonascii, _]
    title:
        type: title
        filters: artist

config:
    url: "http://oldielyrics.com/lyrics/{artist}/{title}.html"
    pattern: ['<div\s+class="lyrics"[^>]*>\s*<p>(?<lyrics>.+)</p>\s*</div>', s]
   
post-filters:
- br2nl
- p2break
- strip_html
- strip_links
- entity_decode
- clean_spaces
- utf8_encode

I'm actually trying to use the one for Genius, because just like supersonic, I am also interested in pointless non-standard section headers.  Thank you for the reply :)

FerranNL

  • Newbie
  • *
  • Posts: 8
  • Hi there!
Hello!

I've been encountering some issues regarding LyricsReloaded.
I did exactly as the README Installation told me to. Unzip the dll into the Plugins-folder of MusicBee... etc....
However, when I try to launch Music Bee, a prompt shows up:
(screenshot 1)
https://gyazo.com/c88f147dbb13edd8ade2268da462fbc3

This is strange because I just did a fresh Windows 10 install. I extracted the latest version of Music Bee. I extracted the lyricsReloaded plugin into the correct Plugins folder, and for some reason.. it just won't work.

After pressing "OK" on the error message shown above. Music Bee starts and shows the following error:
(screenshot 2)
https://gyazo.com/91805274506b3cc5bd3fadcc443e4237

Am I doing something wrong? If any of you know the solution to this problem, let me know!

Yours,


Ferran


sveakul

  • Sr. Member
  • ****
  • Posts: 2438
Hi frankz,
Was wondering if the extra lyrics search sites available via Steven's old mb_LyricsPlugin.dll can be integrated into LyricsReloaded (Updated)?   He posted the source code a while back (https://getmusicbee.com/forum/index.php?topic=4751.msg52204#msg52204) but I don't have the know-how to see if it's compatible with how LyricsReloaded is built.

frankz

  • Sr. Member
  • ****
  • Posts: 3834
I don't really have the know-how, either, but the OP for the original lyrics reloaded states that it's not an update of Steven's plugin but a total rewrite, and since he did use some sources from the original plugin and didn't use others, I'd assume the reason he decided not to use the sources that he chose not to use was that those sites are not compatible with the structure of the plugin.

In fact, looking at that OP now, he says certain sources are "not possible yet" in that post, and those include the ones from the original plugin that he didn't use.

If something has changed and you're able to make a working YML file for any of those sites, I'll be happy to add it into the plugin.  I've been pretty clear that the kind of RegEx skill needed to create these files is not in my wheelhouse and life is kind of coming at me too fast in this last year to get anywhere close to learning it.

The great thing about Lyrics Reloaded is that anyone can add sites to it on their own and then offer the YML for others to use, too.

Wish I could be more helpful, but I'm really just an overseer of the plugin.  My skills are such that I can do cleanup and maintenance but not really creation.

The two don't interfere with each other at all as far as I can tell.  Why not just use both?
Last Edit: June 01, 2019, 05:52:14 AM by frankz

sveakul

  • Sr. Member
  • ****
  • Posts: 2438
Yes, they both seem to work fine together, so I'll just stick with that.  Appreciated your reply.

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9305
@frankz

Before you took over this plugin (which once again I thank you for) I had created (or modified) a YML file. I'm now trying to create one and I can't find any YML files in my entire MB directory.

I currently have a weblink set up for Bing to grab lyrics for files that don't return any results via the plugin. But it's a real pain in the butt since I have to do each track individually.

Can you please give me some pointers on creating a YML? And where are the stored? The URL I use for Bing is
Code
https://bing.com/search?q=$Replace($First(<Artist>),&,and)+$Split(<Title>,"(",1)+Lyrics

And since the lyrics returned from Bing are fairly reliable, perhaps you'd consider adding it as another provider.

Thanks.
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: 3834
Hi,

Easy answers first and then onto the tougher stuff.

There are no YML files that come with the plugin because all of the providers are built in, so it's normal that you don't have any.  The YML functionality exists to allow anyone to either add providers or replace existing providers with a customized version at will. 

When created by the user, the user will put the YML file into the "providers" directory of their AppData (for me, it's Users\<username>\AppData\Roaming\MusicBee\mb_LyricsReloaded\providers but YMMV).  At that point, the custom provider will show up in the list with all of the other providers built into MB and built into the plugin.  It's a great little system, which I can say because I had nothing to do with inventing it at all.

The YMLs used for the providers that are built into the plugin can be found here:
https://github.com/mbfrankz/LyricsReloaded/tree/master/LyricsReloaded/Configs 

These are identical in format to what an end user will create when making one for a custom provider.  An example YML with some description, again provided by the plugin creator, can be found here: https://github.com/mbfrankz/LyricsReloaded/blob/master/LyricsReloaded/Configs/example.yml.  Looking at the YMLs that are actually in use at the previous link may provide a more real-world working knowledge of how things look in the wild, though.

In order to be compatible with the plugin, a site needs to serve up lyrics in text via an easily reproducible URL on pages that follow a set tagging format.  The plugin will try to pull in the URL you feed it, and then look for the start and end tags that you've provided.  It will pull in everything between those tags unless you filter it out in a post-filter. You can generally get these tag wrappers when you're on the page of lyrics by doing a "View Page Source" (or whatever it's called in the browser you use) and then finding the lyrics on that page.  You'll see the lyrics are framed in <div> tags.  If those tags are named the same for every set of lyrics that the site serves up, you're pretty much in business.

And that, unfortunately, is where my knowledge hits a wall.  I have been very honest from the get-go that I can be of absolutely no help in creating new YML files. It requires a lot of REGEX that I have a very big mental block with for some reason. If someone sets something up and it stops working, I may or may not be able to figure out why and make adjustments, but I am very bad at creating these things from scratch.  My own failing, I know, but I try to be upfront about it.

I don't know if the various functions you're using to construct the URL will work in the plugin.  None of the other YMLs appear to have any functions in them.  Whether that means they wouldn't work, I don't know.  The rest are built on simple tags.

Looking at your Bing example, I simply don't know if the lyrics would be provided in a consistently tagged format that would work. I see a "<div class="b_vPanel">" tag that I think is the start, but whether they're all that way is anyone's guess. If so, you'd then have to strip out all of the rest of the coding besides the <br> line breaks in that div via post-filters to get to a usable set of lyrics.

I wish I could be of more help.  Best bet is to experiment with your custom YML as the only provider and see what happens, I think.

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9305
Thanks frankz. I've been stumbling around RegEx for more years than I care to admit. Never could get the hang of it despite looking at (seemingly) every web tutorial available.

I should have some time later today where I will attempt to modify an existing YML and see if I can convince it to work with Bing.

I'll report back.
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

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9305
Well ... here's my update, plain and simple. I quit.

I created a bing.yml based on two other yml files, moved it to the top, and made sure it was the only provider selected. When I attempt to get lyrics for tracks, it opens up the bing web page in my browser.

So like you, frankz, RegEx is over my head.

I may come back to this at another point, but right now I don't have too much time to devote to 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