It is currently March 28th, 2024, 2:45 pm

[BUG] Encoding issue in NowPlaying's lyrics

Report bugs with the Rainmeter application and suggest features.
Post Reply
User avatar
Yincognito
Rainmeter Sage
Posts: 7023
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

[BUG] Encoding issue in NowPlaying's lyrics

Post by Yincognito »

My relatively recent "player" skin has the ability to show and scroll the lyrics through my custom tooltip skin method, using the corresponding NowPlaying options. The problem is that for "foreign" songs - i.e. the kind of songs having lyrics full of accents / diacritical marks - the "accented" characters (e.g. à, è, é, ê, etc.) are not displayed properly, despite them being displayed correctly on the first and second site where NowPlaying is grabbing the lyrics from. I'm guessing it's an econding issue and should be relatively easy to fix the parsing...

NowPlaying result in my skins:
Lyrics - NowPlaying.gif
First NowPlaying source site (lyrics.wikia.com):
Lyrics - Wiki Lyrics.jpg
Second NowPlaying source site (letras.mus.br):
Lyrics - Letras Brasil.jpg
P.S. In this song's case, the lyrics were probably taken from the second site (i.e. Letras Music Brasil).
Last edited by Yincognito on July 27th, 2020, 8:57 pm, edited 1 time in total.
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: [BUG] Encoding issue in NowPlaying's lyrics

Post by Brian »

Hopefully, this is a codepage issue.

Could you try this special version of Rainmeter and see if it works for you?
Link Removed

Normally we are hesitant to mess with the Nowplaying measure since all the music players change their API's all the time, which is why some players are not fully supported or "up to date" with the latest version. It is similar with the Lyrics option.

As of right now, we check 2 lyric sources. Letras and Wikia (which redirects to Fandom). It looks like the Fandom version isn't fully supported anymore either.

Here are the URL's we use:
https://www.letras.mus.br/winamp.php?musica=SONG_NAME&artista=ARTIST_NAME
https://lyrics.wikia.com/api.php?func=getSong&fmt=json&artist=ARTIST_NAME&song=SONG_NAME (this redirects to fandom.com)

-Brian
User avatar
Yincognito
Rainmeter Sage
Posts: 7023
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [BUG] Encoding issue in NowPlaying's lyrics

Post by Yincognito »

Brian wrote: July 27th, 2020, 8:02 pm Hopefully, this is a codepage issue.

Could you try this special version of Rainmeter and see if it works for you?
Link Removed

Normally we are hesitant to mess with the Nowplaying measure since all the music players change their API's all the time, which is why some players are not fully supported or "up to date" with the latest version. It is similar with the Lyrics option.

As of right now, we check 2 lyric sources. Letras and Wikia (which redirects to Fandom). It looks like the Fandom version isn't fully supported anymore either.

Here are the URL's we use:
https://www.letras.mus.br/winamp.php?musica=SONG_NAME&artista=ARTIST_NAME
https://lyrics.wikia.com/api.php?func=getSong&fmt=json&artist=ARTIST_NAME&song=SONG_NAME (this redirects to fandom.com)

-Brian
Ok, I'll try it out immediately - will let you know the outcome in a moment.

EDIT: This works perfectly - very nice job. :thumbup:
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: [BUG] Encoding issue in NowPlaying's lyrics

Post by Brian »

Yincognito wrote: July 27th, 2020, 8:10 pm This works perfectly - very nice job. :thumbup:
Awesome! This will be in the next beta. Thanks for reporting.

-Brian
User avatar
Yincognito
Rainmeter Sage
Posts: 7023
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [BUG] Encoding issue in NowPlaying's lyrics

Post by Yincognito »

Brian wrote: July 27th, 2020, 8:25 pm Awesome! This will be in the next beta. Thanks for reporting.

-Brian
No problem - at first I thought it was an encoding error on my part, but after seeing the measure values were the same, I thought I should post it here.
By the way, take a look here, it seems some extraction from wikia is still possible (result of Patricia Kaas - Il Me Dit Que Je Suis Belle):

Code: Select all

{"lyric":"Et quand le temps se lasse\nDe n'être que tué\nPlus une seconde passe\nDans les vies d'uniformité\nQuand de peine en méfiance\nDe larmes en plus jamais\nPuis de depit en défiance\nOn apprend à se résigner\nViennent les heures sombres\nOu tout peut enfin s'allumer\nOu quand les vies ne sont plus qu'ombres\nRestent nos r'ves à inventer\n\nIl me dit que je suis belle\nEt qu'il n'attendait que moi\nIl me dit que je suis celle\nJuste faite pour ses bras\nIl parle comme on caresse\nDe mots qui n'existent pas\nDe toujours et de tendresse\nEt je n'entends que sa voix\n\nEviter les regards, prendre cet air absent\nCelui qu'ont les gens sur les boul'vards\nCet air qui les rend transparents\nApprendre à tourner les yeux\nDevant les gens qui s'aiment\nEviter tous ceux qui marchent à deux\nCeux qui s'embrassent à perdre haleine\nY a-t-il un soir, un moment\nOu l'on se dit c'est plus pour moi\nTous les mots doux, les coups de sang\nMais dans mes r'ves, j'y ai droit\n\nIl me dit que je suis belle\nEt qu'il n'attendait que moi\nIl me dit que je suis celle\nJuste faite pour ses bras\nDes mensonges et des betises\nQu'un enfant ne croirait pas\nMais les nuits sont mes églises\nEt dans mes r'ves j'y crois\n\nIl me dit que je suis belle...\nJe le vois courir vers moi\nSes mains me frolent et m'entrainent\nC'est beau comme au cinema\nPlus de trahison, de peines\nMon scenario n'en veut pas\nIl me dit que je suis reine\nEt pauvre de moi, j'y crois\nHmm, pauvre de moi, j'y crois","err":"none"}
although all their pages regarding the API seem to not show any result. That being said, I just started looking... :D

EDIT: Wikia output seems to work, but it is truncated (result of Joe Bonamassa - So Many Roads):

Code: Select all

<LyricsResult>
<artist>Joe Bonamassa</artist>
<song>So Many Roads</song>
<lyrics>So many roads So many trains to ride So many roads So many trains to ride I've g[...]</lyrics>
<url>http://lyrics.wikia.com/Joe_Bonamassa:So_Many_Roads</url>
<page_namespace>0</page_namespace>
<page_id>837201</page_id>
<isOnTakedownList>0</isOnTakedownList>
</LyricsResult>
EDIT2: Nevermind, it's dead indeed, as stated here.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [BUG] Encoding issue in NowPlaying's lyrics

Post by jsmorley »

The latest beta release of Rainmeter corrects this issue.
User avatar
Yincognito
Rainmeter Sage
Posts: 7023
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: [BUG] Encoding issue in NowPlaying's lyrics

Post by Yincognito »

jsmorley wrote: July 28th, 2020, 12:23 pm The latest beta release of Rainmeter corrects this issue.
Excellent - thanks! :great:
Post Reply