您的位置:首页 > 大数据 > 人工智能

baiduMp3接口3

2014-02-16 00:00 232 查看
歌曲ID 详细信息接口:
http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=2.4.0&method=baidu.ting.song.getInfos&format=xml&songid=354387&ts=1354960702678&e=pOwOqqTY0fS5jmtSdOJBh4XW4rQHDI7EhrJgILD3Z%2FQ%3D&nw=1&bduss=
幻灯片接口:
http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=2.4.0&method=baidu.ting.plaza.getFocusPic&format=json&limit=111
分类接口:
http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=2.4.0&method=baidu.ting.plaza.getPartDesc&format=json
歌手列表接口:
http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=2.4.0&method=baidu.ting.artist.get72HotArtist&format=xml&order=1&offset=0&limit=50
歌手歌曲接口:
http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=2.4.0&method=baidu.ting.artist.getSongList&format=xml&order=2&tinguid=7994&offset=0&limits=50
歌手介绍接口:
http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=2.4.0&method=baidu.ting.artist.getinfo&format=xml&tinguid=7994
搜索建议:
http://tingapi.ting.baidu.com/v1/restserver/ting?method=baidu.ting.search.suggestion&query=%E7%AB%A5&format=json&from=ios&version=2.1.1
query: 关键字

format: json/xml

新歌榜:
http://tingapi.ting.baidu.com/v1/restserver/ting?method=baidu.ting.billboard.billList&type=1&format=json&offset=0&size=50&from=ios&version=2.1.1
offset: 结果偏移(50表示从第50首歌曲开始)

size: 获取多少首歌曲

热歌榜:
http://tingapi.ting.baidu.com/v1/restserver/ting?method=baidu.ting.billboard.billList&type=2&format=json&offset=0&size=50&from=ios&version=2.1.1
歌手榜:
http://tingapi.ting.baidu.com/v1/restserver/ting?method=baidu.ting.billboard.billList&type=3&format=xml&offset=0&size=50&from=ios&version=2.1.1
搜索歌曲:
http://tingapi.ting.baidu.com/v1/restserver/ting?method=baidu.ting.search.common&query=%E7%AB%A5%E5%B9%B4&page_size=500&page_no=1&format=json&from=ios&version=2.1.1
query: 关键字

page_size: 每页数量

page_no: 当前页码
http://tingapi.ting.baidu.com/v1/restserver/ting?method=baidu.ting.search.lrcys&format=xml&query=
这个网址后面先加utf-8类型的歌名,再加上三个$$$符号,再加上歌手名字 就会得到以下的XML:

[html] view plaincopyprint?

<span style="font-size:18px;"><search_lrcys_response xmlns="http://openapi.baidu.com/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://openapi.baidu.com/1.0 http://openapi.baidu.com/1.0/baidu.xsd">
<query>因为爱情$$$陈奕迅</query>

<pages>

<total>3</total>

<rn_num>3</rn_num>

</pages>

<lrcys_list list="true">

<lrcy>

<lrclink>
http://ting.baidu.com/data2/lrc/20656735/20656735.lrc
</lrclink>

</lrcy>

<lrcy>

<lrclink>
http://ting.baidu.com/data2/lrc/14942655/14942655.lrc
</lrclink>

</lrcy>

<lrcy>

<lrclink>
http://ting.baidu.com/data2/lrc/14879591/14879591.lrc
</lrclink>

</lrcy>

</lrcys_list>

</search_lrcys_response></span>

其中 lrclink标签下就是可以提供我们下载lrc的网址,以下我们要做的就是另起线程下载lrc。

获取百度上榜单的URL:http://box.zhangmen.baidu.com/x?op=3&list_cat=1&.r=%f

它的XML为:

[html] view plaincopyprint?

<result>

<count>17</count>

<data>

<id>402</id>

<name>新歌TOP100</name>

<tcount>100</tcount>

<isnew>0</isnew>

</data>

<data>

<id>401</id>

<name>中文金曲榜</name>

<tcount>10</tcount>

<isnew>0</isnew>

</data>

<data>

<id>403</id>

<name>歌曲TOP500</name>

<tcount>500</tcount>

<isnew>0</isnew>

</data>

<data>

<id>404</id>

<name>dj舞曲</name>

<tcount>120</tcount>

<isnew>0</isnew>

</data>

<data>

<id>513</id>

<name>日韩流行风</name>

<tcount>120</tcount>

<isnew>0</isnew>

</data>

<data>

<id>512</id>

<name>欧美金曲</name>

<tcount>120</tcount>

<isnew>0</isnew>

</data>

<data>

<id>510</id>

<name>摇滚歌曲榜</name>

<tcount>330</tcount>

<isnew>0</isnew>

</data>

<data>

<id>503</id>

<name>热门对唱</name>

<tcount>210</tcount>

<isnew>0</isnew>

</data>

