Author Topic: LyricsReloaded  (Read 249835 times)

Freegells

  • Newbie
  • *
  • Posts: 9
Following in LostFuzz's footsteps, I decided to fix another provider, this time Letras de músicas (letras.mus.br). The instructions are the same as those other files, i.e., go to %AppData%\MusicBee\mb_LyricsReloaded\providers folder, create a file named letras.mus.br.yml, open it with Notepad or another plain text editor and paste the following code:

Code: letras.mus.br
name: "Letras de músicas"

variables:
    artist:
        type: artist
        filters:
        - lowercase
        - strip_diacritics
        - [replace, '.', '']
        - [strip_nonascii, -]
    title:
        type: title
        filters: artist

config:
    url: "https://letras.mus.br/{artist}/{title}/"
    pattern: ['<article>(?<lyrics>.+?)</article>', s]
    
post-filters:
- [replace, '</p>', '<br><br>']
- br2nl
- strip_html
- clean_spaces
- utf8_encode
Seems to work fine with most names with Portuguese diacritics. I've added an extra pre-filter to check for names with full stops (e.g. "Charlie Brown Jr."). I've also used the replace filter instead of the p2break available in the extension because it didn't seem to work as intended, leaving all lyrics with no paragraph separation.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9453
Try adding the following line to the end of the code for genius.com:

Code
- [regex, 'googletag.*\);', "\n"]
@redwing- should that line go at the -very- end of the code (under 'post-filters') or at the end of the variables  section?

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

Moshi_

  • Full Member
  • ***
  • Posts: 133
  • http://www.last.fm/user/Moshi_

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9453
at the -very- end of the code (under 'post-filters')



This worked for me.

Thanks redwing!
Thanks Moshi_
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

Leslio7

  • Newbie
  • *
  • Posts: 8
Hi, I have updated MusicBee to version 3.0.6067 and the plugin doesn't find the .yml files anymore. In the previous MusicBee version it worked perfectly. I wonder if I'm the only one with this problem.  :'(

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 9453
While the plugin's DLL goes in MB's plugin folder, the providers folder belongs in the AppData folder under the MB folder. So your folder structure should look like this:

\MusicBee
   \Plugins
      mb_LyricsReloaded.dll

\MusicBee
   \AppData
      \mb_LyricsReloaded
         \Providers
            *.yml
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

Leslio7

  • Newbie
  • *
  • Posts: 8
While the plugin's DLL goes in MB's plugin folder, the providers folder belongs in the AppData folder under the MB folder. So your folder structure should look like this:

\MusicBee
   \Plugins
      mb_LyricsReloaded.dll

\MusicBee
   \AppData
      \mb_LyricsReloaded
         \Providers
            *.yml
The plugin is in the correct path because MusicBee can find it.
And genius.com.yml is in the correct path because I triple checked it. I would like to know if there's anyone using MusicBee 3.0.6067 that has plugin finding the *.yml files.

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 34427
Hi, I have updated MusicBee to version 3.0.6067 and the plugin doesn't find the .yml files anymore. In the previous MusicBee version it worked perfectly. I wonder if I'm the only one with this problem.  :'(
you are the only person who has reported this so my guess is you have installed and are running the new musicbee version from a different location

Leslio7

  • Newbie
  • *
  • Posts: 8
Hi, I have updated MusicBee to version 3.0.6067 and the plugin doesn't find the .yml files anymore. In the previous MusicBee version it worked perfectly. I wonder if I'm the only one with this problem.  :'(
you are the only person who has reported this so my guess is you have installed and are running the new musicbee version from a different location
I'm running MusicBee from Mozambique, is there something I can do to solve this issue?
Last Edit: September 18, 2016, 10:24:22 AM by Leslio7

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 34427
Hi, I have updated MusicBee to version 3.0.6067 and the plugin doesn't find the .yml files anymore. In the previous MusicBee version it worked perfectly. I wonder if I'm the only one with this problem.  :'(
you are the only person who has reported this so my guess is you have installed and are running the new musicbee version from a different location
I'm running MusicBee from Mozambique, is there something I can do to resolve this issue?
location on your computer ie. you have two installed instances of musicbee

Leslio7

  • Newbie
  • *
  • Posts: 8
Hi, I have updated MusicBee to version 3.0.6067 and the plugin doesn't find the .yml files anymore. In the previous MusicBee version it worked perfectly. I wonder if I'm the only one with this problem.  :'(
you are the only person who has reported this so my guess is you have installed and are running the new musicbee version from a different location
I'm running MusicBee from Mozambique, is there something I can do to resolve this issue?
location on your computer ie. you have two installed instances of musicbee
Okay, I will completely uninstall MusicBee and then reinstall it again. I hope it works. Is there a way to save my current settings? Mostly regarding my UI changes.

Steven

  • Administrator
  • Hero Member
  • *****
  • Posts: 34427
you dont need to reinstall. You just need to find the (new) location you are actually running musicbee from and configure the plugin in that directory

Leslio7

  • Newbie
  • *
  • Posts: 8
you dont need to reinstall. You just need to find the (new) location you are actually running musicbee from and configure the plugin in that directory
I think you are right, because I reinstalled MusicBee and plugin still doesn't work. But how can I find the (new) location?
These are my current locations:
C:\Program Files (x86)\MusicBee\Plugins\mb_LyricsReloaded.dll     :This one seems to be working because MusicBee successfully found the plugin.
C:\Users\Leslio7\AppData\Roaming\MusicBee\mb_LyricsReloaded\providers\genius.com.yml    :This is the one that's been acting strange, because the when I enabled the plugin the \mb_LyricsReloaded\providers\ folders were automatically created, but the *.yml files are not appearing in Tags (2) as lyrics providers.

Leslio7

  • Newbie
  • *
  • Posts: 8
Help> Support> Settings File shows the location of your running MB's AppData folder.

Then go to the folder and find this plugin's folder within it.

Make sure the provider file is placed properly. Also check the log file (mb_LyricsReloaded.log) to see what happens when you search lyrics.
Thanks, I followed your instructions. The location is fine. Then I checked the log file and found this:
23/09/2016 05:55:54 [DEBUG] Loading config from file: C:\Users\Leslio7\AppData\Roaming\MusicBee\mb_LyricsReloaded\providers\genius.com.yml
23/09/2016 05:55:54 [ERROR] Failed to load a configuration:
23/09/2016 05:55:54 [ERROR] (Lin: 7, Col: 0, Chr: 111) - (Lin: 7, Col: 0, Chr: 111): While scanning a simple key, could not find expected ':'.
23/09/2016 05:55:54 [ERROR] YamlDotNet.Core.SyntaxErrorException: (Lin: 7, Col: 0, Chr: 111) - (Lin: 7, Col: 0, Chr: 111): While scanning a simple key, could not find expected ':'.
   at YamlDotNet.Core.Scanner.StaleSimpleKeys()
   at YamlDotNet.Core.Scanner.FetchMoreTokens()
   at YamlDotNet.Core.Scanner.InternalMoveNext()
   at YamlDotNet.Core.Parser.GetCurrentToken()
   at YamlDotNet.Core.Parser.ParseBlockMappingValue()
   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.YamlMappingNode..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)

Leslio7

  • Newbie
  • *
  • Posts: 8
Looks like your yml file has an syntax error. Do you have just "filters" instead of "filters:" in line 7?
Make sure you have copied the content correctly from previous posts.
This is what I have at line 7 and around it:
Screenshot link
The code seems to be okay.