百度音乐API抓取

前段时间做了一个本地音乐的播放器 github地址,想实现在线播放的功能,于是到处寻找API,很遗憾,不是歌曲不全就是质量不高。在网上发现这么一个APIMRASONG博客,有“获取榜单,搜索歌词,下载地址,专辑”信息等等接口。

后来发现有些接口使用起来不是很方便,比如获取专辑信息,只能得到歌曲列表的id信息,所以自己决定用fiddler来对百度音乐安卓客户端抓包。

下面是一系列的接口:

一. 关键词建议:

GET:

 http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=5.6.5.0&method=baidu.ting.search.catalogSug&format=json&query=%E4%B8%83%E9%87%8C%E9%A6%99

参数:

version   5.6.5.0    //版本
query   七里香//关键字
method  baidu.ting.search.catalogSug//method
fromandroid    //平台
formatjson   //format格式

返回:

{"song": [
{"bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}","yyr_artist": "0","songname": "七里香","artistname": "周杰伦","control": "0000000000","songid": "15702101","has_mv": "1","encrypted_songid": "0806ef98550855dddac0"
},
{"bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}","yyr_artist": "0","songname": "七里香(live版)","artistname": "周杰伦","control": "0000000000","songid": "18638327","has_mv": "0","encrypted_songid": "920711c65f70855e5be03"
},
{"bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}","yyr_artist": "0","songname": "七里香","artistname": "周玥178","control": "0000000000","songid": "121794230","has_mv": "0","encrypted_songid": ""
},
{"bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}","yyr_artist": "0","songname": "七里香","artistname": "刘芳","control": "0000000000","songid": "2077664","has_mv": "0","encrypted_songid": "50061fb3e00854ce60db"
},
{"bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}","yyr_artist": "0","songname": "七里香","artistname": "网络歌手","control": "0000000000","songid": "28216714","has_mv": "0","encrypted_songid": "31071ae8d8a0854cc129e"
},
{"bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}","yyr_artist": "0","songname": "七里香(Live)","artistname": "周杰伦","control": "0000000000","songid": "51981196","has_mv": "0","encrypted_songid": "58073192b8c0855ddd8da"
},
{"bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}","yyr_artist": "0","songname": "七里香","artistname": "汪东城","control": "0000000000","songid": "84961907","has_mv": "0","encrypted_songid": "08075106a730854cdd805"
},
{"bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}","yyr_artist": "0","songname": "七里香","artistname": "施艾敏","control": "0000000000","songid": "17565909","has_mv": "0","encrypted_songid": "420710c08d508559df21f"
},
{"bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}","yyr_artist": "0","songname": "七里香","artistname": "苏仨","control": "0000000000","songid": "84957626","has_mv": "0","encrypted_songid": "830751059ba08559df358"
},
{"bitrate_fee": "{\"0\":\"0|0\",\"1\":\"0|0\"}","yyr_artist": "0","songname": "七里香","artistname": "陈淑桦","control": "0000000000","songid": "208828","has_mv": "0","encrypted_songid": "370532fbc0855e3ed63"
}],"order": "song,album","error_code": 22000,"album": [{"albumname": "七里香","artistpic": "http:\/\/musicdata.baidu.com\/data2\/pic\/115430839\/115430839.jpg","albumid": "67909","artistname": "周杰伦"
},
{"albumname": "七里香(台湾正式版)","artistpic": "http:\/\/a.hiphotos.baidu.com\/ting\/pic\/item\/3b292df5e0fe9925ff46084536a85edf8db17158.jpg","albumid": "183906","artistname": "周杰伦 "
}]
}

二. 关键字搜索(包括歌曲,专辑,歌手,伴奏)

GET:

http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=5.6.5.0&method=baidu.ting.search.merge&format=json&query=%E4%B8%83%E9%87%8C%E9%A6%99&page_no=1&page_size=50&type=-1&data_source=0&use_cluster=1 

参数:(下面应该很容易懂,就不具体解释了)

version     5.6.5.0
method   baidu.ting.search.merge
format   json
query    七里香
page_no  1
page_size 50
type        -1
data_source  0
use_cluster  1

返回值:

