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

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9305
I moved this to the LyricsReloaded (Updated) thread.
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
This line...
Code
30/12/2021 11:10:50 [DEBUG] lyrics found from Musixmatch!
...shows that it did find the lyrics at that url.

YukiSoul

  • Newbie
  • *
  • Posts: 13
I moved this to the LyricsReloaded (Updated) thread.
thank you

This line...
Code
30/12/2021 11:10:50 [DEBUG] lyrics found from Musixmatch!
...shows that it did find the lyrics at that url.
yes, it is. but No lyrics appear on lyric floating window you can see second image in my imgur

 
https://imgur.com/a/6ayOkU9

frankz

  • Sr. Member
  • ****
  • Posts: 3834
The plug-in retrieves lyrics from third-party sites.  It does not display the lyrics.  I don't know why MB wouldn't show lyrics if they are retrieved.

Are the lyrics present in your file?  In other words, is it just a display issue or are they also not being saved?

I don't know if it matters (I don't think it should since the lyrics are being found properly), but make sure you're using the updated script for MusixMatch since the built-in one quit working.

But other than that I have no answers.  Sorry.

YukiSoul

  • Newbie
  • *
  • Posts: 13
how can i check the lyrics present in my file?

it's not always "not found" it also shown the lyrics like in this log
Code
31/12/2021 04:11:10 [DEBUG] Lyrics request: Clouds And Thorns - Everything Is Possible Now - Everything Is Possible Now - Musixmatch
31/12/2021 04:11:10 [INFO] Musixmatch tries to load the lyrics...
31/12/2021 04:11:10 [DEBUG] The constructed URL: http://www.musixmatch.com/lyrics/clouds-and-thorns/everything-is-possible-now
31/12/2021 04:11:10 [DEBUG] Lyrics request: Clouds And Thorns - Everything Is Possible Now - Everything Is Possible Now - Genius
31/12/2021 04:11:10 [INFO] Genius tries to load the lyrics...
31/12/2021 04:11:10 [DEBUG] The constructed URL: http://genius.com/clouds-and-thorns-everything-is-possible-now-lyrics
31/12/2021 04:11:10 [DEBUG] Lyrics request: Clouds And Thorns - Everything Is Possible Now - Everything Is Possible Now - MetroLyrics
31/12/2021 04:11:10 [INFO] MetroLyrics tries to load the lyrics...
31/12/2021 04:11:10 [DEBUG] The constructed URL: http://www.metrolyrics.com/everything-is-possible-now-lyrics-clouds-and-thorns.html
31/12/2021 04:11:10 [DEBUG] Lyrics request: Clouds And Thorns - Everything Is Possible Now - Everything Is Possible Now - Urban Lyrics
31/12/2021 04:11:10 [INFO] Urban Lyrics tries to load the lyrics...
31/12/2021 04:11:10 [DEBUG] The constructed URL: http://www.urbanlyrics.com/lyrics/cloudsandthorns/everythingispossiblenow.html
31/12/2021 04:11:10 [DEBUG] Lyrics request: Clouds And Thorns - Everything Is Possible Now - Everything Is Possible Now - Song Lyrics
31/12/2021 04:11:10 [INFO] Song Lyrics tries to load the lyrics...
31/12/2021 04:11:10 [DEBUG] The constructed URL: http://www.songlyrics.com/clouds-and-thorns/everything-is-possible-now-lyrics/
31/12/2021 04:11:10 [DEBUG] Lyrics request: Clouds And Thorns - Everything Is Possible Now - Everything Is Possible Now - Musixmatch_Asian
31/12/2021 04:11:10 [INFO] Musixmatch_Asian tries to load the lyrics...
31/12/2021 04:11:10 [DEBUG] The constructed URL: http://www.musixmatch.com/lyrics/Clouds-And-Thorns/Everything-Is-Possible-Now
31/12/2021 04:11:10 [DEBUG] gzip compression detected
31/12/2021 04:11:10 [DEBUG] lyrics found from Song Lyrics!
31/12/2021 04:11:10 [DEBUG] gzip compression detected
31/12/2021 04:11:10 [DEBUG] lyrics found from Musixmatch!
31/12/2021 04:11:10 [DEBUG] gzip compression detected
31/12/2021 04:11:10 [WARN] The pattern <div class="lyrics">(?<lyrics>[\s\S]*?)</div> didn't match!
31/12/2021 04:11:10 [INFO] No lyrics found.
31/12/2021 04:11:10 [DEBUG] no lyrics found from Genius
31/12/2021 04:11:15 [DEBUG] Received a notification of type TagsChanging
now i try to close MB, delete the log, re open MB, and this is the startup log
Code
31/12/2021 04:17:22 [INFO] mb_LyricsReloaded in version 1.1.10.0 started!
31/12/2021 04:17:22 [DEBUG] Loading config from field provider_cuspajz_com
31/12/2021 04:17:22 [INFO] Provider loaded: Cušpajz
31/12/2021 04:17:22 [DEBUG] Loading config from field provider_genius_com
31/12/2021 04:17:22 [INFO] Provider loaded: Genius
31/12/2021 04:17:22 [DEBUG] Loading config from field provider_hindilyrics_net
31/12/2021 04:17:22 [INFO] Provider loaded: Hindi Lyrics
31/12/2021 04:17:22 [DEBUG] Loading config from field provider_letras_mus_br
31/12/2021 04:17:22 [INFO] Provider loaded: Letras de músicas
31/12/2021 04:17:22 [DEBUG] Loading config from field provider_metrolyrics_com
31/12/2021 04:17:22 [INFO] Provider loaded: MetroLyrics
31/12/2021 04:17:22 [DEBUG] Loading config from field provider_musixmatch_com
31/12/2021 04:17:22 [INFO] Provider loaded: Musixmatch
31/12/2021 04:17:22 [DEBUG] Loading config from field provider_musixmatch_com_asian
31/12/2021 04:17:22 [INFO] Provider loaded: Musixmatch_Asian
31/12/2021 04:17:22 [DEBUG] Loading config from field provider_oldielyrics_com
31/12/2021 04:17:22 [INFO] Provider loaded: Oldies Lyrics
31/12/2021 04:17:22 [DEBUG] Loading config from field provider_smriti_com
31/12/2021 04:17:22 [INFO] Provider loaded: Smriti
31/12/2021 04:17:22 [DEBUG] Loading config from field provider_songlyrics_com
31/12/2021 04:17:22 [INFO] Provider loaded: Song Lyrics
31/12/2021 04:17:22 [DEBUG] Loading config from field provider_teksty_org
31/12/2021 04:17:22 [INFO] Provider loaded: Teksty
31/12/2021 04:17:22 [DEBUG] Loading config from field provider_urbanlyrics_com
31/12/2021 04:17:22 [INFO] Provider loaded: Urban Lyrics
31/12/2021 04:17:22 [DEBUG] Loading config from file: C:\Users\myfolder\AppData\Roaming\MusicBee\mb_LyricsReloaded\providers\azlyrics.com.yml
31/12/2021 04:17:22 [ERROR] Failed to load a configuration:
31/12/2021 04:17:22 [ERROR] (Lin: 89, Col: 64, Chr: 9494) - (Lin: 89, Col: 64, Chr: 9494): Mapping values are not allowed in this context.
31/12/2021 04:17:22 [ERROR] YamlDotNet.Core.SyntaxErrorException: (Lin: 89, Col: 64, Chr: 9494) - (Lin: 89, Col: 64, Chr: 9494): 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)
31/12/2021 04:17:22 [DEBUG] Loading config from file: C:\Users\myfolder\AppData\Roaming\MusicBee\mb_LyricsReloaded\providers\genius.com.yml
31/12/2021 04:17:22 [INFO] Provider loaded: Genius
31/12/2021 04:17:22 [INFO] The provider Genius does already exist and will be replaced.
31/12/2021 04:17:22 [DEBUG] Loading config from file: C:\Users\myfolder\AppData\Roaming\MusicBee\mb_LyricsReloaded\providers\musixmatch.com.yml
31/12/2021 04:17:22 [INFO] Provider loaded: Musixmatch
31/12/2021 04:17:22 [INFO] The provider Musixmatch does already exist and will be replaced.
31/12/2021 04:17:22 [DEBUG] Received a notification of type PluginStartup
31/12/2021 04:17:22 [DEBUG] Received a notification of type MusicBeeStarted
31/12/2021 04:17:22 [DEBUG] gzip compression detected
seems like there is error shown but unfortunately i don't know how to fix it. is it cause of the problem?
Last Edit: December 30, 2021, 07:36:40 PM by YukiSoul

