feat: 新增根据nickname获取userid 接口

This commit is contained in:
binaryify
2023-09-11 11:21:57 +08:00
parent c3dbccf52a
commit 00d3594814
6 changed files with 39 additions and 1 deletions

View File

@ -1,4 +1,6 @@
# 更新日志 # 更新日志
### 4.12.0 | 2023.09.10
- 补充 `get/userids`(根据nickname获取userid) 接口
### 4.12.0 | 2023.09.10 ### 4.12.0 | 2023.09.10
- 听歌识曲接口完善, 补充demo页面 - 听歌识曲接口完善, 补充demo页面

View File

@ -389,6 +389,14 @@ banner({ type:0 }).then(res=>{
250. 曲风-专辑 250. 曲风-专辑
251. 曲风-歌单 251. 曲风-歌单
252. 曲风-歌手 252. 曲风-歌手
253. 私信和通知接口
254. 回忆坐标
255. 播客搜索
256. 播客声音上传
257. 验证接口-二维码生成
258. 验证接口-二维码检测
259. 听歌识曲
260. 根据nickname获取userid接口
## 更新日志 ## 更新日志

View File

@ -275,6 +275,7 @@
257. 验证接口-二维码生成 257. 验证接口-二维码生成
258. 验证接口-二维码检测 258. 验证接口-二维码检测
259. 听歌识曲 259. 听歌识曲
260. 根据nickname获取userid接口
## 安装 ## 安装
@ -4257,6 +4258,16 @@ qrCodeStatus:20,detailReason:0 验证成功qrCodeStatus:21,detailReason:0 二
`audioFP`: 音频指纹,参考项目调用例子获取 `audioFP`: 音频指纹,参考项目调用例子获取
### 根据nickname获取userid
说明: 使用此接口,传入用户昵称,可获取对应的用户id,支持批量获取,多个昵称用`分号(;)`隔开
**必选参数:**
`nicknames`: 用户昵称,多个用分号(;)隔开
**接口地址:** `/user/nickname`
**调用例子:** `/get/userids?nicknames=binaryify` `/get/userids?nicknames=binaryify;binaryify2`
## 离线访问此文档 ## 离线访问此文档

6
interface.d.ts vendored
View File

@ -1789,3 +1789,9 @@ export function style_artist(
): Promise<Response> ): Promise<Response>
export function pl_count(params: RequestBaseConfig): Promise<Response> export function pl_count(params: RequestBaseConfig): Promise<Response>
export function get_userids(
params: {
nicknames: string
} & RequestBaseConfig,
): Promise<Response>

11
module/get_userids.js Normal file
View File

@ -0,0 +1,11 @@
module.exports = (query, request) => {
const data = {
nicknames: query.nicknames,
}
return request('POST', `https://music.163.com/api/user/getUserIds`, data, {
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
})
}

View File

@ -1,6 +1,6 @@
{ {
"name": "NeteaseCloudMusicApi", "name": "NeteaseCloudMusicApi",
"version": "4.12.0", "version": "4.12.1",
"description": "网易云音乐 NodeJS 版 API", "description": "网易云音乐 NodeJS 版 API",
"scripts": { "scripts": {
"start": "node app.js", "start": "node app.js",