{
"error_code": 22000,
"result": {"query": "七里香","syn_words": "","rqt_type": 1,"song_info": {"total": 69,"song_list": [{"content": "","copy_type": "1","toneid": "0","info": "","all_rate": "320,128,flac,256,192,64,24","resource_type": 2,"relate_status": 0,"has_mv_mobile": 1,"song_id": "18401298","title": "七里香","ting_uid": "7994","author": "周杰伦","album_id": "18394691","album_title": "第五届百事音乐风云榜","is_first_publish": 0,"havehigh": 2,"charge": 0,"has_mv": 0,"learn": 0,"song_source": "web","piao_id": "0","korean_bb_song": "0","resource_type_ext": "0","artist_id": "29","all_artist_id": "29","lrclink": "http://musicdata.baidu.com/data2/lrc/65094964/%E4%B8%83%E9%87%8C%E9%A6%99.lrc","data_source": 0,"cluster_id": 93119037},{"content": "","copy_type": "1","toneid": "600902000006889283","info": "","all_rate": "128,64,256,192,320,flac,24","resource_type": 2,"relate_status": 0,"has_mv_mobile": 1,"song_id": "290466","title": "止战之殇.","ting_uid": "7994","author": "周杰伦","album_id": "67909","album_title": "","is_first_publish": 0,"havehigh": 2,"charge": 0,"has_mv": 1,"learn": 1,"song_source": "web","piao_id": "0","korean_bb_song": "0","resource_type_ext": "0","artist_id": "29","all_artist_id": "29","lrclink": "http://musicdata.baidu.com/data2/lrc/13881596/%E6%AD%A2%E6%88%98%E4%B9%8B%E6%AE%87..lrc","data_source": 0,"cluster_id": 93304629},......]},"album_info": {"total": 2,"album_list": [{"album_id": "67909","author": "周杰伦","hot": 22412,"title": "<em>七里香</em>","artist_id": "29","all_artist_id": "29","company": "杰威尔JVR音乐有限公司","publishtime": "2004-08-03","album_desc": "周杰伦的新专辑在8月3日正式发行,这次引用了诗人席幕蓉名诗《<em>七里香</em>》作为新专辑名称,周杰伦以往每一次的专辑名称都给了歌迷许多想象空间,也给了大家许多惊叹号。这次也许并不令人惊喜。但是周杰伦自有说法:“...","pic_small": "http://musicdata.baidu.com/data2/pic/115430825/115430825.jpg"},{"album_id": "183906","author": "周杰伦 ","hot": 10799,"title": "<em>七里香</em>(台湾正式版)","artist_id": "29","all_artist_id": "29","company": "杰威尔JVR音乐有限公司","publishtime": "2004-08-03","album_desc": "周杰伦的新专辑在8月3日正式发行,这次引用了诗人席幕蓉名诗《<em>七里香</em>》作为新专辑名称,周杰伦以往每一次的专辑名称都给了歌迷许多想象空间,也给了大家许多惊叹号。这次也许并不令人惊喜。但是周杰伦自有说法:“...","pic_small": "http://c.hiphotos.baidu.com/ting/pic/item/b8389b504fc2d562b542b1f8e51190ef76c66c58.jpg"}]}
}

}

三. 获取专辑详情:

GET

http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=5.6.5.0&method=baidu.ting.album.getAlbumInfo&format=json&album_id=67909

参数:

from  android
version   5.6.5.0
method    baidu.ting.album.getAlbumInfo
format    json
album_id  67909

返回:

