forked from ginuerzh/gofm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
API.txt
174 lines (152 loc) · 3.49 KB
/
API.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
douban.fm API
Host: douban.fm
I. 歌曲列表
GET /j/mine/playlist
e.g.
http://douban.fm/j/mine/playlist?type=n&sid=1382855&pt=11.7&channel=1&from=radio&r=411ef8fc02
短报告:目前仅type=e使用,返回json数据: "ok"
长报告:返回歌曲列表json数据,并更新当前的列表
type:
• b: bypass, 不再播放,长报告 (required: channel, sid)
• e: end, 歌曲播放完毕,短报告 (required: channel, sid)
• n: new, 返回新播放列表,长报告 (required: channel)
• p: playing, 单首歌曲播放开始且播放列表已空时发送,长报告 (required: channel, sid)
• s: skip, 下一首,长报告 (required: channel, sid)
• u: unlike, 将sid的歌曲取消喜欢,长报告 (required: channel, sid)
• r: rate, 红心标记,长报告 (required: channel, sid)
sid:
Song ID
pt:
past time (play time)
channel:
0: 私人频道, 1: 华语, 2: 欧美, 3: 七零, 4: 八零, 5: 九零, 6: 粤语, 7: 摇滚, 8: 民谣,
9: 轻音乐, 10: 电影原声, 13: 爵士, 14: 电子, 15: 说唱, 16: R&B, 17: 日语, 18: 韩语,
19: Puma, 20: 女生, 22: 法语, 26: 豆瓣音乐人, 30: BMW
from:
目前遇到两个值:radio(chrome plugin), mainsite(douban.fm)
r:
random, 随机数 10位十六进制随机数 e.g. f01136feac
* 返回json数据格式
{
"r": 0,
"song": [
{
"picture": "http://... .jpg",
"albumtitle": "...",
"adtype": 3
"company": "EMI",
"rating_avg": 4.34821,
"public_time": "2001",
"ssid": "ed88",
"album": "/subject/1404531/",
"songlists_count": 201,
"like": 1,
"artist": "...",
"url": "http://... .mp3",
"title": "...",
"sha256": "",
"kbps": "64",
"subtype": "...", (广告的值为"T", 其他的为"")
"length": 211, (持续时间)
"sid": "462880",
"aid": "1404531"
},
...
]
}
* type=e
"ok"
* err
{
"r": 1,
"err": "err msg"
}
II. 频道列表
GET /j/app/radio/channels
* 返回json数据格式
{
"channels":[
{
"name_en": "Personal Radio",
"seq_id": 0,
"abbr_en": "",
"name": "私人兆赫",
"channel_id": 0, // int or string
},
...
]
}
III. 登录
1. 获取captcha id
GET /j/new_captcha
* 返回数据
"uyr9x8XRok8qyJYys1cNGXNB:en"
2. 获取captcha图片
GET /misc/captcha?size=m&id=uyr9x8XRok8qyJYys1cNGXNB:en
3. 登录
POST /j/login
请求参数(application/x-www-form-urlencoded)
source=radio
alias=ginuerzh@gmail.com
form_password=***
captcha_solution=broken
captcha_id=uyr9x8XRok8qyJYys1cNGXNB:en
task=sync_channel_list
* 返回json数据格式
{
"r": 0,
"user_info":{
"ck": "COHi",
"id": "35586494",
"is_dj": false,
"is_new_user": 0,
"is_pro": false,
"name": "Gerry",
"play_record":{
"banned": 10,
"fav_chls_count": 5,
"liked": 305,
"played": 3660
},
"third_party_info": null,
"uid": "ginuerzh",
"url": "http://www.douban.com/people/ginuerzh/"
}
}
4. 获取个人频道
GET /j/explore/get_login_chls?uk=35586494
* 返回json数据格式
{
"data":{
"res":{
"fav_chls":[
{
"song_to_start":"",
"intro":"为你推荐 李健 以及相似的艺术家",
"name":"李健 系",
"song_num":0,
"creator":{
"url":"http://site.douban.com/douban.fm/",
"name":"豆瓣FM",
"id":1
},
"collected": "false",
"banner": "http://XXX.jpg",
"cover": "http://XXX.jpg",
"id": 28250,
"hot_songs":["窗台","青春再见","温暖"]
},
...
],
"rec_chls":[
{
"song_to_start":"".
"intro":"",
"name":"",
...
},
...
]
}
}
}