frankz

  • Sr. Member
  • ****
  • Posts: 3834
A to Z lyrics was removed a long time ago because it stopped working, yet you have it here.  You're using the current version of the plug-in - are you using a custom provider for A to Z?  Either way, disable it and see if that fixes the problem.

sveakul

  • Sr. Member
  • ****
  • Posts: 2438
frankz:  I can't recall where I got the yml file--possibly your github site?-- but A-Z Lyrics Universe is working well for me using that, contents below:

Code
name: A-Z Lyrics Universe

variables:
    artist:
        type: artist
        filters:
        - lowercase
        - strip_nonascii
    title:
        type: title
        filters: artist

headers:
    User-Agent: 'Mozilla/5.0 (Windows NT 6.3; WOW64; rv:30.0) Gecko/20100101 Firefox/30.0' # Firefox 30 Win x64 user agent

config:
    url: "http://www.azlyrics.com/lyrics/{artist}/{title}.html"
    pattern: ['<!-- Usage of azlyrics.com content by any third-party lyrics provider is prohibited by our licensing agreement. Sorry about that. -->(?<lyrics>.+?)<!-- MxM banner -->', s]
    
post-filters:
- strip_html
- trim
- utf8_encode

YukiSoul

  • Newbie
  • *
  • Posts: 13
