酷我音乐搜索 & 下载

搜索歌名/歌手

GET 请求:http://player.kuwo.cn/webmusic/getsjplayinfo?flag=6&pn=1&pr=500&type=music&key=<关键字 (UTF8 编码)>

例如 “晴天 周杰伦”:http://player.kuwo.cn/webmusic/getsjplayinfo?flag=6&pn=1&pr=500&type=music&key=%E6%99%B4%E5%A4%A9%20%E5%91%A8%E6%9D%B0%E4%BC%A6

取得 JSON 数据 (经过裁剪;原文非标准 JSON 格式): { "total": "3", "list": [{ "rid": "MUSIC_228908", "songName": "晴天", "album": "叶惠美", "ridmd591": "3C46935CD52A56825BF494B1AF6D078F", "duration": "269", "artist": "周杰伦" }, { "rid": "MUSIC_12102832", "songName": "晴天", "album": "", "ridmd591": "3E9F2E1B1397071AB2E7BD895919675D", "duration": "268", "artist": "周杰伦" }, { "rid": "MUSIC_324937", "songName": "晴天(Live)", "album": "周杰伦 2004 无与伦比 演唱会 Live CD", "ridmd591": "08B00CC3EF38AA44028D16A091E01C01", "duration": "299", "artist": "周杰伦" }] }

其中 rid 是下一步用来获取地址时需要的数据。

获取真实地址

GET 请求: http://player.kuwo.cn/webmusic/st/getNewMuiseByRid?rid=<rid>

例如刚才搜索 “晴天” 的第一个结果:http://player.kuwo.cn/webmusic/st/getNewMuiseByRid?rid=MUSIC_228908

取得 XML 数据:

<Song>
  <music_id>228908</music_id>
  <mv_rid>MV_0</mv_rid>
  <name>晴天</name>
  <song_url>http://yinyue.kuwo.cnhttp://yinyue.kuwo.cn/yy/gequ-zhoujielun_qingtian/...</song_url>
  <artist>周杰伦</artist>
  <artid>336</artid>
  <singer>周杰伦</singer>
  <special>叶惠美</special>
  <ridmd591>3C46935CD52A56825BF494B1AF6D078F</ridmd591>
  <mp3size>10.29 MB</mp3size>
  <artist_url>http://yinyue.kuwo.cnhttp://yinyue.kuwo.cn/yy/geshou-zhoujielun/...</artist_url>
  <auther_url>http://www.kuwo.cn/mingxing/%E5%91%A8%E6%9D%B0%E4%BC%A6/</auther_url>
  <playid>play?play=MQ==&amp;num=MQ==&amp;name0=x+fM7A==&amp;artist0=1ty93MLX&amp;....</playid>
  <artist_pic>http://img3.kuwo.cn/star/starheads/120/4/...</artist_pic>
  <artist_pic240>http://img1.kuwo.cn/star/starheads/120/42/97/3914752958.jpg</artist_pic240>
  <path>m3/ape2wma_20090522/1/54/1178089657.wma</path>
  <mp3path>n2/128/64/73/222129269.mp3</mp3path>
  <aacpath>a2/2/42/3194564247.aac</aacpath>
  <wmadl>wmadl.cdn.kuwo.cn</wmadl>
  <mp3dl>other.web.ra01.sycdn.kuwo.cn</mp3dl>
  <aacdl>other.web.ra03.sycdn.kuwo.cn</aacdl>
  <lyric>DBYAHlReXEpRUEAeCgxVEgAORRgLG0MXCRgaCwoRAB5UAwEaBAkEBhwaXxcAHVReSAsMAVEkOj0w...</lyric>
  <lyric_zz>DBYAHlReXEpRUEAeCgxVEgAORRgLG0MXCRgaCwoRAB5UAwEaBAkEBhwaXxcAHVReSAsMAVEkO...</lyric_zz>
</Song>

拼接参数得到实际资源地址: "http://" + mp3dl + "/resource/" + mp3path "http://" + aacdl + "/resource/" + aacpath

192kbps 版本

GET 请求:http://antiserver.kuwo.cn/anti.s?type=convert_url&response=url&rid=<rid>&format=mp3

例如刚才 “晴天” 的结果:http://antiserver.kuwo.cn/anti.s?type=convert_url&response=url&rid=MUSIC_228908&format=mp3

取得一个 URL: http://win.web.ra01.sycdn.kuwo.cn/e8671494bf43e84c82ab975242939836/58a0f3fb/resource/n2/192/59/91/2950214351.mp3

就是所谓高品质的音乐地址了 (注: 地址会自动过期,一段时间后需要重新解析)。

实际试听 (AAC + MP3 多源)

晴天 - 周杰伦

情歌王 - 古巨基

Only My Railgun - fripSide

Jixun 的头像

Jixun