Mr.[先知] 发表于 2011-10-13 12:06

发一个虾米音乐解析的研究,希望对大家有帮助

因为我经常在虾米听歌
所以为了方便
准备弄一个下载虾米的歌曲
否则每次都要去嗅探
使用易语言写源码
不过现在仅仅是原理
代码还没有写呢
----------------
通过嗅探器嗅探到了几个地址
1.http://www.xiami.com/radio/xml/type/8/id/2
格式是xml的
这个地址是虾米电台的随机地址,不过是使用用户登录后的
以下是内容
<?xml version="1.0" encoding="utf-8" ?>
- <playList>
- <config>
<user_id />
- <nick_name>
- <!
]]>
</nick_name>
<autoPlay>1</autoPlay>
</config>
- <trackList>
- <track>
- <song_name>
- <!
]]>
</song_name>
<song_id>3671540</song_id>
<album_id>329323</album_id>
<album_cover>http://img.xiami.com/./images/album/img2/57002/3293231242197461_1.jpg</album_cover>
- <album_name>
- <!
]]>
</album_name>
<artist_id>57002</artist_id>
- <artist_name>
- <!
]]>
</artist_name>
<grade />
- <location>
- <!
]]>
</location>
</track>
- <track>
- <song_name>
- <!
]]>
</song_name>
<song_id>1769117387</song_id>
<album_id>337683</album_id>
<album_cover>http://img.xiami.com/./images/album/img69/7169/3376831248071873_1.jpg</album_cover>
- <album_name>
- <!
]]>
</album_name>
<artist_id>7169</artist_id>
- <artist_name>
- <!
]]>
</artist_name>
<grade />
- <location>
- <!
]]>
</location>
</track>
- <track>
- <song_name>
- <!
]]>
</song_name>
<song_id>1769642455</song_id>
<album_id>391119</album_id>
<album_cover>http://img.xiami.com/./images/album/img88/58888/3911191279679547_1.jpg</album_cover>
- <album_name>
- <!
]]>
</album_name>
<artist_id>58888</artist_id>
- <artist_name>
- <!
]]>
</artist_name>
<grade />
- <location>
- <!
]]>
</location>
</track>
- <track>
- <song_name>
- <!
]]>
</song_name>
<song_id>2050679</song_id>
<album_id>167403</album_id>
<album_cover>http://img.xiami.com/./images/album/img90/1290/167403_1.jpg</album_cover>
- <album_name>
- <!
]]>
</album_name>
<artist_id>1290</artist_id>
- <artist_name>
- <!
]]>
</artist_name>
<grade />
- <location>
- <!
]]>
</location>
</track>
- <track>
- <song_name>
- <!
]]>
</song_name>
<song_id>1535941</song_id>
<album_id>157925</album_id>
<album_cover>http://img.xiami.com/./images/album/img12/18912/1579251313137453_1.jpg</album_cover>
- <album_name>
- <!
]]>
</album_name>
<artist_id>18912</artist_id>
- <artist_name>
- <!
]]>
</artist_name>
<grade />
- <location>
- <!
]]>
</location>
</track>
- <track>
- <song_name>
- <!
]]>
</song_name>
<song_id>1769483773</song_id>
<album_id>378251</album_id>
<album_cover>http://img.xiami.com/./images/album/img91/86691/1272086692_1.jpg</album_cover>
- <album_name>
- <!
]]>
</album_name>
<artist_id>23256</artist_id>
- <artist_name>
- <!
]]>
</artist_name>
<grade />
- <location>
- <!
]]>
</location>
</track>
- <track>
- <song_name>
- <!
]]>
</song_name>
<song_id>1769167648</song_id>
<album_id>351048</album_id>
<album_cover>http://img.xiami.com/./images/album/img0//3510481257735307_1.jpg</album_cover>
- <album_name>
- <!
]]>
</album_name>
<artist_id>23517</artist_id>
- <artist_name>
- <!
]]>
</artist_name>
<grade />
- <location>
- <!
]]>
</location>
</track>
- <track>
- <song_name>
- <!
]]>
</song_name>
<song_id>1770517372</song_id>
<album_id>69878</album_id>
<album_cover>http://img.xiami.com/./images/album/img21/2021/698781317282826_1.jpg</album_cover>
- <album_name>
- <!
]]>
</album_name>
<artist_id>2021</artist_id>
- <artist_name>
- <!
]]>
</artist_name>
<grade />
- <location>
- <!
]]>
</location>
</track>
- <track>
- <song_name>
- <!
]]>
</song_name>
<song_id>1770500629</song_id>
<album_id>466941</album_id>
<album_cover>http://img.xiami.com/./images/album/img12/560012/1316560012_1.png</album_cover>
- <album_name>
- <!
]]>
</album_name>
<artist_id>23401</artist_id>
- <artist_name>
- <!
]]>
</artist_name>
<grade />
- <location>
- <!
]]>
</location>
</track>
- <track>
- <song_name>
- <!
]]>
</song_name>
<song_id>1769642275</song_id>
<album_id>401593</album_id>
<album_cover>http://img.xiami.com/./images/album/img24/74124/4015931316406718_1.jpg</album_cover>
- <album_name>
- <!
]]>
</album_name>
<artist_id>74124</artist_id>
- <artist_name>
- <!
]]>
</artist_name>
<grade />
- <location>
- <!
]]>
</location>
</track>
- <track>
- <song_name>
- <!
]]>
</song_name>
<song_id>136017</song_id>
<album_id>11017</album_id>
<album_cover>http://img.xiami.com/./images/album/img17/2017/11017_1.jpg</album_cover>
- <album_name>
- <!
]]>
</album_name>
<artist_id>2017</artist_id>
- <artist_name>
- <!
]]>
</artist_name>
<grade />
- <location>
- <!
]]>
</location>
</track>
- <track>
- <song_name>
- <!
]]>
</song_name>
<song_id>1770513207</song_id>
<album_id>69878</album_id>
<album_cover>http://img.xiami.com/./images/album/img21/2021/698781317282826_1.jpg</album_cover>
- <album_name>
- <!
]]>
</album_name>
<artist_id>2021</artist_id>
- <artist_name>
- <!
]]>
</artist_name>
<grade />
- <location>
- <!
]]>
</location>
</track>
- <track>
- <song_name>
- <!
]]>
</song_name>
<song_id>20544</song_id>
<album_id>2650</album_id>
<album_cover>http://img.xiami.com/./images/album/img8/608/2650_1.jpg</album_cover>
- <album_name>
- <!
]]>
</album_name>
<artist_id>608</artist_id>
- <artist_name>
- <!
]]>
</artist_name>
<grade />
- <location>
- <!
]]>
</location>
</track>
- <track>
- <song_name>
- <!
]]>
</song_name>
<song_id>1481203</song_id>
<album_id>145462</album_id>
<album_cover>http://img.xiami.com/images/album/img33/16433/145462_1.jpg</album_cover>
- <album_name>
- <!
]]>
</album_name>
<artist_id>16433</artist_id>
- <artist_name>
- <!
]]>
</artist_name>
<grade />
- <location>
- <!
]]>
</location>
</track>
- <track>
- <song_name>
- <!
]]>
</song_name>
<song_id>373670</song_id>
<album_id>1049</album_id>
<album_cover>http://img.xiami.com/./images/album/img31/2931/1049_1.jpg</album_cover>
- <album_name>
- <!
]]>
</album_name>
<artist_id>2931</artist_id>
- <artist_name>
- <!
]]>
</artist_name>
<grade />
- <location>
- <!
]]>
</location>
</track>
</trackList>
</playList>
而且每次刷新之后内容都是随机的
2.http://www.xiami.com/app/iphone/song/id/3392782/uid/2918918
这个地址是可以获取到源MP3地址的
其中3392782是歌曲的ID
其实很好理解,前面是/song/id/也就是song id 3392782
后面的/uid/2918918这个是用户id
不论有没有用户id歌曲都可以解析到mp3地址
内容
{"song_id":"3392782","default_resource_id":"2273969","length":"297","category":null,"listen_file":"\/1354\/306818\/04 3392782_2273969.mp3","album_id":"306818","name":"The blower's daughter (\u51b7\u6218\u9636\u6bb5)","artist_name":"\u8521\u4f9d\u6797","artist_id":"1354","title_url":"The+blower's+daughte","recommends":"10","singers":"\u8521\u4f9d\u6797","title":"\u7231\u7684\u7ec3\u4e60\u8bed","album_logo":"http:\/\/img.xiami.com\/.\/images\/album\/img54\/1354\/306818_2.jpg","location":"http:\/\/f1.xiami.net\/1354\/306818\/04 3392782_2273969.mp3","low_size":"3571670","file_size":"10348772","low_hash":"8616020f2247a2918c8ec2653db98ca3","whole_hash":"152a0015d7907db8477aee2eade71eb5","content_hash":"152a0015d7907db8477aee2eade71eb5","content_size":"10348772","lock_lrc":"2","lyric":"http:\/\/img.xiami.com\/.\/lyric\/upload\/82\/3392782_1281774394.lrc","year_play":"1347","grade":null,"album_url":"http:\/\/www.xiami.com\/app\/iphone\/albuminfo?id=306818&uid=2918918","artist_url":"http:\/\/www.xiami.com\/app\/iphone\/artistinfo?id=1354&uid=2918918","isad":"0"}


location后面的地址http:\/\/f1.xiami.net\/1354\/306818\/04 3392782_2273969.mp3
加入了反斜杠\,把反斜杠全部去掉之后,就可以得到地址
http://f1.xiami.net/1354/306818/04 3392782_2273969.mp3

Mr.[先知] 发表于 2011-10-13 23:18

每次发的东西都没有人支持
难道发的没有技术含量

新月之痕 发表于 2011-10-16 01:00

楼主我支持你呀,虾米上面的个音质不错,这个软件好,很羡慕你们这些专业人士,楼主加油

白馒头 发表于 2012-2-26 12:34

支持你,谢谢分享

安小庄√ 发表于 2012-5-21 03:03

poboke 发表于 2012-5-21 11:28

这个用php来写比较容易,几行代码就能搞定
页: [1]
查看完整版本: 发一个虾米音乐解析的研究,希望对大家有帮助