after replaced my AZLyrics Provider and using code from sveakul error is fixed.
i try reopen the first song that i open the log in here,
Can somebody tell me what happen on this LyricsReloaded log?
Code
30/12/2021 11:10:49 [DEBUG] Lyrics request: Penny and Sparrow - Eloise - Finch - Musixmatch
30/12/2021 11:10:49 [INFO] Musixmatch tries to load the lyrics...
30/12/2021 11:10:49 [DEBUG] The constructed URL: http://www.musixmatch.com/lyrics/penny-and-sparrow/eloise
30/12/2021 11:10:49 [DEBUG] The constructed URL: http://www.musixmatch.com/lyrics/penny-and-sparrow/eloise
30/12/2021 11:10:49 [DEBUG] Lyrics request: Penny and Sparrow - Eloise - Finch - Musixmatch_Asian
30/12/2021 11:10:49 [INFO] Musixmatch_Asian tries to load the lyrics...
30/12/2021 11:10:49 [DEBUG] The constructed URL: http://www.musixmatch.com/lyrics/Penny-and-Sparrow/Eloise
30/12/2021 11:10:49 [DEBUG] Lyrics request: Penny and Sparrow - Eloise - Finch - Genius
30/12/2021 11:10:49 [INFO] Genius tries to load the lyrics...
30/12/2021 11:10:49 [DEBUG] The constructed URL: http://genius.com/penny-and-sparrow-eloise-lyrics
30/12/2021 11:10:49 [DEBUG] Lyrics request: Penny and Sparrow - Eloise - Finch - MetroLyrics
30/12/2021 11:10:49 [INFO] MetroLyrics tries to load the lyrics...
30/12/2021 11:10:49 [DEBUG] The constructed URL: http://www.metrolyrics.com/eloise-lyrics-penny-and-sparrow.html
30/12/2021 11:10:49 [DEBUG] Lyrics request: Penny and Sparrow - Eloise - Finch - Urban Lyrics
30/12/2021 11:10:49 [INFO] Urban Lyrics tries to load the lyrics...
30/12/2021 11:10:49 [DEBUG] The constructed URL: http://www.urbanlyrics.com/lyrics/pennyandsparrow/eloise.html
30/12/2021 11:10:49 [DEBUG] Lyrics request: Penny and Sparrow - Eloise - Finch - Song Lyrics
30/12/2021 11:10:49 [INFO] Song Lyrics tries to load the lyrics...
30/12/2021 11:10:49 [DEBUG] The constructed URL: http://www.songlyrics.com/penny-and-sparrow/eloise-lyrics/
30/12/2021 11:10:49 [DEBUG] Lyrics request: Penny and Sparrow - Eloise - Finch - Teksty
30/12/2021 11:10:49 [INFO] Teksty tries to load the lyrics...
30/12/2021 11:10:49 [DEBUG] The constructed URL: http://teksty.org/penny-and-sparrow,eloise,tekst-piosenki
30/12/2021 11:10:49 [DEBUG] Lyrics request: Penny and Sparrow - Eloise - Finch - Smriti
30/12/2021 11:10:49 [INFO] Smriti tries to load the lyrics...
30/12/2021 11:10:49 [DEBUG] The constructed URL: http://smriti.com/hindi-songs/eloise
30/12/2021 11:10:49 [DEBUG] Lyrics request: Penny and Sparrow - Eloise - Finch - Letras de músicas
30/12/2021 11:10:49 [INFO] Letras de músicas tries to load the lyrics...
30/12/2021 11:10:49 [DEBUG] The constructed URL: http://letras.mus.br/penny-and-sparrow/eloise/
30/12/2021 11:10:49 [DEBUG] Lyrics request: Penny and Sparrow - Eloise - Finch - Hindi Lyrics
30/12/2021 11:10:49 [INFO] Hindi Lyrics tries to load the lyrics...
30/12/2021 11:10:49 [DEBUG] The constructed URL: http://www.hindilyrics.net/lyrics/of-Eloise.html
30/12/2021 11:10:49 [DEBUG] Lyrics request: Penny and Sparrow - Eloise - Finch - Cušpajz
30/12/2021 11:10:49 [INFO] Cušpajz tries to load the lyrics...
30/12/2021 11:10:49 [DEBUG] The constructed URL: http://cuspajz.com/tekstovi-pjesama/pjesma/penny-and-sparrow/eloise.html
30/12/2021 11:10:49 [DEBUG] Lyrics request: Penny and Sparrow - Eloise - Finch - Oldies Lyrics
30/12/2021 11:10:49 [INFO] Oldies Lyrics tries to load the lyrics...
30/12/2021 11:10:49 [DEBUG] The constructed URL: http://oldielyrics.com/lyrics/penny_and_sparrow/eloise.html
30/12/2021 11:10:50 [INFO] No lyrics found.
30/12/2021 11:10:50 [DEBUG] no lyrics found from Song Lyrics
30/12/2021 11:10:50 [DEBUG] gzip compression detected
30/12/2021 11:10:50 [DEBUG] gzip compression detected
30/12/2021 11:10:50 [INFO] No lyrics found.
30/12/2021 11:10:50 [DEBUG] no lyrics found from Hindi Lyrics
30/12/2021 11:10:50 [DEBUG] lyrics found from Musixmatch_Asian!
30/12/2021 11:10:50 [DEBUG] lyrics found from Musixmatch!
30/12/2021 11:10:50 [INFO] No lyrics found.
30/12/2021 11:10:50 [DEBUG] no lyrics found from Teksty
30/12/2021 11:10:50 [DEBUG] gzip compression detected
30/12/2021 11:10:50 [WARN] The pattern <div class="lyrics">(?<lyrics>[\s\S]*?)</div> didn't match!
30/12/2021 11:10:50 [INFO] No lyrics found.
30/12/2021 11:10:50 [DEBUG] no lyrics found from Genius
30/12/2021 11:10:50 [INFO] No lyrics found.
30/12/2021 11:10:50 [DEBUG] no lyrics found from Oldies Lyrics
30/12/2021 11:10:51 [DEBUG] gzip compression detected
30/12/2021 11:10:51 [WARN] The pattern <div class="songbody">(?<lyrics>.*?)</div> didn't match!
30/12/2021 11:10:51 [INFO] No lyrics found.
30/12/2021 11:10:51 [DEBUG] no lyrics found from Smriti
30/12/2021 11:10:51 [DEBUG] gzip compression detected
30/12/2021 11:10:51 [WARN] The pattern <p\sclass="text\sclearfix">(?<lyrics>[\s\S]*?)</p> didn't match!
30/12/2021 11:10:51 [INFO] No lyrics found.
30/12/2021 11:10:51 [DEBUG] no lyrics found from Cušpajz
30/12/2021 11:10:52 [DEBUG] gzip compression detected
30/12/2021 11:10:52 [WARN] The pattern <div id="div_letra"[^>]*>(?<lyrics>.*?)</div> didn't match!
30/12/2021 11:10:52 [INFO] No lyrics found.
30/12/2021 11:10:52 [DEBUG] no lyrics found from Letras de músicas
its showing No lyrics found on lyric floating window.
but in the log, for example in this line,
Quote
30/12/2021 11:10:49 [INFO] Musixmatch tries to load the lyrics...
30/12/2021 11:10:49 [DEBUG] The constructed URL: http://www.musixmatch.com/lyrics/penny-and-sparrow/eloise
30/12/2021 11:10:49 [DEBUG] The constructed URL: http://www.musixmatch.com/lyrics/penny-and-sparrow/eloise
30/12/2021 11:10:49 [DEBUG] Lyrics request: Penny and Sparrow - Eloise - Finch - Musixmatch_Asian
when i open the link, there is lyrics in musixmatch site but why still "No lyric found" ?
Can anyone help? at least some guess about what is happening here.

