NeteaseCloudMusicApi
Advanced tools
Comparing version 2.17.0 to 2.18.0
# 更新日志 | ||
### 2.18.0 | 2018.08.29 | ||
新增获取视频数据接口,完善文档 #301,感谢 @izhenyuls | ||
### 2.17.0 | 2018.08.28 | ||
@@ -3,0 +6,0 @@ 新增登录状态查询接口 #302 ,完善文档,完善路由注册 #297 |
{ | ||
"name": "NeteaseCloudMusicApi", | ||
"version": "2.17.0", | ||
"version": "2.18.0", | ||
"description": "网易云音乐 NodeJS 版 API", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -95,2 +95,5 @@ # 网易云音乐 API | ||
72. 付费精选接口 | ||
73. 音乐是否可用检查接口 | ||
74. 登录状态 | ||
75. 获取视频数据 | ||
@@ -97,0 +100,0 @@ ## 环境要求 |
// 搜索 | ||
module.exports = (req, res, createWebAPIRequest, request) => { | ||
const cookie = req.get("Cookie") ? req.get("Cookie") : ""; | ||
const keywords = req.query.keywords; | ||
const type = req.query.type || 1; | ||
const limit = req.query.limit || 30; | ||
const offset = req.query.offset || 0; | ||
// *(type)* 搜索单曲(1),歌手(100),专辑(10),歌单(1000),用户(1002) | ||
const cookie = req.get('Cookie') ? req.get('Cookie') : '' | ||
const keywords = req.query.keywords | ||
const type = req.query.type || 1 | ||
const limit = req.query.limit || 30 | ||
const offset = req.query.offset || 0 | ||
// *(type)* 搜索类型;默认为 1 即单曲 , 取值意义 : 1: 单曲, 10: 专辑, 100: 歌手, 1000: 歌单, 1002: 用户, 1004: MV, 1006: 歌词, 1009: 电台, 1014: 视频 | ||
const data = { | ||
csrf_token: "", | ||
csrf_token: '', | ||
limit, | ||
@@ -15,13 +15,13 @@ type, | ||
offset | ||
}; | ||
} | ||
createWebAPIRequest( | ||
"music.163.com", | ||
"/weapi/search/get", | ||
"POST", | ||
'music.163.com', | ||
'/weapi/search/get', | ||
'POST', | ||
data, | ||
cookie, | ||
music_req => res.send(music_req), | ||
err => res.status(502).send("fetch error") | ||
); | ||
}; | ||
err => res.status(502).send('fetch error') | ||
) | ||
} |
122325
117
2434
161