A blogger asks questions about making music player lyrics. To show the lyrics of course have lyrics, so last night spent a little time to do it,
Algorithm information from the network of a section of PHP code, the specific source is unknown.
The whole process of downloading lyrics is:
1, according to the singer and the name of the song to find a single list of lyrics
The server address is:
Http://ttlrcct2.qianqian.com/dll/lyricsvr.dll?sh?artist={0}&title={1}&flags=0
Unicode encoding string for singer name {0}
Unicode encoding string for the song name {1}
Attention
The singer name, the song name needs to go to the space, "'", converts to lowercase and so on operation.
Unicode encoding requires a byte conversion to 16, rather than a character.
2. The above operation gets the XML result similar to the following.
<?xml version="1.0" encoding="UTF-8"?>
<result>
<lrc id="70437" artist="胡彦斌" title="男人 KTV"></lrc>
<lrc id="204568" artist="胡彦斌" title="男人KTV"></lrc>
</result>
3, we choose one of the lyrics to download.
According to the choice of lyrics Id,artist,title generate a checksum string (code), the specific algorithm to see the source code.
Get the lyrics by ID and code to the address below.
Http://ttlrcct2.qianqian.com/dll/lyricsvr.dll?dl?id={0}&code={1}
{0}:id
{1}:code
This article supporting source code