-
Notifications
You must be signed in to change notification settings - Fork 2
Home
-
这里所列的api都是基于豆瓣FM客户端抓包而来, 这里只是拿出来作为学习研究, 不得用于商业行为...
-
豆瓣FM改版前的api整理, 我之前也是用的这里的,传送门
-
URL:
https://www.douban.com/service/auth2/token
-
Method:
POST
-
Arguments:
-
apikey
:02646d3fb69a52ff072d47bf23cef8fd
-
client_id
:02646d3fb69a52ff072d47bf23cef8fd
-
client_secret
:cde5d61429abcd7c
-
udid
:b88146214e19b8a8244c9bc0e2789da68955234d
-
douban_udid
:b635779c65b816b13b330b68921c0f8edc049590
-
device_id
:b88146214e19b8a8244c9bc0e2789da68955234d
-
grant_type
:password
-
redirect_uri
:http://www.douban.com/mobile/fm
-
username
:用户帐号
-
password
:明文密码
-
-
Header:
Content-Type: application/x-www-form-urlencoded
-
Response (
application/json
)
登录成功
{
"access_token": "21a0867e86f16fb464e1937b94d44f1w",
"douban_user_id": 145636941,
"douban_user_name": "xxxx",
"expires_in": 7775999,
"refresh_token": "77bc1538a652d3b867343fa9f2f87b18"
}
在获得access_token
和expire
后,保存起来,expire
应该是默认的90天的过期时间, 在使用获取歌曲列表、红心等API时,需要在相应的请求header里面添加Authorization
字段,对应的值是Bearer
+ access_token
, 注意Bearer
后面是有空格的,例如 Bearer 21a0867e86f16fb464e1937b94d44f1w
。
这个接口获取的频道列表是对应客户端上的第一个Tab。 测试
-
URL:
https://api.douban.com/v2/fm/app_channels
-
Method:
GET
-
Arguments:
-
alt
:json
-
app_name
:radio_iphone
-
apikey
:02646d3fb69a52ff072d47bf23cef8fd
-
client
:s:mobile|y:iOS 10.2|f:115|d:b88146214e19b8a8244c9bc0e2789da68955234d|e:iPhone7,1|m:appstore
-
client_id
:02646d3fb69a52ff072d47bf23cef8fd
-
icon_cate
:xlarge
-
udid
:b88146214e19b8a8244c9bc0e2789da68955234d
-
douban_udid
:b635779c65b816b13b330b68921c0f8edc049590
-
version
:115
-
-
Response (
application/json
):
{
"groups": [
{
"chls": [
{
"style": {
"display_text": "",
"bg_color": "0x499884",
"layout_type": 1,
"bg_image": ""
},
"intro": "我的个性化音乐频道",
"name": "我的私人",
"song_num": 0,
"collected": "disabled",
"cover": "https://img3.doubanio.com/f/fm/11bed977076d721fb66ef6c2f2cfb66ae79ed07a/pics/fm/default_personal_channel_cover.png",
"id": 0
}, {
"style": {
"bg_color": "0xe06b59",
"layout_type": 2,
"bg_image": ""
},
"intro": "豆瓣好评音乐精选",
"name": "豆瓣精选",
"collected": "disabled",
"cover": "https://img3.doubanio.com/f/fm/c1f6362114965225752341e9291a4b2f39f78cfb/pics/fm/channel_selected_cover.png",
"id": -10
}
],
"group_id": 0,
"group_name": ""
},
...
]
}
基本上是几个大分组,比如单曲
, 风格流派
, 语言年代
...
歌曲列表参数比较多, 登录与否主要看header的Authorization
字段,在我测试的时候发现和userid基本没有关系... 测试
-
URL:
https://api.douban.com/v2/fm/playlist
-
Method:
GET
-
Header:
//未登录的不填
-
Authorization
:Bearer 21a0867e86f16fb464e1937b94d44f1w
-
-
Arguments:
-
channel
:填写对应的channel id
-
from
:mainsite
-
pt
:0.0
-
kbps
:128
-
formats
:aac
-
alt
:json
-
app_name
:radio_iphone
-
apikey
:02646d3fb69a52ff072d47bf23cef8fd
-
client
:s:mobile|y:iOS 10.2|f:115|d:b88146214e19b8a8244c9bc0e2789da68955234d|e:iPhone7,1|m:appstore
-
client_id
:02646d3fb69a52ff072d47bf23cef8fd
-
icon_cate
:xlarge
-
udid
:b88146214e19b8a8244c9bc0e2789da68955234d
-
douban_udid
:b635779c65b816b13b330b68921c0f8edc049590
-
version
:115
-
-
Response (
application/json
):
{
"warning": "user_is_ananymous",
"r": 0,
"version_max": 116,
"is_show_quick_start": 0,
"song": [
{
"albumtitle": "The Princess Diaries 2: Royal Engagement",
"url": "http://mr3.doubanio.com/764cb746b8dfa264b39aa5513c8bc4fb/0/fm/song/p1439388_128k.mp4",
"file_ext": "mp4",
"album": "/subject/1765409/",
"ssid": "98c4",
"title": "Because You Live",
"sid": "1439388",
"sha256": "fd651e012a7c45bc5c9e582d06c88d44fdb845d6d2ae9b2515343e3eafb0e4a7",
"status": 0,
"picture": "http://img3.doubanio.com/lpic/s2837777.jpg",
"update_time": 1470126128,
"alert_msg": "",
"public_time": "2004",
"singers": [
{
"style": [],
"name": "Jesse McCartney",
"region": [
"美国"
],
"name_usual": "Jesse McCartney",
"genre": [
"Pop"
],
"avatar": "http://img7.doubanio.com/img/fmadmin/large/32852.jpg",
"related_site_id": 0,
"is_site_artist": false,
"id": "2558"
},
{
"style": [],
"name": "Various Artists",
"region": [
"欧美"
],
"name_usual": "Various Artists",
"genre": [
"Pop",
"Rock",
"Electronic"
],
"avatar": "http://img7.doubanio.com/img/fmadmin/large/2118995.jpg",
"related_site_id": 0,
"is_site_artist": false,
"id": "0"
}
],
"like": 0,
"artist": "Various Artists / Jesse McCartney",
"is_royal": false,
"subtype": "",
"length": 199,
"release": {
"link": "https://douban.fm/album/1765409gb789",
"id": "1765409",
"ssid": "b789"
},
"aid": "1765409",
"kbps": "128"
},
...
]
}
列出来的返回字段可能不全,建议点击测试
直接看结果。