https://imgur.com/a/6ayOkU9
now lyrics shown as expected. thanks guys.
sometimes i got WARN like
Code
31/12/2021 03:35:24 [DEBUG] lyrics found from Song Lyrics!
31/12/2021 03:35:25 [DEBUG] gzip compression detected
31/12/2021 03:35:25 [WARN] The pattern <div class="Lyrics__Container.*?">(?<lyrics>.*)<div class="Lyrics__Footer.*?"> didn't match!
31/12/2021 03:35:25 [INFO] No lyrics found.
//---------------------or---------------------------
31/12/2021 03:39:39 [DEBUG] no lyrics found from Musixmatch_Asian
31/12/2021 03:39:39 [WARN] The pattern <p class="mxm-lyrics__content.*?">(?<lyrics>.*?)<div [^>]*"lyrics-report".*?> didn't match!
//----------------------or---------------------------
31/12/2021 03:39:39 [DEBUG] no lyrics found from Genius
31/12/2021 03:39:39 [DEBUG] gzip compression detected
31/12/2021 03:39:39 [DEBUG] gzip compression detected
31/12/2021 03:39:39 [WARN] The pattern <p class="mxm-lyrics__content ">\s*(?<lyrics>.*?)(</span>|<div[^>]*"lyrics-report") didn't match!
31/12/2021 03:39:39 [INFO] No lyrics found.
sometimes lyric found and no problem with the pattern, sometimes pattern didn't match.
is it normal? or i should change that provider too?

