Author Topic: LyricsReloaded (Latest)  (Read 55659 times)

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 935
  • Heal The World
The pattern which is said to be not matching isn't the one defined in the included Genius provider.
So I think you might have a Genius.yml file of your own in the providers subfolder that is overriding the built-in Genius - confirm whether or not that's the case.
Favourite song at the moment:   Decode by Paramore

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 935
  • Heal The World
Plugin has been updated.
New log entries will now have some line breaks applied to them, in order to make the log file look a little less 'chaotic'.
Favourite song at the moment:   Decode by Paramore

rivum

  • Newbie
  • *
  • Posts: 8
thanks Mayibongwe.  I don't see that file - I don't even think I have a providers subfolder that I can tell!

rivum

  • Newbie
  • *
  • Posts: 8
sorry, I do see it now!
I didn't change it intentionally but I will see if I can grab a recent version from the site here and let you know how I made out.
thanks!!

rivum

  • Newbie
  • *
  • Posts: 8
ok I found the proper text for genius.yml and have updated it.  
Code
name: Genius (2022-1-27)

variables:
    artist:
        type: artist
        filters:
        - strip_diacritics
        - lowercase
        - [replace, "!!!", "chk-chik-chick"]
        - [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: artist

config:
    url: "https://genius.com/{artist}-{title}-lyrics"
    pattern: ['<div data-lyrics-container="true" class="Lyrics__Container-sc-1ynbvzw-6 jYfhrf">(?<lyrics>.*)<div class="Lyrics__Footer-sc-', 's']

post-filters:
- br2nl
- strip_html
- utf8_encode
- entity_decode
- clean_spaces
- [regex, '\[.{1,75}\]', ""]
- [regex, '\n{2,}',"\n\n", 's']
- trim

but it still hasn't worked - here is the log after I updated the yml:

Quote
12/09/2022 11:05:37 [INFO] mb_LyricsReloaded in version 1.1.16.2 started!
12/09/2022 11:05:37 [DEBUG] Loading config from field provider_deezer
12/09/2022 11:05:38 [INFO] Provider loaded: Deezer
12/09/2022 11:05:38 [DEBUG] Loading config from field provider_genius
12/09/2022 11:05:38 [INFO] Provider loaded: Genius
12/09/2022 11:05:38 [DEBUG] Loading config from field provider_google
12/09/2022 11:05:38 [INFO] Provider loaded: Google
12/09/2022 11:05:38 [DEBUG] Loading config from field provider_Lyrics_Freak
12/09/2022 11:05:38 [INFO] Provider loaded: Lyrics Freak
12/09/2022 11:05:38 [DEBUG] Loading config from field provider_musixmatch
12/09/2022 11:05:38 [INFO] Provider loaded: Musixmatch
12/09/2022 11:05:38 [DEBUG] Loading config from file: C:\Users\rvanmil\AppData\Roaming\MusicBee\mb_LyricsReloaded\providers\genius.yml
12/09/2022 11:05:38 [INFO] Provider loaded: Genius (2022-1-27)
12/09/2022 11:05:38 [DEBUG] Loading config from file: C:\Users\rvanmil\AppData\Roaming\MusicBee\mb_LyricsReloaded\providers\musixmatch.yml
12/09/2022 11:05:38 [INFO] Provider loaded: Musixmatch
12/09/2022 11:05:38 [INFO] The provider Musixmatch does already exist and will be replaced.
12/09/2022 11:05:38 [DEBUG] Received a notification of type PluginStartup
12/09/2022 11:05:38 [DEBUG] Received a notification of type MusicBeeStarted
12/09/2022 11:05:40 [DEBUG] gzip compression detected
12/09/2022 11:05:51 [DEBUG] Lyrics request: Weeping Tile - 1st Lady - Cold Snap - Google
12/09/2022 11:05:51 [INFO] Google tries to load the lyrics...
12/09/2022 11:05:51 [DEBUG] The constructed URL: https://www.google.com/search?q=1st-lady+weeping-tile+lyrics
12/09/2022 11:05:52 [DEBUG] gzip compression detected
12/09/2022 11:05:52 [WARN] The pattern </div></div></div></div><div class="hwc"><div class="BNeawe tAd8D AP7Wnd"><div><div class="BNeawe tAd8D AP7Wnd">(?<lyrics>.*)Source: didn't match!
12/09/2022 11:05:52 [INFO] No lyrics found.
12/09/2022 11:05:52 [FAIL] no lyrics found from Google
12/09/2022 11:05:59 [DEBUG] Lyrics request: Weeping Tile - Joint Acc't - Cold Snap - Google
12/09/2022 11:05:59 [INFO] Google tries to load the lyrics...
12/09/2022 11:05:59 [DEBUG] The constructed URL: https://www.google.com/search?q=joint-acct+weeping-tile+lyrics
12/09/2022 11:05:59 [DEBUG] gzip compression detected
12/09/2022 11:06:00 [WARN] The pattern </div></div></div></div><div class="hwc"><div class="BNeawe tAd8D AP7Wnd"><div><div class="BNeawe tAd8D AP7Wnd">(?<lyrics>.*)Source: didn't match!
12/09/2022 11:06:00 [INFO] No lyrics found.
12/09/2022 11:06:00 [FAIL] no lyrics found from Google
12/09/2022 11:06:08 [INFO] Plugin disabled

sveakul

  • Sr. Member
  • ****
  • Posts: 2402
The log shows that the plugin is loading both Genius and Musixmatch sources twice--once from the ones built-in to the plugin and a second time from the external yml files, which could well be messing with your results.  You should un-check the external yml sources if you want to use the internal ones for the same source.

The selection choices in MB are shown using the internal name of the yml (first line after "name: ") not the name of the file.  This will be confusing if the names are the same for both internal and external sources (I see your Musixmatch yml is an example of this).  Either be sure they have a unique name internally, or, if you are going just with the internal ones, remove the ymls from the Providers folder entirely and re-start MusicBee, then re-select the sources in Tags(2).

rivum

  • Newbie
  • *
  • Posts: 8
ah that's got it sorted now!! thanks for your help!

One last thing - how do you remove incorrect lyrics from songs?  I have a few that were loaded before I cleaned all this up and pulled the wrong lyrics which, I think, are now stored internally somehow.
Is there a way to clear those and have it recheck for lyrics?


**EDIT** searched the forum and found the answer (which I should have just done in the first place!)
Last Edit: September 12, 2022, 06:19:57 PM by rivum

hunglt

  • Newbie
  • *
  • Posts: 3
Hello, I want to autoload lyrics in Russian from the website https://pesni.guru/
I don't really understand the structure of provider files, so just made a custom version to test as below:
Quote
name: pesni guru
loader: static

variables:
    artist:
        type: artist
        filters:
        - strip_diacritics
        - lowercase
        - [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: artist

config:
    url: "https://www.pesni.guru/text/{artist}-{title}"
    pattern: ['spoken:<br />(?<lyrics>.*?)</div>', s]
    
post-filters:
- [regex, '([.a-z]<br />\r\n<br />)\r\n[A-Z].*?:<br />', '$1', s]
- [regex, '<br />\r\n<br />(\r\n<br />)', '$1', s]
- strip_html
- entity_decode
- clean_spaces
- utf8_encode

It seems to work with English songs, but unfortunately, I got zero finding results with Russian songs.
Here is the log when I tried with the song "Я Спросил У Ясеня" and artist "Сергей Никитин" (of course its lyric does exist there )
Quote
14-09-2022 02:28:44 [DEBUG] Lyrics request: Сергей Никитин - Я Спросил У Ясеня -  - Deezer
14-09-2022 02:28:44 [INFO] Deezer tries to load the lyrics...
14-09-2022 02:28:44 [DEBUG] The constructed identity URL: https://www.google.com/search?q=Deezer+-+-

14-09-2022 02:28:44 [DEBUG] Lyrics request: Сергей Никитин - Я Спросил У Ясеня -  - Google
14-09-2022 02:28:44 [INFO] Google tries to load the lyrics...
14-09-2022 02:28:44 [DEBUG] The constructed URL: https://www.google.com/search?q=-+-+lyrics

14-09-2022 02:28:44 [DEBUG] Lyrics request: Сергей Никитин - Я Спросил У Ясеня -  - pesni guru
14-09-2022 02:28:44 [INFO] pesni guru tries to load the lyrics...
14-09-2022 02:28:44 [DEBUG] The constructed URL: https://www.pesni.guru/text/---
14-09-2022 02:28:44 [DEBUG] gzip compression detected
14-09-2022 02:28:44 [DEBUG] gzip compression detected

14-09-2022 02:28:44 [DEBUG] Lyrics request: Сергей Никитин - Я Спросил У Ясеня -  - Letras de músicas
14-09-2022 02:28:44 [INFO] Letras de músicas tries to load the lyrics...
14-09-2022 02:28:44 [DEBUG] The constructed URL: http://letras.mus.br/-/-/

Could you please help me? Your help would be much appreciated.

EDIT: Just realized that all the characters must be in lower form and there aren't enough dashes. Please anyone help me? :(
Last Edit: September 14, 2022, 08:42:37 AM by hunglt

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 935
  • Heal The World
Hello hunglt. Try this one out:

Code
name: Pesni Guru
loader: search

variables:
    artist:
        type: artist
        filters:
        - lowercase

    title:
        type: title
        filters: artist
        
headers:
    user-agent: Firefox

config:
    identity url: "https://pesni.guru/search/{artist}+{title}"
    identity pattern: ['<a href="/text/(?<identity>.*?)"', 's']
    lyrics url: "https://pesni.guru/text/"
    lyrics pattern: ['parentNode.*?</div>(?<lyrics>[\s\S]*?)<a href', 's']
    
post-filters:
- [regex, '\s\s+', ' ']
- [regex, '<br>', "\n"]
- strip_html
- utf8_encode
- entity_decode
- trim

Favourite song at the moment:   Decode by Paramore

hunglt

  • Newbie
  • *
  • Posts: 3
Hello hunglt. Try this one out:

Code
name: Pesni Guru
loader: search

variables:
    artist:
        type: artist
        filters:
        - lowercase

    title:
        type: title
        filters: artist
       
headers:
    user-agent: Firefox

config:
    identity url: "https://pesni.guru/search/{artist}+{title}"
    identity pattern: ['<a href="/text/(?<identity>.*?)"', 's']
    lyrics url: "https://pesni.guru/text/"
    lyrics pattern: ['parentNode.*?</div>(?<lyrics>[\s\S]*?)<a href', 's']
   
post-filters:
- [regex, '\s\s+', ' ']
- [regex, '<br>', "\n"]
- strip_html
- utf8_encode
- entity_decode
- trim



Thanks, it works! Wow, many thanks again ^^

boroda

  • Sr. Member
  • ****
  • Posts: 4579
i've also noticed that "Pesni Guru.yml" is now included into "providers.zip" from the 1st post on this topic. @Mayibongwe, thanks! this provider is really helpful for russian songs.

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 935
  • Heal The World
Wonderful. Glad to hear that it's working well.
I decided to add it to the optional providers zip because it also seems to have quite a number of English songs as well (judging by the ones I've tested with).
So that's another positive. Thanks for suggesting it Hunglt.
Favourite song at the moment:   Decode by Paramore

phred

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 9248
@Mayibongwe-

When you update the plugin with a new release, please update the link on the plugin's download page. Right now it's showing 1.1.15 and current is 1.1.16.4.

Thanks.
Download the latest MusicBee v3.5 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

Mayibongwe

  • Sr. Member
  • ****
  • Posts: 935
  • Heal The World
Oops! Totally forgot about that side of maintenance - thanks for pointing it out phred.
I've updated the version numbers and will be sure to do that every time going forward.
Favourite song at the moment:   Decode by Paramore

hunglt

  • Newbie
  • *
  • Posts: 3
Wonderful. Glad to hear that it's working well.
I decided to add it to the optional providers zip because it also seems to have quite a number of English songs as well (judging by the ones I've tested with).
So that's another positive. Thanks for suggesting it Hunglt.
Could you make a tut about customizing the provider files? There are many sites that I want to try.