{
"albumInfo": {"album_id": "67909","author": "周杰伦","title": "七里香","publishcompany": "杰威尔JVR音乐有限公司","prodcompany": "","country": "港台","language": "国语","songs_total": "9","info": "周杰伦的新专辑在8月3日正式发行,这次引用了诗人席幕蓉名诗《七里香》作为新专辑名称,周杰伦以往每一次的专辑名称都给了歌迷许多想象空间,也给了大家许多惊叹号。这次也许并不令人惊喜。但是周杰伦自有说法:“之所以要把新专辑定名为《七里香》,是因为对这一次专辑的音乐充满自信,希望大家能把注意力焦点放在音乐上,将话题回归到音乐上。 这张《七里香》仍是周杰伦与最佳拍档方文山合作的作品。在炎热的夏天听《七里香》,有一种如沐清风的凉爽","styles": "流行","style_id": "3","publishtime": "2004-08-03","artist_ting_uid": "7994","all_artist_ting_uid": null,"gender": "0","area": "1","pic_small": "http://musicdata.baidu.com/data2/pic/115430825/115430825.jpg","pic_big": "http://musicdata.baidu.com/data2/pic/115430815/115430815.jpg","hot": "","favorites_num": null,"recommend_num": null,"artist_id": "29","all_artist_id": "29","pic_radio": "http://musicdata.baidu.com/data2/pic/115430799/115430799.jpg","pic_s500": "http://musicdata.baidu.com/data2/pic/115430794/115430794.jpg","pic_s1000": "http://musicdata.baidu.com/data2/pic/115430787/115430787.jpg"
},
"songlist": [{"artist_id": "29","all_artist_id": "29","all_artist_ting_uid": "7994","language": "国语","publishtime": "2004-08-03","album_no": "0","versions": "","pic_big": "http://musicdata.baidu.com/data2/pic/115430815/115430815.jpg","pic_small": "http://musicdata.baidu.com/data2/pic/115430825/115430825.jpg","hot": "1020","file_duration": "261","del_status": "0","resource_type": "2","copy_type": "1","has_mv_mobile": 0,"all_rate": "320,128,256,64,flac,24,192","toneid": "600902000006889316","country": "其他","area": "4","lrclink": "http://musicdata.baidu.com/data2/lrc/34239973/%E5%80%9F%E5%8F%A3..lrc","song_id": "23744596","title": "借口.","ting_uid": "7994","author": "周杰伦","album_id": "67909","album_title": "","is_first_publish": 0,"havehigh": 2,"charge": 0,"has_mv": 1,"learn": 1,"song_source": "web","piao_id": "0","korean_bb_song": "0","resource_type_ext": "0"},{"artist_id": "29","all_artist_id": "29","all_artist_ting_uid": "7994","language": "国语","publishtime": "2004-08-03","album_no": "1","versions": "","pic_big": "http://musicdata.baidu.com/data2/pic/115430815/115430815.jpg","pic_small": "http://musicdata.baidu.com/data2/pic/115430825/115430825.jpg","hot": "3005","file_duration": "246","del_status": "0","resource_type": "2","copy_type": "1","has_mv_mobile": 1,"all_rate": "64,320,128,flac,256,192,24","toneid": "600902000006889292","country": "其他","area": "4","lrclink": "http://musicdata.baidu.com/data2/lrc/13859215/%E6%88%91%E7%9A%84%E5%9C%B0%E7%9B%98-.lrc","song_id": "271627","title": "我的地盘-","ting_uid": "7994","author": "周杰伦","album_id": "67909","album_title": "","is_first_publish": 0,"havehigh": 2,"charge": 0,"has_mv": 1,"learn": 1,"song_source": "web","piao_id": "0","korean_bb_song": "0","resource_type_ext": "0"},......
]

}

下面的只发简要说明:

1). 获取歌曲列表:

http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=5.6.5.0&method=baidu.ting.artist.getSongList&format=json&order=2&tinguid=7994&artistid=7994&offset=0&limits=50

2). 获取专辑列表:

http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=5.6.5.0&method=baidu.ting.artist.getAlbumList&format=json&order=1&tinguid=7994&offset=0&limits=30

3). 获取歌手信息:

http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=5.6.5.0&method=baidu.ting.artist.getinfo&format=json&tinguid=7994&artistid=7994

4). 获取歌词以及图片:

http://tingapi.ting.baidu.com/v1/restserver/ting?from=android&version=5.6.5.0&method=baidu.ting.search.lrcpic&format=json&query=Apollo%27s%2BTriumph%2B%28Paul%2BDinletir%2BRemix%29$$Audio%2BMachine&ts=1444316027469&e=6Wwvzqnijq08Nrv0qI%2BN3Thp9GuKdV82ZxAS3UrvifMc%2FoVWLyZ8dSolFUF5r4W3SB2tm4z5TWT95sihhOG7qeqvjhThJWnh6h745kRGSTI%3D&type=2