<data>

<id>500</id>

<name>影视金曲</name>

<tcount>330</tcount>

<isnew>0</isnew>

</data>

<data>

<id>506</id>

<name>校园民谣</name>

<tcount>330</tcount>

<isnew>0</isnew>

</data>

<data>

<id>502</id>

<name>经典老歌</name>

<tcount>330</tcount>

<isnew>0</isnew>

</data>

<data>

<id>507</id>

<name>流金岁月</name>

<tcount>330</tcount>

<isnew>0</isnew>

</data>

<data>

<id>408</id>

<name>中国民乐</name>

<tcount>210</tcount>

<isnew>0</isnew>

</data>

<data>

<id>405</id>

<name>轻音乐</name>

<tcount>120</tcount>

<isnew>0</isnew>

</data>

<data>

<id>407</id>

<name>少儿歌曲</name>

<tcount>240</tcount>

<isnew>0</isnew>

</data>

<data>

<id>406</id>

<name>相声曲艺</name>

<tcount>60</tcount>

<isnew>0</isnew>

</data>

<data>

<id>417</id>

<name>分类试听dj</name>

<tcount>230</tcount>

<isnew>0</isnew>

</data>

</result>

获取百度中的音乐文件呢:
http://box.zhangmen.baidu.com/x?op=12&count=1&title=
title后面加上=洋葱$$平安

就可以获得这首歌的播放地址的xml

如何:

[html] view plaincopyprint?

<result>

<count>2</count>

<url>

<encode>

<![CDATA[
http://zhangmenshiting.baidu.com/data2/music/5251713/ZmRoZWxnamaeomZzrZmmnJZvaJWaZ2ppkmRlmWpsmJ1paZeVaWicaZdjlGibl21xaJRZoZ6adGhfamtsZ2tvcWRqY2huaW44
]]>

</encode>

<decode>

<![CDATA[

5251713.mp3?xcode=5ae131a22e56ae87da42e1f1a4fa697b&mid=0.88825893804937

]]>

</decode>

<type>8</type>

<lrcid>0</lrcid>

<flag>0</flag>

</url>

<durl>

<encode>

<![CDATA[
http://zhangmenshiting2.baidu.com/data2/music/350333/ZGdjZ2hpZaWhZXKsmKWbnW5nlJlmaWiZY2SYaWuXnHBolpRoZ5tonmKTZ5qWbHBvk1ignZlzZ2Zpamtmam5wa2liZ21obTc$
]]>

</encode>

<decode>

<![CDATA[

350333.mp3?xcode=5ae131a22e56ae87da42e1f1a4fa697b&mid=0.88825893804937

]]>

</decode>

<type>8</type>

<lrcid>0</lrcid>

<flag>0</flag>

</durl>

<url>

<encode>

<![CDATA[
http://yuelink-music.b0.upaiyun.com/tdyso_circle/qJOhm6iemKaYX6yVo52ap5-ZYINnNg$$.mp3
]]>

</encode>

<decode>

<![CDATA[ wangshang-yangcong-O2.mp3 ]]>

</decode>

<type>1</type>

<lrcid>0</lrcid>

<flag>0</flag>

</url>

<durl/>

<p2p>

<hash>3ba5010ee29d6741d6dbb1679de5aae4b135dd2f</hash>

<url>

<![CDATA[
http://zhangmenshiting.baidu.com/data2/music/14889204/14889204.mp3?xcode=5ae131a22e56ae87da42e1f1a4fa697b
]]>

</url>

<type>mp3</type>

<size>6895470</size>

<bitrate>192</bitrate>

</p2p>

</result>

其中和很多网络上流传的版本一样;

[html] view plaincopyprint?

<encode>

<![CDATA[
http://yuelink-music.b0.upaiyun.com/tdyso_circle/qJOhm6iemKaYX6yVo52ap5-ZYINnNg$$.mp3
]]>

</encode>

[html] view plaincopyprint?

这个标签放着这个MP3的url ;但是这个url是加密的,但是,密室就在下面的:

[html] view plaincopyprint?

<pre name="code" class="html"><decode>

<![CDATA[ wangshang-yangcong-O2.mp3 ]]>

</decode></pre>我们只要把这个标签中的<pre name="code" class="html">wangshang-yangcong-O2.mp3 字段替换了《encode》标签中url最后一个“/”后的字段,就可以获取这个MP3的真正网络地址 </pre><pre name="code" class="html">当然下面还有些标签 代表这个音乐文件的类型 </pre><pre name="code" class="html">mp3 wma 或者其他</pre><pre name="code" class="html">当然 如果哪个encode便签下没有decode这个便签的话,那么它的地址是没有被加密的,可以直接使用。</pre><pre name="code" class="html"></pre><pre name="code" class="html"></pre><pre name="code" class="html"> </pre><pre name="code" class="html"></pre>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  baiduMp3接口