QQ Music API

Before took QQ music may still be used before, such as http://tsmusic24.tc.qq.com/{$song_id}.mp3 this can not be used, and waste more than that, we go directly to the topic.

the first method:

Search for songs and artists:

Request address: https: //cyqq.com

Request examples: https://cyqq.com/soso/fcgi-bin/music_search_new_platform?searchid=53806572956004615&t=1&aggr=1&cr=1&catZhida=1&lossless=0&flag_qc=0&p=1&n=2&w= not so simple

parameter Explanation Do you have to Defaults
p Paging no The default is 1
n The number of requests no The default is 10
w Keyword Yes no
format format no If Retrofit of Json parsing, then we must remember that format = json

The request to return the data, we will find that there's a f:

"F": "649069 | not that simple | 4740 | Tiger Huang | 55176 | simple is not simple | 2492289 | 307 | 8 | 1 | 1 | 12327908 | 4931284 | 0 | 0 | 0 | 32998268 | 6570790 | 7425738 | 0 | 003Ue6Ia32q4gl | 0003Aksc3Iisgq | 002Gbc9W0oOAS3 | 0 | 4009 ",

f attribute to "|" index 0 is the position delimiter is used to obtain the song lyrics and music id, index 1 is the song name, artist name index is 3, 4 position index picture corresponding to the album pictures taken id .

Songs get the picture:

Image_id:55176

请求模板:"http://imgcache.qq.com/music/photo/album_300/" + (Image_id% 100) + "/300_albumpic_" + Image_id + "_0.jpg";

Example Request: http://imgcache.qq.com/music/photo/album_300/76/300_albumpic_55176_0.jpg

Get songs to play Links:

Song_id :649069

First get Songmid:

请求模板:"https://c.y.qq.com/v8/fcg-bin/fcg_play_single_song.fcg?songid=" +Song_id + "&tpl=yqq_song_detail&format=jsonp&callback=getOneSongInfoCallback";

Referrals example: https://cyqq.com/v8/fcg-bin/fcg_play_single_song.fcg?songid=649069&tpl=yqq_song_detail&format=jsonp&callback=getOneSongInfoCallback

The returned data, Songmid = mid == "Songmid = 003Ue6Ia32q4gl

Then we have to get the song file name:

请求模板: "https://uyqq.com/cgi-bin/musicu.fcg?format=json&data=%7B%22req_0%22%3A%7B%22module%22%3A%22vkey.GetVkeyServer%22%2C%22method % 22% 3A% 22CgiGetVkey% 22% 2C% 22param% 22% 3A% 7B% 22guid% 22% 3A% 22358840384% 22% 2C% 22songmid% 22% 3A% 5B% 22 "+ Songmid +"% 22% 5D% 2C% 22songtype% 22% 3A% 5B0% 5D% 2C% 22uin% 22% 3A% 221443481947% 22% 2C% 22loginflag% 22% 3A1% 2C% 22platform% 22% 3A% 2220% 22% 7D% 7D% 2C% 22comm% 22% 3A% 7B% 22uin% 22% 3A% 2218585073516% 22% 2C% 22format% 22% 3A% 22json% 22% 2C% 22ct% 22% 3A24% 2C% 22cv% 22% 3A0% 7D% 7D " ;

Example Request: https://uyqq.com/cgi-bin/musicu.fcg?format=json&data=%7B%22req_0%22%3A%7B%22module%22%3A%22vkey.GetVkeyServer%22%2C%22method% 22 is%. 3A% 22CgiGetVkey% 22 is% 2C% 22param% 22 is%. 3A% 7B% 22guid% 22 is%. 3A% 22,358,840,384% 22 is% 2C% 22 is songmid % 22 is%. 3A% 5B% 22 is 003Ue6Ia32q4gl % 22 is% 5D% 2C% 22songtype% 22% 3A% 5B0% 5D% 2C% 22uin% 22% 3A% 221443481947% 22% 2C% 22loginflag% 22% 3A1% 2C% 22platform% 22% 3A% 2220% 22% 7D% 7D% 2C% 22comm% 22% 3A% 7B% 22uin% 22% 3A% 2218585073516% 22% 2C% 22format% 22% 3A% 22json% 22% 2C% 22ct% 22% 3A24% 2C% 22cv% 22% 3A0% 7D% 7D

The returned data we can get the filename;

 Request template: "http://ws.stream.qqmusic.qq.com/" + filename;

Example Request: http://ws.stream.qqmusic.qq.com/C400001pNZFJ4Luwsm.m4a

Get song lyrics:

Songmid and play the same songs get, Songmid = 003Ue6Ia32q4gl