百度音乐API抓取-Fiddler相关推荐

  1. 利用百度地图api抓取POI点(上海公交站)

    1.功能描述 百度地图api抓取POI点(上海公交站) 2.代码 import pandas as pd import requests import json import numpy as npi ...

  2. 教你用百度地图API抓取建筑物周边位置、房价信息(附代码)

    来源:大数据挖掘DT数据分析 本文共2465字,建议阅读5分钟. 本文为大家解读怎样用脚本与百度API的交互,爬取百度地图的数据. 需求描述 对于数据挖掘工程师来说,有时候需要抓取地理位置信息,比如统 ...

  3. 【Python】 调用百度地图API抓取西安市小区信息

    前面有同学参加市场调查大赛,需要西安市的小区信息数据,一个小爬虫程序完美解决. 百度地图开放平台 详情访问:百度PlaceAPI 这里用到了矩形区域检索,具体参数说明如下: 调取详情 所需库: imp ...

  4. python爬去百度音乐_Python抓取百度音乐。

    今天挑战下百度音乐抓取,先用Chrome分析下请求的链接. 最关键的就是这个链接 http://play.baidu.com/data/music/songlink 请求这个带上songid就能返回给 ...

  5. Android 酷我音乐API抓取

    以下内容仅供学习 最近想要做app获取音乐,但音乐一直本地获取,过于局限,于是想到网络获取音乐,但网上大多api接口失效,于是查找音乐网页版多个查询,不失所望,获取到酷我音乐一部分: 首先我们找到了获 ...

  6. [Linux C]百度音乐API实现在线搜歌

    最近在做科大讯飞的语音解析模块,主要用于语音控制播放.采集语音输入后,送给科大讯飞语音的SDK,云服务器返回JSON的数据,再解析拿到URL地址,最后送给播放器去播放.不知是否是尚未上线的produc ...

  7. 简单介绍使用Nginx限制百度蜘蛛频繁抓取的问题

    这篇文章主要介绍了使用Nginx限制百度蜘蛛频繁抓取的问题,百度蜘蛛对网站的抓取频率高和抓取量骤增导致服务器负载高,经常收到警告信息,每分钟允许百度蜘蛛抓取200次,超过频率限制的返回503,对Ngi ...

  8. Vue实现仿音乐播放器11-实现访问百度音乐API实现播放音乐功能

    场景 从今日推荐页面点击某首歌曲会将这首歌曲的songid通过路由传递到播放界面, 播放界面调用百度音乐接口实现数据的获取以及音乐的播放. 效果 实现 配置路由 首先在pages目录下新建musicp ...

  9. Vue实现仿音乐播放器5-实现今日推荐访问百度音乐API获取数据

    前文 前面已经实现了音乐导航菜单的切换,现在要实现主页面的今日推荐功能. 效果 实现 实现首页重定向 当应用初始化时,默认进入主页面home页,所以在router下的index.js下配置: expo ...

最新文章

  1. 量子力学在计算机上的应用,量子力学在医学科学中的应用
  2. PostgreSQL连接池pgbouncer的使用
  3. JavaScript 流程控制语句
  4. 《构建之法》阅读笔记01
  5. java时间戳龙_Java时间戳与日期格式字符串的互转
  6. linux中快速清空文件内容的方法
  7. 饥饿的时候我想起的小食
  8. Redis(RedisTemplate)运算、算法(incr、decr、increment)
  9. android扫描局域网打印机,Android 浅谈同一局域网下使用WiFi连接打印机
  10. signature=e7411d00c74ac359f20083a015dc6ea9,MS12-020:遠端桌面的弱點可能會允許遠端程式碼執行:2012 年 3 月 13 日...
  11. 如何用PHP完整的开发一个网站?
  12. think python 第9章 case study:word play
  13. JavaSE + bluecove 蓝牙连接
  14. Perl中的单行注释和多行注释
  15. string头文件函数
  16. du 查看文件大小命令
  17. C++UML类图的关系
  18. 爬虫之使用正则提取数据
  19. 痛苦的对接体验——软工第一次结对作业
  20. iOS 优化资源文件

热门文章

  1. 数学之美:GOOGLE新闻归类算法与余弦定理
  2. 国产安路FPGA 替代
  3. 字节流之文件输入流FileInputStream(上)
  4. MATLAB中resample函数使用
  5. java程序cpu突然飚高_高频面试题:Java程序占用 CPU 过高怎么排查
  6. web网站验证码自动识别
  7. 【漏洞学习——越权】Mtime时光网越权查看订单
  8. Matlab实现K-Means聚类算法
  9. 无广告,小体积,实用性拉满的5款软件
  10. UCOSIII+机智云协议的移植笔记