AIMP Forum

AIMP for PC => Вопросы / Questions => Topic started by: c0der on September 22, 2021, 05:10:03

Title: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: c0der on September 22, 2021, 05:10:03
Hey there.

I would like to add Genius Lyrics (https://genius.com/) as one page where the lyrics get requested from.

I know that there's a tag on the website starting with: "<meta content="{&quot;chartbeat" holding ALL the songs information in json format (artist, title, image-urls, producers, etc) and another node <div class="lyrics" that contains a simple <p> holding the lyrics in html format (obviously) since I wrote an app that fetches lyrics from there.
The URL structure is as follows: genius.com/{artist}-{title}-lyrics

Is there any explanation of the parameters within the config file and how the dll parses the result so I can try to implement the request to genius lyrics through the config?

Thanks in advance.
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: sveakul on September 22, 2021, 18:24:42
The entry in the aimp_webLyrics.ini file that worked for Genius up until this summer, written by sabadell66, is below.  It doesn't work anymore due to site changes at Genius, but hopefully it may give you some direction on how to proceed:

[genius.com]
Class=TAIMPLyricsWebPageBasedProvider
CustomHeaders=\ncontent-type: application/json; charset=utf-8\ncontent-encoding: gzip
SearchQuery=https://genius.com/api/search/multi?per_page=5&q=%artist%+%title%
Encoding=URL
SearchResultPageStartTags="url":"
SearchResultPageFinishTags=",
LyricsPageTitleStartTags={"name":"song_title","values":["
LyricsPageTitleFinishTags="]
LyricsPageArtistStartTags={"name":"artist_name","values":["
LyricsPageArtistFinishTags="]
LyricsPageTextStartTags=<div class="Lyrics__Container-sc-1ynbvzw-6 krDVEH">
LyricsPageTextFinishTags=<div class="SidebarAd__Container-sc-1cw85h6-0 dmUBmo">
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: c0der on September 23, 2021, 00:35:49
Last two lines have to be as follows:

LyricsPageTextStartTags=<div class="Lyrics__Container-sc-1ynbvzw-8 eOLwDW">
LyricsPageTextFinishTags=<div class="Lyrics__Footer-sc-1ynbvzw-2 gJmUoe">

It's working again. Thanks for your help.

Edit:
Note that you will still need to have some fallback pages to request lyrics from since sometimes the lyrics cannot be fetched from genius.
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: sveakul on September 23, 2021, 04:43:56
cOder:  for some reason it's still not working here after changing those last 2 lines--would you be kind enough to post your complete [genius.com] entry?  Maybe I've missed something elsewhere.

In return, here are the rest of my entries, all of them working(thanks to sabadell66 for these):

Code: [Select]
[azlyrics.com]
Class=TAIMPLyricsWebPageBasedProvider
SearchQuery=https://search.azlyrics.com/search.php?q=%artist%%20%title%
Encoding=URL
SearchResultPageStartTags=<a href="
SearchResultPageFinishTags=">
LyricsPageArtistStartTags=ArtistName = "
LyricsPageArtistFinishTags=";
LyricsPageTitleStartTags=SongName = "
LyricsPageTitleFinishTags=";
LyricsPageTextStartTags=<!-- Usage of azlyrics.com content by any third-party lyrics provider is prohibited by our licensing agreement. Sorry about that. -->
LyricsPageTextFinishTags=</div>
LyricsPageTextPostProcessExpression=https://source_AZLYRICS.COM\n%Value

[musixmatch.com]
Class=TAIMPLyricsWebPageBasedProvider
SearchQuery=https://www.musixmatch.com/search/%artist%%20%title%
Encoding=URL
SearchResultPageStartTags=</div><meta content="
SearchResultPageFinishTags="
SearchResultPagePostProcessExpression=https://www.musixmatch.com%Value
LyricsPageArtistStartTags=mxm-track-title__artist-link">
LyricsPageArtistFinishTags=</a>
LyricsPageTitleStartTags=<small>Lyrics</small>
LyricsPageTitleFinishTags=</h1>
LyricsPageTextStartTags="body":"
LyricsPageTextFinishTags=",
LyricsPageTextPostProcessExpression=https://source_MUSIXMATCH.COM\n%Value

[songlyrics.com]
Class=TAIMPLyricsWebPageBasedProvider
SearchQuery=http://www.songlyrics.com/index.php?section=search&searchW=%artist% %title%&submit=Search
SearchResultPageStartTags=<div class="serpresult">|<a href="
SearchResultPageFinishTags=</div>|"
LyricsPageArtistStartTags=artist: "
LyricsPageArtistFinishTags=",
LyricsPageTitleStartTags=song: "
LyricsPageTitleFinishTags=",
LyricsPageTextStartTags=<p id="songLyricsDiv"  class="songLyricsV14 iComment-text">
LyricsPageTextFinishTags=</p>
LyricsPageTextPostProcessExpression=https://source_SONGLYRICS.COM\n%Value
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: c0der on September 23, 2021, 04:53:00
I'm using the exact same lines you posted before except the last two. For completeness sake, below is my full config.
Keep in mind that the Genius URL structure is as follows: genius.com/{artist}-{title}-lyrics

Example: You have the following song including ID3-Tags in MP3 file - "Kool Savas - AMG"
But the correct URL in genius is: "genius.com/kool-savas-and-alies-amg-lyrics"
So, because of some smaller feature artists the plugin might not find a result.
I tested it with around 20 files and like 80-90% are downloaded from genius (you can see that in the .LRC file that is placed next to the mp3 file you played).

Code: [Select]

[genius.com]
Class=TAIMPLyricsWebPageBasedProvider
CustomHeaders=\ncontent-type: application/json; charset=utf-8\ncontent-encoding: gzip
SearchQuery=https://genius.com/api/search/multi?per_page=5&q=%artist%+%title%
Encoding=URL
SearchResultPageStartTags="url":"
SearchResultPageFinishTags=",
LyricsPageTitleStartTags={"name":"song_title","values":["
LyricsPageTitleFinishTags="]
LyricsPageArtistStartTags={"name":"artist_name","values":["
LyricsPageArtistFinishTags="]
LyricsPageTextStartTags=<div class="Lyrics__Container-sc-1ynbvzw-8 eOLwDW">
LyricsPageTextFinishTags=<div class="Lyrics__Footer-sc-1ynbvzw-2 gJmUoe">
LyricsPageTextPostProcessExpression=%Value\n\nhttps://www.genius.com

[azlyrics.com]
Class=TAIMPLyricsWebPageBasedProvider
SearchQuery=https://search.azlyrics.com/search.php?q=%artist%%20%title%
Encoding=URL
SearchResultPageStartTags=<a href="
SearchResultPageFinishTags=">
LyricsPageArtistStartTags=ArtistName = "
LyricsPageArtistFinishTags=";
LyricsPageTitleStartTags=SongName = "
LyricsPageTitleFinishTags=";
LyricsPageTextStartTags=<!-- Usage of azlyrics.com content by any third-party lyrics provider is prohibited by our licensing agreement. Sorry about that. -->
LyricsPageTextFinishTags=</div>
LyricsPageTextPostProcessExpression=%Value\n\nhttps://www.azlyrics.com

[musixmatch.com]
Class=TAIMPLyricsWebPageBasedProvider
SearchQuery=https://www.musixmatch.com/search/%artist%%20%title%
Encoding=URL
SearchResultPageStartTags=</div><meta content="
SearchResultPageFinishTags="
SearchResultPagePostProcessExpression=https://www.musixmatch.com%Value
LyricsPageArtistStartTags=mxm-track-title__artist-link">
LyricsPageArtistFinishTags=</a>
LyricsPageTitleStartTags=<small>Lyrics</small>
LyricsPageTitleFinishTags=</h1>
LyricsPageTextStartTags="body":"
LyricsPageTextFinishTags=",
LyricsPageTextPostProcessExpression=%Value\n\nhttps://www.musixmatch.com

[songlyrics.com]
Class=TAIMPLyricsWebPageBasedProvider
SearchQuery=http://www.songlyrics.com/index.php?section=search&searchW=%artist% %title%&submit=Search
SearchResultPageStartTags=<div class="serpresult">|<a href="
SearchResultPageFinishTags=</div>|"
LyricsPageArtistStartTags=artist: "
LyricsPageArtistFinishTags=",
LyricsPageTitleStartTags=song: "
LyricsPageTitleFinishTags=",
LyricsPageTextStartTags=<p id="songLyricsDiv"  class="songLyricsV14 iComment-text">
LyricsPageTextFinishTags=</p>
LyricsPageTextPostProcessExpression=%Value\n\nhttps://www.songlyrics.com


Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: sveakul on September 23, 2021, 05:52:06
Thanks c0der for posting your complete entry.  Genius working fine again here!  Skål/За тебя!
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: c0der on September 23, 2021, 05:55:21
I edited my config from the previous post a little since the LyricsPageTextFinishTags had multiple occurrences for some songs.
Now it should work flawless. Also added the base-url for the lyrics page the data are loaded from as PostProcessExpression as bottom line of the lyrics data.

I don't speak/understand russian, but you're welcome brother :)
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: c0der on September 23, 2021, 06:01:48
Here's an example screenshot of how the data get loaded on my side.
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: sveakul on October 04, 2021, 04:10:46
@c0der:  It doesn't seem that Genius is drawing any lyrics for the past 2 days--was working fine before then using your last posted script!  Have they changed search methods again, and have you found a solution that you can share?
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: c0der on October 05, 2021, 19:40:50
@sveakul: First off all, thanks for your information!
And yes, seems like they did changes. The "LyricsPageTextStartTags" value changed.
Attached you will find my full config including the changed Genius section.

Code: [Select]
[genius.com]
Class=TAIMPLyricsWebPageBasedProvider
CustomHeaders=\ncontent-type: application/json; charset=utf-8\ncontent-encoding: gzip
SearchQuery=https://genius.com/api/search/multi?per_page=5&q=%artist%+%title%
Encoding=URL
SearchResultPageStartTags="url":"
SearchResultPageFinishTags=",
LyricsPageTitleStartTags={"name":"song_title","values":["
LyricsPageTitleFinishTags="]
LyricsPageArtistStartTags={"name":"artist_name","values":["
LyricsPageArtistFinishTags="]
LyricsPageTextStartTags=<div class="Lyrics__Container-sc-1ynbvzw-8 beMmeb">
LyricsPageTextFinishTags=<div class="Lyrics__Footer-sc-
LyricsPageTextPostProcessExpression=%Value\n\nhttps://www.genius.com

[azlyrics.com]
Class=TAIMPLyricsWebPageBasedProvider
SearchQuery=https://search.azlyrics.com/search.php?q=%artist%%20%title%
Encoding=URL
SearchResultPageStartTags=<a href="
SearchResultPageFinishTags=">
LyricsPageArtistStartTags=ArtistName = "
LyricsPageArtistFinishTags=";
LyricsPageTitleStartTags=SongName = "
LyricsPageTitleFinishTags=";
LyricsPageTextStartTags=<!-- Usage of azlyrics.com content by any third-party lyrics provider is prohibited by our licensing agreement. Sorry about that. -->
LyricsPageTextFinishTags=</div>
LyricsPageTextPostProcessExpression=%Value\n\nhttps://www.azlyrics.com

[musixmatch.com]
Class=TAIMPLyricsWebPageBasedProvider
SearchQuery=https://www.musixmatch.com/search/%artist%%20%title%
Encoding=URL
SearchResultPageStartTags=</div><meta content="
SearchResultPageFinishTags="
SearchResultPagePostProcessExpression=https://www.musixmatch.com%Value
LyricsPageArtistStartTags=mxm-track-title__artist-link">
LyricsPageArtistFinishTags=</a>
LyricsPageTitleStartTags=<small>Lyrics</small>
LyricsPageTitleFinishTags=</h1>
LyricsPageTextStartTags="body":"
LyricsPageTextFinishTags=",
LyricsPageTextPostProcessExpression=%Value\n\nhttps://www.musixmatch.com

[songlyrics.com]
Class=TAIMPLyricsWebPageBasedProvider
SearchQuery=http://www.songlyrics.com/index.php?section=search&searchW=%artist% %title%&submit=Search
SearchResultPageStartTags=<div class="serpresult">|<a href="
SearchResultPageFinishTags=</div>|"
LyricsPageArtistStartTags=artist: "
LyricsPageArtistFinishTags=",
LyricsPageTitleStartTags=song: "
LyricsPageTitleFinishTags=",
LyricsPageTextStartTags=<p id="songLyricsDiv"  class="songLyricsV14 iComment-text">
LyricsPageTextFinishTags=</p>
LyricsPageTextPostProcessExpression=%Value\n\nhttps://www.songlyrics.com
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: sveakul on October 05, 2021, 21:32:08
Thanks a million c0der for the fix, Genius is working fine again!  Your efforts are much appreciated.
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: sveakul on October 07, 2021, 22:20:05
@coder:  I hate to say this, but it looks like Genius has changed yet again--no more lyrics as of 2 days ago with your newest script.  I get the feeling they are altering this deliberately at intervals to screw up lyric-scraping scripts, maybe in response to usage.  Not sure if anything can be done about it, but a shame to lose this source.  Musixmatch, AZLyrics, and Song Lyrics all still working fine, thankfully.
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: c0der on October 08, 2021, 02:47:15
I changed three parameters in the config file to parse the raw lyrics part from the always existing raw data json node. But the lyrics post process function doesn't return the corrent value since the expression doesn't replace the given character. I will post the code and some example lyrics below.


Code: [Select]
LyricsPageTextStartTags="body\":{\"html\":\"
LyricsPageTextFinishTags=\",
LyricsPageTextPostProcessExpression=%REPLACE(%Value, "\\", "")

Example Lyrics:

Code: [Select]
[Chorus: Chris Brown with Nicki Minaj]
\
Yeah, yeah, baby, is you drunk? Is you had enough?
\
Are you here lookin' for love? Ooh, ooh
\
Got the club goin' crazy
\
...

Maybe you or somebody else that worked more with the .dll library knows how to change the code. I am still trying possible approaches myself.
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: sveakul on October 08, 2021, 18:11:07
Thanks for your response.  Yes, I also found that while it's returning Genius lyrics again the %REPLACE expression is being ignored--why, I don't know either.  Maybe another skilled user like sabadell66 who came up with the first string that worked can help us out here.  In the meantime, I hope your own experiments are successful and that you'll post here!  Thanks for looking into this.
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: c0der on November 04, 2021, 03:00:19
Found a solution that seems to change less often since the tags I use don't contain any "random" parts.

Code: [Select]
[genius.com]
Class=TAIMPLyricsWebPageBasedProvider
CustomHeaders=\ncontent-type: application/json; charset=utf-8\ncontent-encoding: gzip
SearchQuery=https://genius.com/api/search/multi?per_page=5&q=%artist%+%title%
Encoding=URL
SearchResultPageStartTags="url":"
SearchResultPageFinishTags=",
LyricsPageTitleStartTags={"name":"song_title","values":["
LyricsPageTitleFinishTags="]
LyricsPageArtistStartTags={"name":"artist_name","values":["
LyricsPageArtistFinishTags="]
LyricsPageTextStartTags=<div id="lyrics-root-pin-spacer">
LyricsPageTextFinishTags=<div class="Lyrics__Footer-sc-
LyricsPageTextPostProcessExpression=%Value\n\nhttps://www.genius.com
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: sveakul on November 04, 2021, 04:17:24
Thanks c0der, this is working great!  I appreciate you not giving up on this and then sharing it for all of us here, you are a gentleman and a scholar.
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: sveakul on January 27, 2022, 23:24:44
I noticed that Genius has started adding "(song title) Lyrics" to the beginning of the lyrics line. Is this something that can be filtered out by the code?
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: c0der on January 29, 2022, 03:41:33
EDIT (2022/08/13):

Here's my full working config. I will maintain it in this message.

Code: [Select]
[genius.com]
Class=TAIMPLyricsWebPageBasedProvider
CustomHeaders=\ncontent-type: application/json; charset=utf-8\ncontent-encoding: gzip
SearchQuery=https://genius.com/api/search/multi?per_page=5&q=%artist%+%title%
Encoding=URL
SearchResultPageStartTags="url":"
SearchResultPageFinishTags=",
LyricsPageTitleStartTags={"name":"song_title","values":["
LyricsPageTitleFinishTags="]
LyricsPageArtistStartTags={"name":"artist_name","values":["
LyricsPageArtistFinishTags="]
LyricsPageTextStartTags=<div data-lyrics-container="true" class="Lyrics__Container-sc-1ynbvzw-6 YYrds">
LyricsPageTextFinishTags=<div class="Lyrics__Footer-sc-
LyricsPageTextPostProcessExpression=%Value\n\nhttps://www.genius.com

[azlyrics.com]
Class=TAIMPLyricsWebPageBasedProvider
SearchQuery=https://search.azlyrics.com/search.php?q=%artist%%20%title%
Encoding=URL
SearchResultPageStartTags=<a href="
SearchResultPageFinishTags=">
LyricsPageArtistStartTags=ArtistName = "
LyricsPageArtistFinishTags=";
LyricsPageTitleStartTags=SongName = "
LyricsPageTitleFinishTags=";
LyricsPageTextStartTags=<!-- Usage of azlyrics.com content by any third-party lyrics provider is prohibited by our licensing agreement. Sorry about that. -->
LyricsPageTextFinishTags=</div>
LyricsPageTextPostProcessExpression=%Value\n\nhttps://www.azlyrics.com

[musixmatch.com]
Class=TAIMPLyricsWebPageBasedProvider
SearchQuery=https://www.musixmatch.com/search/%artist%%20%title%
Encoding=URL
SearchResultPageStartTags=</div><meta content="
SearchResultPageFinishTags="
SearchResultPagePostProcessExpression=https://www.musixmatch.com%Value
LyricsPageArtistStartTags=mxm-track-title__artist-link">
LyricsPageArtistFinishTags=</a>
LyricsPageTitleStartTags=<small>Lyrics</small>
LyricsPageTitleFinishTags=</h1>
LyricsPageTextStartTags="body":"
LyricsPageTextFinishTags=",
LyricsPageTextPostProcessExpression=%Value\n\nhttps://www.musixmatch.com

[songlyrics.com]
Class=TAIMPLyricsWebPageBasedProvider
SearchQuery=http://www.songlyrics.com/index.php?section=search&searchW=%artist% %title%&submit=Search
SearchResultPageStartTags=<div class="serpresult">|<a href="
SearchResultPageFinishTags=</div>|"
LyricsPageArtistStartTags=artist: "
LyricsPageArtistFinishTags=",
LyricsPageTitleStartTags=song: "
LyricsPageTitleFinishTags=",
LyricsPageTextStartTags=<p id="songLyricsDiv"  class="songLyricsV14 iComment-text">
LyricsPageTextFinishTags=</p>
LyricsPageTextPostProcessExpression=%Value\n\nhttps://www.songlyrics.com
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: Matti on December 11, 2024, 21:31:01
@c0der is this working as of 2024?

I've been having issues with the lyric finder for a while now and I tried to use this as a solution but nothing has changed for me. It could possibly be a user error on my part, but if that's the case could you help direct me to a solution?
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: sveakul on December 12, 2024, 14:56:52
@c0der is this working as of 2024?

I've been having issues with the lyric finder for a while now and I tried to use this as a solution but nothing has changed for me. It could possibly be a user error on my part, but if that's the case could you help direct me to a solution?
Replace your aimp_webLyrics.ini with the one inside the attached 7z and you won't have any problems.  Genius needed to be revised after c0der's last version and there are several new lyric sources added too.  Also includes HQ album art sources in case you download those from the Internet for Internet radio, etc.  Currently using AIMP 5.30.2563.

P.S.  Search order can be adjusted by manually re-arranging the code blocks within the *.ini.  The order in the attachment is what I find works best for me.
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: Matti on December 12, 2024, 20:31:31
Hi sveakul,

My browser is blocking the attachment you sent because it is "virus detected." Could you paste the file's contents and I'll manually insert the file?

Thank you for the help!
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: sveakul on December 13, 2024, 01:35:48
Hi sveakul,

My browser is blocking the attachment you sent because it is "virus detected." Could you paste the file's contents and I'll manually insert the file?

Thank you for the help!

There's no virus in it;  see image attached from Virus Total scan below.  The contents of the *.ini are:

Code: [Select]
[ly.bandcamp.com]
Class=TAIMPLyricsWebPageBasedProvider
SearchQuery=https://bandcamp.com/search?q=%artist%%20%title%&item_type=t
SearchQueryEncoding=URL
SearchResult.StartTags=class="searchresult data-search"|>
SearchResult.FinishTags=</li>
SearchResultArtist.StartTags=class="subhead">|by
SearchResultArtist.FinishTags=</div>
SearchResultTitle.StartTags=a href=|>
SearchResultTitle.FinishTags=</a>
SearchResultURL.StartTags=a href="
SearchResultURL.FinishTags="
DataLyrics.StartTags=class="tralbumData lyricsText">
DataLyrics.FinishTags=</div>
DataLyrics.PostProcessExpression=www.bandcamp.com\n\n%Value

[ly.plain-lrclib.net]
Class=TAIMPLyricsWebPageBasedProvider
;CustomHeaders=\ncontent-type: application/json; charset=utf-8\ncontent-encoding: gzip\nuser-agent: Mozilla/5.0 (Android 13; Mobile; rv:68.0) Gecko/68.0 Firefox/105.0
SearchQuery=https://lrclib.net/api/search?artist_name=%artist%&track_name=%title%
SearchQueryEncoding=URL
SearchResult.StartTags={
SearchResult.FinishTags=}
;SearchResult.StartTags=[
;SearchResult.FinishTags=]
SearchResultArtist.StartTags="artistName":"
SearchResultArtist.FinishTags="
SearchResultTitle.StartTags="trackName":"
SearchResultTitle.FinishTags="
SearchResultURL.StartTags="id":
SearchResultURL.FinishTags=,
SearchResultURL.PostProcessExpression=https://lrclib.net/api/get/%Value
DataLyrics.StartTags="plainLyrics":"
DataLyrics.FinishTags=",
DataLyrics.PostProcessExpression=www.plain-lrclib.net\n\n%Value

[ly.songlyrics2.com]
Class=TAIMPLyricsWebPageBasedProvider
SearchQuery=http://www.songlyrics.com/index.php?section=search&searchW=%artist%:%title%&submit=Search
SearchResult.StartTags=div class="serpresult"
SearchResult.FinishTags=</div>
SearchResultArtist.StartTags=serpdesc-2|by|>
SearchResultArtist.FinishTags=</a>
SearchResultTitle.StartTags=title="
SearchResultTitle.FinishTags="
SearchResultURL.StartTags=<a href="
SearchResultURL.FinishTags=" title="
DataLyrics.StartTags=id="songLyricsDiv-outer">|iComment-text">
DataLyrics.FinishTags=</div>|</p>
DataArtist.StartTags="Artist: "|">
DataArtist.FinishTags=</p>|</a>
DataAlbum.StartTags="Album: "|">
DataAlbum.FinishTags=</p>|</a>
DataLyrics.PostProcessExpression=%IF(%StrLeft(%Value,We do not have the lyrics),www.songlyrics2.com\n\n%Value,)

[genius.com]
Class=TAIMPLyricsWebPageBasedProvider
CustomHeaders=\ncontent-type: application/json; charset=utf-8\ncontent-encoding: gzip\nuser-agent: Mozilla/5.0 (Android 13; Mobile; rv:68.0) Gecko/68.0 Firefox/105.0
SearchQuery=https://genius.com/api/search/song?per_page=5&q=%artist%+%title%
SearchQueryEncoding=URL
SearchResult.StartTags="hits":[
SearchResult.FinishTags=],"next_page"
SearchResultArtist.StartTags="name":"
SearchResultArtist.FinishTags=",
SearchResultTitle.StartTags="title":"
SearchResultTitle.FinishTags=",
SearchResultURL.StartTags="url":"
SearchResultURL.FinishTags=",
DataLyrics.StartTags=<div data-lyrics-container="true" class="Lyrics-sc|">
DataLyrics.FinishTags=<div class="LyricsFooter-sc
DataLyrics.PostProcessExpression=www.genius.com\n\n%Value

[ly.azlyrics2.com]
Class=TAIMPLyricsWebPageBasedProvider
SearchQuery=https://search.azlyrics.com/suggest.php?q=%title%%20-%20%artist%
SearchResult.StartTags={
SearchResult.FinishTags=}
SearchResultArtist.StartTags="autocomplete":"\"|-
SearchResultArtist.FinishTags="
SearchResultTitle.StartTags="autocomplete":"\"
SearchResultTitle.FinishTags=\"
SearchResultURL.StartTags="url":"
SearchResultURL.FinishTags="
SearchResultURL.PostProcessExpression=%Replace(%Value,\,)
DataLyrics.StartTags=<!-- Usage of azlyrics.com content by any third-party lyrics provider is prohibited by our licensing agreement. Sorry about that. -->
DataLyrics.FinishTags=</div>
DataLyrics.PostProcessExpression=www.azlyrics2.com\n\n%Value

[ly.songlyrics.com]
Class=TAIMPLyricsWebPageBasedProvider
SearchQuery=http://www.songlyrics.com/index.php?section=search&searchW=%artist%+-+%title%&submit=Search
SearchQueryEncoding=URL
SearchResult.StartTags=<div class="serpresult">
SearchResult.FinishTags=<div class="serpdesc-2">
SearchResultTitle.StartTags=title="
SearchResultTitle.FinishTags="
SearchResultArtist.StartTags=alt="
SearchResultArtist.FinishTags="
SearchResultURL.StartTags=<a href="
SearchResultURL.FinishTags="
DataLyrics.StartTags=<p id="songLyricsDiv"|iComment-text">
DataLyrics.FinishTags=</p>
DataLyrics.PostProcessExpression=%IF(%StrLeft(%Value,We do not have the lyrics),www.songlyrics.com\n\n%Value,)

[lyricsify.com]
Class=TAIMPLyricsWebPageBasedProvider
SearchQuery=https://api.lyricsify.com/search?q=%artist%+%title%
SearchQueryEncoding=URL
SearchResult.StartTags={"html":
SearchResult.FinishTags=}
SearchResultArtist.StartTags="title\"\u003E
SearchResultArtist.FinishTags= -
SearchResultTitle.StartTags="title\"\u003E| -
SearchResultTitle.FinishTags=\u003C\/a\u003E
SearchResultTitle.PostProcessExpression=%Replace(%Value,\,)
SearchResultURL.StartTags=href=\"
SearchResultURL.FinishTags=\"
SearchResultURL.PostProcessExpression=https://www.lyricsify.com%Replace(%Value,\,)
DataLyrics.StartTags=_details">
DataLyrics.FinishTags=</div>
DataLyrics.PostProcessExpression=www.lyricsify.com\n\n%StrCopy(%StrCopy(%Value,%StrPos([length:,%Value),%Length(%Value)),%StrPos(%Char(10),%StrCopy(%Value,%StrPos([length:,%Value),%Length(%Value))),%Length(%Value))
;DataLyrics.PostProcessExpression=%Value\nwww.lyricsify.com

[bing.musixmatch.com]
Class=TAIMPLyricsWebPageBasedProvider
CustomHeaders=\nAccept-Language: en-US,en;q=0.5 \nuser-agent: Mozilla/5.0 (Linux; Android 10; HLK-AL00) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Mobile Safari/537.36 EdgA/104.0.1293.70
SearchQuery=https://www.bing.com/search?q=%title% %artist% lyrics
SearchQueryEncoding=URL
SearchResult.StartTags=<head>
SearchResult.FinishTags=class="b_algo
SearchResultArtist.StartTags=class="lyric_artists"
SearchResultArtist.FinishTags=</div>
SearchResultTitle.StartTags=class="lyric_title"
SearchResultTitle.FinishTags=</div>
SearchResultURL.StartTags=property="og:url" content="
SearchResultURL.FinishTags="
DataLyrics.StartTags=class="lyrics">
DataLyrics.FinishTags=<div class="lyrics_
DataLyrics.PostProcessExpression=www.musixmatch-bing.com\n\n%Value

[azlyrics.com]
Class=TAIMPLyricsWebPageBasedProvider
SearchQuery=https://search.azlyrics.com/suggest.php?q=%artist%%20%title%
SearchResult.StartTags=[
SearchResult.FinishTags=]
SearchResultArtist.StartTags="autocomplete":"\"|-
SearchResultArtist.FinishTags="
SearchResultTitle.StartTags="autocomplete":"\"
SearchResultTitle.FinishTags=\"
SearchResultURL.StartTags="url":"
SearchResultURL.FinishTags="
SearchResultURL.PostProcessExpression=%Replace(%Value,\,)
DataLyrics.StartTags=<!-- Usage of azlyrics.com content by any third-party lyrics provider is prohibited by our licensing agreement. Sorry about that. -->
DataLyrics.FinishTags=</div>
DataLyrics.PostProcessExpression=www.azlyrics.com\n\n%Value

[bing.spotify.com]
Class=TAIMPLyricsWebPageBasedProvider
CustomHeaders=\nAccept-Language: en-US,en;q=0.5 \nuser-agent: Mozilla/5.0 (Linux; Android 10; HLK-AL00) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Mobile Safari/537.36 EdgA/104.0.1293.70
SearchQuery=https://www.bing.com/search?q="%title%"+%artist%+site:open.spotify.com/track/
SearchQueryEncoding=URL
SearchResult.StartTags=class="b_algo|>
SearchResult.FinishTags=</li>
SearchResultArtist.StartTags= - | by
SearchResultArtist.FinishTags=</h2>
SearchResultArtist.PostProcessExpression=%Remove(%Value, | Spotify)
SearchResultTitle.StartTags=<h2>
SearchResultTitle.FinishTags= -
SearchResultURL.StartTags=href="
SearchResultURL.FinishTags="
SearchResultURL.PostProcessExpression=https://spotify-lyrics-api-pi.vercel.app/?url=%Value&format=lrc
DataLyrics.StartTags="lines":[
DataLyrics.FinishTags=]
DataLyrics.PostProcessExpression=www.spotify.com\n\n%Replace(%Replace(%Replace(%Replace(%Replace(%Replace(%Value,"}%Char(44){"timeTag":"00:00.00"%Char(44)"words":",%Char(13)%Char(10)),"}%Char(44){"timeTag":",%Char(13)%Char(10)[),"%Char(44)"words":",]),{"timeTag":",[),"},),%Char(9834),)

[ly.bing.spotify.com]
Class=TAIMPLyricsWebPageBasedProvider
CustomHeaders=\nAccept-Language: en-US,en;q=0.5 \nuser-agent: Mozilla/5.0 (Linux; Android 10; HLK-AL00) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.5112.102 Mobile Safari/537.36 EdgA/104.0.1293.70
SearchQuery=https://www.bing.com/search?q="%title%"+%artist%+site:open.spotify.com/track/
SearchQueryEncoding=URL
SearchResult.StartTags=class="b_algo|>
SearchResult.FinishTags=</li>
SearchResultArtist.StartTags= - | by
SearchResultArtist.FinishTags= | Spotify
SearchResultTitle.StartTags=<h2>
SearchResultTitle.FinishTags= -
SearchResultURL.StartTags=href="
SearchResultURL.FinishTags="
SearchResultURL.PostProcessExpression=https://spotify-lyrics-api-pi.vercel.app/?url=%Value&format=lrc
DataLyrics.StartTags="lines":[{"
DataLyrics.FinishTags="}]
DataLyrics.PostProcessExpression=www.bing.spotify2.com\n\n%Replace(%Replace(%Replace(%Replace(%Replace(%Replace(%Replace(%Replace(%Replace(%Replace(%Replace(%Replace(%Replace(%Replace(%Replace(%Replace(%Value,"}%Char(44){",\n),timeTag":",),"%Char(44)"words":",),:,),.,),%Char(9834),%Char(9834)%Char(9834)%Char(9834)),0,),1,),2,),3,),4,),5,),6,),7,),8,),9,)

[music.163.com]
Class=TAIMPLyricsWebPageBasedProvider
SearchQuery=https://music.163.com/api/cloudsearch/pc/?type=1&s=%title%%20%artist%&limit=5&offset=0
SearchQueryEncoding=URL
SearchResult.StartTags="songs":[
SearchResult.FinishTags=]
SearchResultArtist.StartTags="ar"|"name":"
SearchResultArtist.FinishTags="
SearchResultTitle.StartTags="name":"
SearchResultTitle.FinishTags="
SearchResultURL.StartTags="id":
SearchResultURL.FinishTags=,
SearchResultURL.PostProcessExpression=https://music.163.com/api/song/lyric?os=pc&id=%Value&lv=1
DataLyrics.StartTags="lyric":"
DataLyrics.FinishTags="}
DataLyrics.PostProcessExpression=%IF(%Value,https://music.163.com\n\n,)%StrTrim(%IFEqual(%StrPos(%Char(20316),%IFEqual(%StrPos(%Char(20316),%Value),0,%Value,%StrCopy(%Value,%StrPos(%Char(10),%Value),%Length(%Value)))),0,%IFEqual(%StrPos(%Char(20316),%Value),0,%Value,%StrCopy(%Value,%StrPos(%Char(10),%Value),%Length(%Value))),%StrCopy(%IFEqual(%StrPos(%Char(20316),%Value),0,%Value,%StrCopy(%Value,%StrPos(%Char(10),%Value),%Length(%Value))),%StrPos(%Char(10),%StrTrim(%IFEqual(%StrPos(%Char(20316),%Value),0,%Value,%StrCopy(%Value,%StrPos(%Char(10),%Value),%Length(%Value))))),%Length(%Value))))

[ly.synced-lrclib.net]
Class=TAIMPLyricsWebPageBasedProvider
;CustomHeaders=\ncontent-type: application/json; charset=utf-8\ncontent-encoding: gzip\nuser-agent: Mozilla/5.0 (Android 13; Mobile; rv:68.0) Gecko/68.0 Firefox/105.0
SearchQuery=https://lrclib.net/api/search?artist_name=%artist%&track_name=%title%
SearchQueryEncoding=URL
SearchResult.StartTags={
SearchResult.FinishTags=}
;SearchResult.StartTags=[
;SearchResult.FinishTags=]
SearchResultArtist.StartTags="artistName":"
SearchResultArtist.FinishTags="
SearchResultTitle.StartTags="trackName":"
SearchResultTitle.FinishTags="
SearchResultURL.StartTags="id":
SearchResultURL.FinishTags=,
SearchResultURL.PostProcessExpression=https://lrclib.com/api/get/%Value
DataLyrics.StartTags="syncedLyrics":"
DataLyrics.FinishTags="}
DataLyrics.PostProcessExpression=www.synced-lrclib.net\n\n%Value

[track.apple.com]
Class=TAIMPAlbumArtWebPageBasedProvider
SearchQuery=https://music.apple.com/us/search?term=%artist%%20%title%
SearchQueryEncoding=URL
SearchResult.StartTags=data-testid="track-lockup"
SearchResult.FinishTags=track-lockup__context-menu
SearchResultTitle.StartTags=data-testid="track-lockup-title">
SearchResultTitle.FinishTags=</li>
SearchResultArtist.StartTags=data-testid="track-lockup-subtitle">
SearchResultArtist.FinishTags=</span>
SearchResultAlbumArt.StartTags=<source sizes="|srcset="
SearchResultAlbumArt.FinishTags=/48x48
SearchResultAlbumArt.PostProcessExpression=%Value/1200x1200bb.jpg

[album.apple.com]
Class=TAIMPAlbumArtWebPageBasedProvider
SearchQuery=https://music.apple.com/us/search?term=%artist%%20%album%
SearchQueryEncoding=URL
SearchResult.StartTags=data-testid="product-lockup"
SearchResult.FinishTags=</li>
SearchResultAlbum.StartTags=data-testid="product-lockup-title">
SearchResultAlbum.FinishTags=</span>
SearchResultArtist.StartTags=data-testid="product-lockup-subtitle">
SearchResultArtist.FinishTags=</a>
SearchResultAlbumArt.StartTags=<source sizes="|srcset="
SearchResultAlbumArt.FinishTags=/296x296
SearchResultAlbumArt.PostProcessExpression=%Value/1200x1200bb.jpg

[aa.itunes2.com]
Class=TAIMPAlbumArtWebPageBasedProvider
SearchQuery=http://itunes.apple.com/search?entity=album&term=%artist%+%20+%album%
SearchQueryEncoding=URL
SearchResult.StartTags={
SearchResult.FinishTags=}
SearchResultArtist.StartTags="artistName"|"
SearchResultArtist.FinishTags=,|"
SearchResultAlbum.StartTags="collectionName"|"
SearchResultAlbum.FinishTags=,|"
SearchResultAlbumArt.StartTags="artworkUrl100"|"
SearchResultAlbumArt.FinishTags=,|"
;SearchResultAlbumArt.PostProcessExpression=%Replace(%Value,100x100bb.jpg,600x600-75.jpg)
SearchResultAlbumArt.PostProcessExpression=%Value/1200x1200bb.jpg

[better.apple.com]
Class=TAIMPAlbumArtWebPageBasedProvider
SearchQuery=https://music.apple.com/us/search?term=%artist%%20-%20%title%
SearchQueryEncoding=URL
SearchResult.StartTags=<picture class="
SearchResult.FinishTags=<span aria-label="MORE"
SearchResultTitle.StartTags=data-testid="top-search-result-title">|>
SearchResultTitle.FinishTags=</span>
SearchResultArtist.StartTags=data-testid="top-search-result-subtitle">Song|%Char(183)
SearchResultArtist.FinishTags=</li>
SearchResultArtist.PostProcessExpression=%StrTrim(%Value)
SearchResultAlbumArt.StartTags=<source sizes="|srcset="
SearchResultAlbumArt.FinishTags=.jpg/
SearchResultAlbumArt.PostProcessExpression=%Value.jpg/1200x1200bb.jpg

[aa.last.fm]
Class=TAIMPAlbumArtWebPageBasedProvider
SearchQuery=https://www.last.fm/search/albums?q=%artist%+-+%album%
SearchResult.StartTags=album-result-inner
SearchResult.FinishTags=</div>
SearchResultArtist.StartTags=album-result-artist|<a|>
SearchResultArtist.FinishTags=</p|</a
SearchResultTitle.StartTags=class="title"|span>
SearchResultTitle.FinishTags=</span
SearchResultAlbumArt.StartTags=album-result-image|src="
SearchResultAlbumArt.FinishTags=</a|"
SearchResultAlbumArt.PostProcessExpression=%IF(%StrPos(c6f59c1e5e7240a4c0d427abd71f3dbb,%Value),,%Replace(%Value,/64s/,/ar0/))

[aa.bandcamp.com]
Class=TAIMPAlbumArtWebPageBasedProvider
SearchQuery=https://bandcamp.com/search?q=%album%&item_type=a
SearchQueryEncoding=URL
SearchResult.StartTags=class="searchresult data-search"|>
SearchResult.FinishTags=</li>
SearchResultArtist.StartTags=class="subhead">|by
SearchResultArtist.FinishTags=</div>
SearchResultAlbum.StartTags=a href=|>
SearchResultAlbum.FinishTags=</a>
SearchResultAlbumArt.StartTags=img src="
SearchResultAlbumArt.FinishTags="
SearchResultAlbumArt.PostProcessExpression=%Replace(%Replace(%Value,f4.,f1.),_7.,_10.)

[aa.deezer.com]
Class=TAIMPAlbumArtWebPageBasedProvider
SearchQuery=https://api.deezer.com/2.0/search/album?q=%artist%+%20+%album%
SearchQueryEncoding=URL
SearchResult.StartTags={
SearchResult.FinishTags=}
SearchResultArtist.StartTags="name"|"
SearchResultArtist.FinishTags=,|"
SearchResultAlbum.StartTags="title"|"
SearchResultAlbum.FinishTags=,|"
SearchResultAlbumArt.StartTags="cover_big"|"
SearchResultAlbumArt.FinishTags=,|"
SearchResultAlbumArt.PostProcessExpression=%Replace(%Value,\/,/)

[discogs.com]
Class=TAIMPAlbumArtWebPageBasedProvider
SearchQuery=https://www.discogs.com/en/search/?q=%artist%+-+%title%&type=all&type=all
SearchQueryEncoding=URL
SearchResult.StartTags=cards cards_layout_large
SearchResult.FinishTags=card_actions skittles
SearchResultArtist.StartTags=card-artist-name|<span title="|<a|>
SearchResultArtist.FinishTags=</span|</a
SearchResultAlbum.StartTags=card-release-title|<a|>
SearchResultAlbum.FinishTags=</div|</a
SearchResultAlbumArt.StartTags=<img data-src="
SearchResultAlbumArt.FinishTags="

[aa.musixmatch.com]
Class=TAIMPAlbumArtWebPageBasedProvider
SearchQuery=https://www.musixmatch.com/search/%artist%%20%title%/tracks
SearchQueryEncoding=URL
SearchResult.StartTags=track-card
SearchResult.FinishTags=</li>
SearchResultArtist.StartTags=class="artist"|>
SearchResultArtist.FinishTags=</a>
SearchResultTitle.StartTags=class="title"|span>
SearchResultTitle.FinishTags=</span
SearchResultAlbumArt.StartTags=media-card-picture|srcset="|480w, |https://
SearchResultAlbumArt.FinishTags=</div|"| |.jpg
SearchResultAlbumArt.PostProcessExpression=https://%Value.jpg

[aa.amazon.com]
Class=TAIMPAlbumArtWebPageBasedProvider
SearchQuery=https://www.amazon.com/s?k=%artist%+%20+-+%20+%title%&i=digital-music
SearchResult.StartTags=<div class="a-section">
SearchResult.FinishTags=<div data-asin
SearchResultArtist.StartTags=>by |<span|>
SearchResultArtist.FinishTags=</div|</span>
SearchResultAlbum.StartTags=<h2 class="|<span|>
SearchResultAlbum.FinishTags=</h2|</span
SearchResultAlbumArt.StartTags=<img|src="
SearchResultAlbumArt.FinishTags=>|"

[aa.genius.com]
Class=TAIMPAlbumArtWebPageBasedProvider
SearchQuery=https://genius.com/api/search/multi?per_page=5&q=%artist%%20%title%
CustomHeaders=\ncontent-type: application/json; charset=utf-8
;SearchQueryEncoding=URL
SearchResult.StartTags={"highlights"
SearchResult.FinishTags=}}]}
SearchResultArtist.StartTags="artist_names":"
SearchResultArtist.FinishTags="
SearchResultArtist.PostProcessExpression=%StrLeft(%StrLeft(%StrLeft(%Value,%Char(44)),%Char(40)),%Char(41)))
SearchResultTitle.StartTags="title":"
SearchResultTitle.FinishTags="
SearchResultTitle.PostProcessExpression=%StrLeft(%StrLeft(%StrLeft(%Value,%Char(44)),%Char(40)),%Char(41)))
SearchResultAlbumArt.StartTags="song_art_image_url":"
SearchResultAlbumArt.FinishTags="
;SearchResultAlbumArt.PostProcessExpression=%IFEqual(%Value,https://assets.genius.com/images/default_cover_image.png?1676573542,,%Value)
SearchResultAlbumArt.PostProcessExpression=%Value

Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: sveakul on December 14, 2024, 09:25:30
As luck would have it, the script used for Genius broke just two days ago!!

Thanks to the generosity of gr-e, he has supplied this fixed new version:

Code: [Select]
[genius.com]
Class=TAIMPLyricsWebPageBasedProvider
CustomHeaders=\ncontent-type: application/json; charset=utf-8\ncontent-encoding: gzip\nuser-agent: Mozilla/5.0 (Android 13; Mobile; rv:68.0) Gecko/68.0 Firefox/105.0
SearchQuery=https://genius.com/api/search/song?per_page=5&q=%artist%+%title%
SearchQueryEncoding=URL
SearchResult.StartTags="hits":[
SearchResult.FinishTags=],"next_page"
SearchResultArtist.StartTags="name":"
SearchResultArtist.FinishTags=",
SearchResultTitle.StartTags="title":"
SearchResultTitle.FinishTags=",
SearchResultURL.StartTags="url":"
SearchResultURL.FinishTags=",
DataLyrics.StartTags=<div data-lyrics-container="true" class="Lyrics-sc|">
DataLyrics.FinishTags=<div class="LyricsFooter-sc
DataLyrics.PostProcessExpression=www.genius.com\n\n%Value

I have replaced the bad one with this one in my last post of the whole code contents and the *.7z attachment.
Title: Re: Adding Genius Lyrics to aimp_webLyrics.ini
Post by: sveakul on December 28, 2024, 05:29:58
Unfortunately, see https://www.aimp.ru/forum/index.php?topic=57148.msg453080#msg453080 (https://www.aimp.ru/forum/index.php?topic=57148.msg453080#msg453080)