请求模板:"https://c.y.qq.com/lyric/fcgi-bin/fcg_query_lyric_new.fcg?songmid="+Songmid+"&format=json&nobase64=1"

Example Request: https://cyqq.com/lyric/fcgi-bin/fcg_query_lyric_new.fcg?songmid=003Ue6Ia32q4gl&format=json&nobase64=1

If the request is returned -1310, then the request header to add Referer: https: //y.qq.com/portal/player.html this can be, because the request lyrics a little bit special, API added restrictions,

Referer role is representative of the source of your request is there, https: //y.qq.com/portal/player.html on behalf of QQ music player URL, so he only through a specific source, in order to

Request to the data.

The second method:

1. Search for songs and artists:

Request address: https: //cyqq.com

Example Request: https://cyqq.com/soso/fcgi-bin/client_search_cp?p=1&n=2&w= not so simple & format = json

Description:

parameter Explanation Do you have to Defaults
p Paging no The default is 1
n The number of requests no The default is 10
w Keyword Yes no
format format no If Retrofit of Json parsing, then we must remember that format = json

2. Search Album:

Request address: https: //cyqq.com

Example Request: https://cyqq.com/soso/fcgi-bin/client_search_cp?p=1&n=2&w= not so simple & format = json & t = 8

Description: with respect to the search for the lyrics, plus a t parameters: no default, if the search album, the t 8. If you are searching mv, t = 12.

3. Get singer Photo:

Request Address: http: //music.163.com

Example Request: http://music.163.com/api/search/get/web?s= Tiger Huang & type = 100

Description: singer will request a picture field, after the request picUrl and img1v1Url is the picture address

Note: If data is not requested, in the add request header: "User-Agent: Mozilla / 5.0 (Windows NT 10.0; Win64; x64) AppleWebKit / 537.36 (KHTML, like Gecko) Chrome / 76.0.3809.132 Safari / 537.36"

4. fundamental albnumMID get album art:

Request Address: http: //y.gtimg.cn

Example Request: http://y.gtimg.cn/music/photo_new/T002R180x180M000002Gbc9W0oOAS3.jpg

Description: Sample request actually consists of two parts, namely a fixed address (http://y.gtimg.cn/music/photo_new/T002R180x180M000)+albumMid.

5. Get the player Address:

Request address: https: //uyqq.com

Example Request: https://uyqq.com/cgi-bin/musicu.fcg?format=json&data=%7B%22req_0%22%3A%7B%22module%22%3A%22vkey.GetVkeyServer%22%2C%22method% 22 is%. 3A% 22CgiGetVkey% 22 is% 2C% 22param% 22 is%. 3A% 7B% 22guid% 22 is%. 3A% 22,358,840,384% 22 is% 2C% 22 is songmid % 22 is%. 3A% 5B% 22 is 003Ue6Ia32q4gl % 22 is% 5D% 2C% 22songtype% 22% 3A% 5B0% 5D% 2C% 22uin% 22% 3A% 221443481947% 22% 2C% 22loginflag% 22% 3A1% 2C% 22platform% 22% 3A% 2220% 22% 7D% 7D% 2C% 22comm% 22% 3A% 7B% 22uin% 22% 3A% 2218585073516% 22% 2C% 22format% 22% 3A% 22json% 22% 2C% 22ct% 22% 3A24% 2C% 22cv% 22% 3A0% 7D% 7D

Description: Replacement requests, only need to replace 003Ue6Ia32q4gl to the songmid.

After the request is a data request again:

Play Address:

Embodiment (1) purl empty: sip [0] + purl

 http://ws.stream.qqmusic.qq.com/C400000HjG8v1DTWRO.m4a?guid=358840384&vkey=852D30CD2DEA9E0AFF9CF700977FAFB413A06486CFE8F72502918665277C5407D8D5AD42039F02329401300003A2853B10816B83C3145159&uin=0&fromtag=66

Manner (2) purl is not empty, using filename: sip [0] + filename

http://ws.stream.qqmusic.qq.com/C400001pNZFJ4Luwsm.m4a

6. Get the lyrics:

Request address: https: //cyqq.com

Example Request: https://cyqq.com/lyric/fcgi-bin/fcg_query_lyric_new.fcg?songmid=003aAYrm3GE0Ac&format=json&nobase64=1

Note: If the request is returned -1310, then the request header to add Referer: https: //y.qq.com/portal/player.html this can be, because the request lyrics a little bit special, API added restrictions,

Referer role is representative of the source of your request is there, https: //y.qq.com/portal/player.html on behalf of QQ music player URL, so he only through a specific source, in order to

Request to the data.

 

Guess you like

Origin www.cnblogs.com/yueyongsheng/p/12574940.html