YukiSoul

  • Newbie
  • *
  • Posts: 13
Sorry for asking so many things, i notice another reason why some of my music not found the lyrics
Do you guys have solution how to display lyrics if the artist is multiple?
in my music i always edit the artis name in this pattern "artistName1, artistName2, etc" let me show you in picture


when i open "you were good to me" LyricsReloaded  find the song like for example
musixmatch = http://www.musixmatch.com/lyrics/Jeremy-Zucker/you-were-good-to-me      
genius = https://genius.com/jeremy-zucker-you-were-good-to-me-lyrics
(NOTFOUND)

when i search it manually for,
musixmatch = https://www.musixmatch.com/lyrics/Jeremy-Zucker-feat-Chelsea-Cutler/you-were-good-to-me
genius  = https://genius.com/Jeremy-zucker-and-chelsea-cutler-you-were-good-to-me-lyrics
(FOUND)

in musixmatch  they use "feat" as replacement for comma(,)
in genius they use "and" as replacement for comma(,)

i got the logic here, but how can i make LyricsReloaded search the lyrics in this pattern if music artist are multiple?

frankz

  • Sr. Member
  • ****
  • Posts: 3834
sometimes lyric found and no problem with the pattern, sometimes pattern didn't match.
is it normal? or i should change that provider too?
That means the page exists, but there are no lyrics on it (or they changed the code from the pattern that the plugin expects and the lyrics aren't between the tags that the plugin expects).  There's no way to fix it if it's the former, if it's the latter the way to fix it is to write new code for the provider as users in this thread have done for Musixmatch and Genius.

i got the logic here, but how can i make LyricsReloaded search the lyrics in this pattern if music artist are multiple?
You can't.  It will search for whatever is in "Display Artist" so display artist must be the artist that the lyric sites expect. 

The way that works is to split out multiple artists in the artist splitter, not show them in display artist, and list them as "feat" in the title. 

YukiSoul

  • Newbie
  • *
  • Posts: 13
That means the page exists, but there are no lyrics on it (or they changed the code from the pattern that the plugin expects and the lyrics aren't between the tags that the plugin expects).  There's no way to fix it if it's the former, if it's the latter the way to fix it is to write new code for the provider as users in this thread have done for Musixmatch and Genius.
oh ok, i guess i should write my script for that.
do you have some great site so i can getting start to write the code?

The way that works is to split out multiple artists in the artist splitter, not show them in display artist, and list them as "feat" in the title.  
wait, if i make feat/and  it in the title  LyricsReloaded will find the song like,
"http://www.musixmatch.com/lyrics/Jeremy-Zucker/you-were-good-to-me-feat-Chelsea-Cutler" and will not found the lyrics.
while the correct one is "https://www.musixmatch.com/lyrics/Jeremy-Zucker-feat-Chelsea-Cutler/you-were-good-to-me"
(https://www.musixmatch.com/lyrics/ARTIST/TITLE)

or maybe is there a way to make if else statement in provider.yml code. i want to make it be like if(artist is multiple) do use this code. else, do code.
Last Edit: December 31, 2021, 07:56:10 PM by YukiSoul

frankz

  • Sr. Member
  • ****
  • Posts: 3834
oh ok, i guess i should write my script for that.
do you have some great site so i can getting start to write the code?
https://github.com/mbfrankz/LyricsReloaded/tree/master/LyricsReloaded

wait, if i make feat/and  it in the title  LyricsReloaded will find the song like,
"http://www.musixmatch.com/lyrics/Jeremy-Zucker/you-were-good-to-me-feat-Chelsea-Cutler" and will not found the lyrics.
while the correct one is "https://www.musixmatch.com/lyrics/Jeremy-Zucker-feat-Chelsea-Cutler/you-were-good-to-me"
(https://www.musixmatch.com/lyrics/ARTIST/TITLE)

or maybe is there a way to make if else statement in provider.yml code. i want to make it be like if(artist is multiple) do use this code. else, do code.
The long and short of it is that your files have to be tagged so that they match the standards and conventions used by the lyrics site(s) you want to use.


wavedash

  • Newbie
  • *
  • Posts: 5
Can anyone help me with a Regex problem? I'm trying to make a duplicate Musixmatch yaml that'll try to get lyrics for artists with swapped name order.

Example: I have a song titled "Kieru Daydream" by "Kawano Marina". But the Musixmatch URL is https://www.musixmatch.com/lyrics/Marina-Kawano/Kieru-Daydream. Predictably, here's what happens with the updated Musixmatch yaml from a few pages back:

Code
18/01/2022 09:27:38 [INFO] Musixmatch-Update tries to load the lyrics...
18/01/2022 09:27:38 [DEBUG] The constructed URL: http://www.musixmatch.com/lyrics/kawano-marina/kieru-daydream
18/01/2022 09:27:38 [INFO] No lyrics found.
18/01/2022 09:27:38 [DEBUG] no lyrics found from Musixmatch-Update

I'm trying stuff like this, but it seems like it isn't matching:

Code
[regex, '(\w+) (\w+)', '\2 \1']
or
[regex, '([a-z]+) ([a-z]+)', '\2 \1']

Code
18/01/2022 09:37:59 [INFO] Musixmatch-Name-Order tries to load the lyrics...
18/01/2022 09:37:59 [DEBUG] The constructed URL: http://www.musixmatch.com/lyrics/kawano-marina/kieru-daydream
18/01/2022 09:37:59 [INFO] No lyrics found.
18/01/2022 09:37:59 [DEBUG] no lyrics found from Musixmatch-Name-Order

avitar

  • Newbie
  • *
  • Posts: 10
Quote
[regex, '(\w+) (\w+)', '\2 \1']

You were on the right track. The problem was mostly the backreference. What you need is this:

Code
    - [regex, '(\w+)(\s)(\w+)', $3$2$1]

Unlike normal find/replace syntax, you are passing these variables back to plugin - written in C#. The plugin won't recognize the \1 syntax and throws an error.

You probably already know, but you would place this line above the following line in the artist variable area:

Code
     - [strip_nonascii, -]

Another problem you may face is that many of these configuration files use the filters from the "artist" field  for the title and album fields. It reduces typing. You'll see something like this.


Code
   title:
        type: title
        filters: artist


Obviously if yours does that then you would have to modify the title filter. Otherwise your title would swap as well.

Another caveat to remember is that if your artist name is more than two names, then the above solution will not work. You would just be swapping the first two names around.  However I can't imagine that Musixmatch would do this swapping thing for an artist with more than two names - ie David Allen Coe vs Coe Allen David or some such nonsense. So you should be good.

Anyway, I have included the yml code with everything modified and in the right place. I tested it prior to posting and it works fine (or rather I got a bunch of lyrics; in Japanese I think.) The bottom line is that I received lyrics from  the site.


The following yml file code is a special case. It will not work for normal requests to Musixmatch.

Code
name: Musixmatch Swap Artist Order

variables:
    artist:
        type: artist
        filters:
        - strip_diacritics
        - lowercase
        # -----------Library Unique------------ #
        - [replace, "!!!", "chk-chik-chick"]    
        - [regex, '(?<=\W|\s)+(featuring.+|feat[\W\s]+|ft[\W\s]+|(f[\W\s])).+', ""]                          
        #--------------URL Unique-------------- #
        # [regex, ' & ', " and "]              
        # ------------------------------------- #
        - [regex, '[^a-z0-9\s]{1,}', ""]      
        - [regex, '[\W]{2,}', " "]              
        - [regex, '(\W+(?=$))|(^\W+)', ""]
        - [regex, '(\w+)(\s)(\w+)', $3$2$1]          
        - [strip_nonascii, -]
    
    title:
        type: title
        filters:
        - strip_diacritics
        - lowercase
        # -----------Library Unique------------ #
                        
        #--------------URL Unique-------------- #
            
        # ------------------------------------- #
        - [regex, '[^a-z0-9\s]{1,}', ""]      
        - [regex, '[\W]{2,}', " "]              
        - [regex, '(\W+(?=$))|(^\W+)', ""]          
        - [strip_nonascii, -]

    album:
        type: album
        filters:
        - strip_diacritics
        - lowercase
        # -----------Library Unique------------ #
                        
        #--------------URL Unique-------------- #
            
        # ------------------------------------- #
        - [regex, '[^a-z0-9\s]{1,}', ""]      
        - [regex, '[\W]{2,}', " "]              
        - [regex, '(\W+(?=$))|(^\W+)', ""]          
        - [strip_nonascii, -]

headers:
    User-Agent: 'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:77.0) Gecko/20100101 Firefox/77.0'  

config:
    url: "http://www.musixmatch.com/lyrics/{artist}/{title}"
    pattern: ['<p class="mxm-lyrics__content.*?">(?<lyrics>.*?)<div [^>]*"lyrics-report".*?>', s]

post-filters:
        #------------Website Unique------------- #
        - [replace, "</span></p><div>", "\n"]
        - [regex, "<script.*?</script>", "", 's']
        #--------------------------------------- #
        - br2nl        
        - strip_html                            
        - utf8_encode                          
        - entity_decode                        
        - clean_spaces                          
        - [regex, '\[.+\]', ""]                  
        - [regex, '\n{2,}',"\n\n", 's']          
        - trim

Let me know if you need any more assistance.
Last Edit: January 19, 2022, 09:12:13 PM by avitar