提交 44bb25e8 编写于 作者: B binaryify

v4.0.7,#1151 #1152 #1143 #1161

上级 d1907ae5
# 更新日志 # 更新日志
### 4.0.7 | 2021.2.27
- 更新红心接口,修复红心接口460错误问题 [#1151](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1151)
- 更新发送验证码接口
- 注册接口添加 countrycode 参数 [#1152](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1152)
- 新增绑定手机接口 [#1152](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1152)
- 更新 song/detail 接口 [#1143](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1143)
- 用户粉丝接口修改分页参数 [#1161](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1161)
### 4.0.6 | 2021.2.20 ### 4.0.6 | 2021.2.20
- 修复 eapi 接口无法正确解密response的问题 [#1138](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1138) - 修复 eapi 接口无法正确解密response的问题 [#1138](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1138)
......
...@@ -304,6 +304,7 @@ banner({ type:0 }).then(res=>{ ...@@ -304,6 +304,7 @@ banner({ type:0 }).then(res=>{
200. 话题详情 200. 话题详情
201. 话题详情热门动态 201. 话题详情热门动态
202. 歌单详情动态 202. 歌单详情动态
203. 绑定手机
## 更新日志 ## 更新日志
......
...@@ -218,6 +218,7 @@ ...@@ -218,6 +218,7 @@
200. 话题详情 200. 话题详情
201. 话题详情热门动态 201. 话题详情热门动态
202. 歌单详情动态 202. 歌单详情动态
203. 绑定手机
## 安装 ## 安装
...@@ -478,8 +479,6 @@ v3.30.0后支持手动传入cookie,登录接口返回内容新增 `cookie` 字 ...@@ -478,8 +479,6 @@ v3.30.0后支持手动传入cookie,登录接口返回内容新增 `cookie` 字
**调用例子 :** `/captcha/sent?phone=13xxx` **调用例子 :** `/captcha/sent?phone=13xxx`
### 验证验证码 ### 验证验证码
说明 : 调用此接口 ,传入手机号码和验证码, 可校验验证码是否正确 说明 : 调用此接口 ,传入手机号码和验证码, 可校验验证码是否正确
...@@ -511,16 +510,22 @@ v3.30.0后支持手动传入cookie,登录接口返回内容新增 `cookie` 字 ...@@ -511,16 +510,22 @@ v3.30.0后支持手动传入cookie,登录接口返回内容新增 `cookie` 字
`nickname`: 昵称 `nickname`: 昵称
**可选参数 :**
`countrycode`: 国家码,用于国外手机号,例如美国传入:`1` ,默认86即中国
**接口地址 :** `/register/cellphone` **接口地址 :** `/register/cellphone`
**调用例子 :** `/register/cellphone?phone=13xxx&password=xxxxx&captcha=1234&nickname=binary1345` **调用例子 :** `/register/cellphone?phone=13xxx&password=xxxxx&captcha=1234&nickname=binary1345`
### 检测手机号码是否已注册 ### 检测手机号码是否已注册
说明 : 调用此接口 ,可检测手机号码是否已注册 说明 : 调用此接口 ,可检测手机号码是否已注册
**必选参数 :** **必选参数 :**
`phone` : 手机号码 `phone` : 手机号码
**可选参数 :**
`countrycode`: 国家码,用于国外手机号,例如美国传入:`1` **可选参数 :**
`countrycode`: 国家码,用于国外手机号,例如美国传入:`1` ,默认86即中国
**接口地址 :** `/cellphone/existence/check` **接口地址 :** `/cellphone/existence/check`
**调用例子 :** `/cellphone/existence/check?phone=13xxx` **调用例子 :** `/cellphone/existence/check?phone=13xxx`
...@@ -834,14 +839,14 @@ tags: 歌单标签 ...@@ -834,14 +839,14 @@ tags: 歌单标签
**必选参数 :** `uid` : 用户 id **必选参数 :** `uid` : 用户 id
**可选参数 :** `limit` : 返回数量 , 默认为 30 **可选参数 :**
`limit` : 返回数量 , 默认为 30
`lasttime` : 返回数据的 `lasttime` ,默认-1,传入上一次返回结果的 lasttime,将会返回下一页的数据
`offset` : 偏移数量,用于分页 ,如 :( 页数 -1)\*30, 其中 30 为 limit 的值 , 默认为 0
**接口地址 :** `/user/followeds` **接口地址 :** `/user/followeds`
**调用例子 :** `/user/followeds?uid=32953014` `/user/followeds?uid=416608258&time=1560152549136` **调用例子 :** `/user/followeds?uid=32953014` `/user/followeds?uid=416608258&limit=1` `/user/followeds?uid=416608258&limit=1&offset=1`
### 获取用户动态 ### 获取用户动态
......
...@@ -264,19 +264,22 @@ export function batch( ...@@ -264,19 +264,22 @@ export function batch(
): Promise<Response> ): Promise<Response>
export function captcha_sent( export function captcha_sent(
params: { cellphone: string; ctcode?: string } & RequestBaseConfig, params: { cellphone: string; ctcode?: number | string } & RequestBaseConfig,
): Promise<Response> ): Promise<Response>
export function captcha_verify( export function captcha_verify(
params: { params: {
ctcode?: string ctcode?: number | string
cellphone: string cellphone: number | string
captcha: string captcha: string
} & RequestBaseConfig, } & RequestBaseConfig,
): Promise<Response> ): Promise<Response>
export function cellphone_existence_check( export function cellphone_existence_check(
params: { cellphone: string; countrycode: string } & RequestBaseConfig, params: {
cellphone: number | string
countrycode: number | string
} & RequestBaseConfig,
): Promise<Response> ): Promise<Response>
export function check_music( export function check_music(
...@@ -674,16 +677,16 @@ export function login( ...@@ -674,16 +677,16 @@ export function login(
export function login_cellphone( export function login_cellphone(
params: { params: {
phone: string phone: number | string
countrycode?: string countrycode?: number | string
password: string password: string
} & RequestBaseConfig, } & RequestBaseConfig,
): Promise<Response> ): Promise<Response>
export function login_cellphone( export function login_cellphone(
params: { params: {
phone: string phone: number | string
countrycode?: string countrycode?: number | string
md5_password: string md5_password: string
} & RequestBaseConfig, } & RequestBaseConfig,
): Promise<Response> ): Promise<Response>
...@@ -903,7 +906,7 @@ export function rebind( ...@@ -903,7 +906,7 @@ export function rebind(
captcha: string captcha: string
phone: string phone: string
oldcaptcha: string oldcaptcha: string
ctcode?: string ctcode?: number | string
} & RequestBaseConfig, } & RequestBaseConfig,
): Promise<Response> ): Promise<Response>
...@@ -1393,3 +1396,12 @@ export function login_qr_check( ...@@ -1393,3 +1396,12 @@ export function login_qr_check(
export function playlist_detail_dynamic( export function playlist_detail_dynamic(
params: { id: string | number } & RequestBaseConfig, params: { id: string | number } & RequestBaseConfig,
): Promise<Response> ): Promise<Response>
export function user_bindingcellphone(
params: {
phone: number | string
captcha: number | string
countrycode?: number | string
password?: string
} & RequestBaseConfig,
): Promise<Response>
...@@ -5,7 +5,7 @@ module.exports = (query, request) => { ...@@ -5,7 +5,7 @@ module.exports = (query, request) => {
ctcode: query.ctcode || '86', ctcode: query.ctcode || '86',
cellphone: query.phone, cellphone: query.phone,
} }
return request('POST', `https://music.163.com/weapi/sms/captcha/sent`, data, { return request('POST', `https://music.163.com/api/sms/captcha/sent`, data, {
crypto: 'weapi', crypto: 'weapi',
cookie: query.cookie, cookie: query.cookie,
proxy: query.proxy, proxy: query.proxy,
......
...@@ -8,6 +8,7 @@ module.exports = (query, request) => { ...@@ -8,6 +8,7 @@ module.exports = (query, request) => {
phone: query.phone, phone: query.phone,
password: crypto.createHash('md5').update(query.password).digest('hex'), password: crypto.createHash('md5').update(query.password).digest('hex'),
nickname: query.nickname, nickname: query.nickname,
countrycode: query.countrycode || '86',
} }
return request('POST', `https://music.163.com/api/register/cellphone`, data, { return request('POST', `https://music.163.com/api/register/cellphone`, data, {
crypto: 'weapi', crypto: 'weapi',
......
...@@ -3,8 +3,7 @@ ...@@ -3,8 +3,7 @@
module.exports = (query, request) => { module.exports = (query, request) => {
query.ids = query.ids.split(/\s*,\s*/) query.ids = query.ids.split(/\s*,\s*/)
const data = { const data = {
c: '[' + query.ids.map((id) => '{"id":' + id + '}').join(',') + ']', c: '[' + query.ids.map((id) => '{"id":' + id + '}').join(',') + ']'
ids: '[' + query.ids.join(',') + ']',
} }
return request('POST', `https://music.163.com/weapi/v3/song/detail`, data, { return request('POST', `https://music.163.com/weapi/v3/song/detail`, data, {
crypto: 'weapi', crypto: 'weapi',
......
module.exports = (query, request) => {
const data = {
phone: query.phone,
countrycode: query.countrycode || '86',
captcha: query.captcha,
password: query.password
? crypto.createHash('md5').update(query.password).digest('hex')
: '',
}
return request(
'POST',
`https://music.163.com/api/user/bindingCellphone`,
data,
{
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
},
)
}
...@@ -3,8 +3,10 @@ ...@@ -3,8 +3,10 @@
module.exports = (query, request) => { module.exports = (query, request) => {
const data = { const data = {
userId: query.uid, userId: query.uid,
time: query.lasttime || -1, time: '0',
limit: query.limit || 30, limit: query.limit || 30,
offset: query.offset || 0,
getcounts: 'true',
} }
return request( return request(
'POST', 'POST',
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册