Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
m0_57517058
NeteaseCloudMusicApi
提交
0baed1a6
N
NeteaseCloudMusicApi
项目概览
m0_57517058
/
NeteaseCloudMusicApi
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
N
NeteaseCloudMusicApi
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
0baed1a6
编写于
4月 20, 2017
作者:
B
binaryify
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加歌单(网友精选碟),新碟上架,热门歌手等接口,更新文档,版本更新到2.4.0
上级
0911a5b6
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
154 addition
and
13 deletion
+154
-13
CHANGELOG.MD
CHANGELOG.MD
+3
-0
README.MD
README.MD
+4
-0
app.js
app.js
+10
-1
docs/README.md
docs/README.md
+67
-5
package.json
package.json
+1
-1
router/fm_trash.js
router/fm_trash.js
+1
-1
router/like.js
router/like.js
+1
-1
router/new_albums.js
router/new_albums.js
+19
-0
router/playlistDetail.js
router/playlistDetail.js
+2
-2
router/songDetail.js
router/songDetail.js
+1
-2
router/top_artists.js
router/top_artists.js
+19
-0
router/top_playlist.js
router/top_playlist.js
+26
-0
未找到文件。
CHANGELOG.MD
浏览文件 @
0baed1a6
# 更新日志
### 2.4.0 | 2017.4.20
增加歌单(网友精选碟),新碟上架,热门歌手等接口,更新文档
### 2.3.4 | 2017.4.20
增加歌曲详情接口,更新文档
...
...
README.MD
浏览文件 @
0baed1a6
...
...
@@ -14,6 +14,9 @@
[
darknessomi/musicbox
](
https://github.com/darknessomi/musicbox
)
## 版本新特性
### 2.4.0 | 2017.4.20
增加歌单(网友精选碟),新碟上架,热门歌手等接口,更新文档
### 2.3.4 | 2017.4.20
增加歌曲详情接口,更新文档
...
...
@@ -45,6 +48,7 @@
13.
把私人 FM 的歌曲移动至垃圾桶
14.
签到
15.
各排行榜
16.
歌曲详情
## 环境要求
需要 NodeJS 6.0+ 环境
...
...
app.js
浏览文件 @
0baed1a6
...
...
@@ -23,7 +23,16 @@ app.use('/lyric', require('./router/lyric'))
// 获取专辑
app
.
use
(
'
/album
'
,
require
(
'
./router/album
'
))
// 获取歌单
// 歌单(网友精选碟) hot||new http://music.163.com/#/discover/playlist/
app
.
use
(
'
/top_playlist
'
,
require
(
'
./router/top_playlist
'
))
// 新碟上架 http://music.163.com/#/discover/album/
app
.
use
(
'
/new_albums
'
,
require
(
'
./router/new_albums
'
))
// 热门歌手 http://music.163.com/#/discover/artist/
app
.
use
(
'
/top_artists
'
,
require
(
'
./router/top_artists
'
))
// 获取用户歌单
app
.
use
(
'
/user/playlist
'
,
require
(
'
./router/userPlaylist
'
))
// 获取歌单内列表
...
...
docs/README.md
浏览文件 @
0baed1a6
...
...
@@ -11,6 +11,9 @@
跨站请求伪造 (CSRF), 伪造请求头,调用官方 API
## 版本新特性
Version 2.4.0
增加歌单(网友精选碟),新碟上架,热门歌手等接口,更新文档
Version 2.3.4
增加歌曲详情接口,更新文档
...
...
@@ -37,6 +40,9 @@ Version 2.2.0
14.
签到
15.
各排行榜
16.
歌曲详情
17.
歌单(网友精选碟)
18.
新碟上架
19.
热门歌手
## 安装
```
shell
...
...
@@ -159,7 +165,7 @@ $ set PORT=4000 && node app.js
1000: 歌单
1002: 用户
`offset`
: 偏移数量,用于分页,如: 如:(评论页数-1)
*
30, 其中 30 为 limit 的值
`offset`
: 偏移数量,用于分页,如: 如:(评论页数-1)
*
30, 其中 30 为 limit 的值
,默认为0
**接口地址:**
`/search`
...
...
@@ -299,10 +305,10 @@ $ set PORT=4000 && node app.js
### 喜欢音乐
说明:调用此接口,传入音乐 id, 可喜欢该音乐
**必选参数:**
`
id`
: 歌曲 id
`id`
: 歌曲 id
**可选参数:**
`
like`
:
布尔值,默认为 true 即喜欢,若传 false, 则取消喜欢
`
like`
:
布尔值,默认为 true 即喜欢,若传 false, 则取消喜欢
**接口地址:**
`/like`
...
...
@@ -324,7 +330,7 @@ $ set PORT=4000 && node app.js
说明:调用此接口,传入音乐 id, 可把该音乐从私人 FM中移除至垃圾桶
**必选参数:**
`
id`
: 歌曲 id
`id`
: 歌曲 id
**接口地址:**
`/fm_trash`
...
...
@@ -336,11 +342,67 @@ $ set PORT=4000 && node app.js
![
移除成功
](
https://raw.githubusercontent.com/Binaryify/NeteaseCloudMusicApi/master/static/fm_trash.png
)
### 歌单(网友精选碟)
说明:调用此接口,可获取网友精选碟歌单
**可选参数:**
`limit`
: 取出数量,默认为50
`offset`
: 偏移数量,用于分页,如:(评论页数-1)
*
20, 其中 20 为 limit 的值,默认为0
`order`
: 可选值为 'new' 和 'hot',分别对应最新和最热,默认为 'hot'
**接口地址:**
`/top_playlist`
**调用例子:**
`/top_playlist?limit=10&order=new`
返回数据如下图:
![
精选碟
](
https://raw.githubusercontent.com/Binaryify/NeteaseCloudMusicApi/master/static/top_playlist.png
)
### 新碟上架
说明:调用此接口,可获取新碟上架数据
**可选参数:**
`limit`
: 取出数量,默认为50
`offset`
: 偏移数量,用于分页,如:(评论页数-1)
*
50, 其中 50 为 limit 的值,默认为0
**接口地址:**
`/new_albums`
**调用例子:**
`/new_albums?offset=0&limit=30`
返回数据如下图:
![
新碟上架
](
https://raw.githubusercontent.com/Binaryify/NeteaseCloudMusicApi/master/static/new_albums.png
)
### 热门歌手
说明:调用此接口,可获取热门歌手数据
**可选参数:**
`limit`
: 取出数量,默认为50
`offset`
: 偏移数量,用于分页,如:(评论页数-1)
*
50, 其中 50 为 limit 的值,默认为0
**接口地址:**
`/top_artists`
**调用例子:**
`/top_artists?offset=0&limit=30`
返回数据如下图:
![
热门歌手
](
https://raw.githubusercontent.com/Binaryify/NeteaseCloudMusicApi/master/static/top_artists.png
)
### 排行榜
说明:调用此接口,传入数字 idx, 可获取不同排行榜
**必选参数:**
`
idx`
: 对象 key, 对应以下排行榜
`idx`
: 对象 key, 对应以下排行榜
```
"0": 云音乐新歌榜,
...
...
package.json
浏览文件 @
0baed1a6
{
"name"
:
"NeteaseCloudMusicApi"
,
"version"
:
"2.
3.4
"
,
"version"
:
"2.
4.0
"
,
"description"
:
"网易云音乐 NodeJS 版 API"
,
"scripts"
:
{
"start"
:
"node app.js"
,
...
...
router/fm_trash.js
浏览文件 @
0baed1a6
...
...
@@ -12,7 +12,7 @@ router.get("/", (req, res) => {
const
time
=
req
.
query
.
time
||
25
createWebAPIRequest
(
'
music.163.com
'
,
`
http://music.163.com
/api/radio/trash/add?alg=
${
alg
}
&songId=
${
songid
}
&time=
${
time
}
`
,
`/api/radio/trash/add?alg=
${
alg
}
&songId=
${
songid
}
&time=
${
time
}
`
,
'
POST
'
,
data
,
cookie
,
...
...
router/like.js
浏览文件 @
0baed1a6
...
...
@@ -13,7 +13,7 @@ router.get("/", (req, res) => {
const
time
=
req
.
query
.
time
||
25
createWebAPIRequest
(
'
music.163.com
'
,
`
http://music.163.com
/api/radio/like?alg=
${
alg
}
&trackId=
${
trackId
}
&like=
${
like
}
&time=
${
time
}
`
,
`/api/radio/like?alg=
${
alg
}
&trackId=
${
trackId
}
&like=
${
like
}
&time=
${
time
}
`
,
'
POST
'
,
data
,
cookie
,
...
...
router/new_albums.js
0 → 100644
浏览文件 @
0baed1a6
const
express
=
require
(
"
express
"
)
const
router
=
express
()
const
{
createRequest
}
=
require
(
"
../util/util
"
)
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
const
offset
=
req
.
query
.
offset
||
0
const
limit
=
req
.
query
.
limit
||
50
createRequest
(
`/api/album/new?area=ALL&offset=
${
offset
}
&total=true&limit=
${
limit
}
`
,
'
GET
'
,
null
)
.
then
(
result
=>
{
res
.
setHeader
(
"
Content-Type
"
,
"
application/json
"
)
res
.
send
(
result
)
})
.
catch
(
err
=>
{
res
.
status
(
502
).
send
(
'
fetch error
'
)
})
})
module
.
exports
=
router
\ No newline at end of file
router/playlistDetail.js
浏览文件 @
0baed1a6
...
...
@@ -21,12 +21,12 @@ router.get("/", (req, res) => {
'
POST
'
,
data
,
cookie
,
music_req
=>
{
music_req
=>
{
console
.
log
(
music_req
)
detail
=
music_req
mergeRes
()
},
err
=>
{
err
=>
{
res
.
status
(
502
).
send
(
'
fetch error
'
)
}
)
...
...
router/songDetail.js
浏览文件 @
0baed1a6
...
...
@@ -4,8 +4,7 @@ const { createRequest } = require("../util/util")
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
const
ids
=
req
.
query
.
ids
console
.
log
(
ids
)
createRequest
(
`http://music.163.com/api/song/detail?ids=%5B
${
ids
}
%5D`
,
'
GET
'
,
null
)
createRequest
(
`/api/song/detail?ids=%5B
${
ids
}
%5D`
,
'
GET
'
,
null
)
.
then
(
result
=>
{
res
.
setHeader
(
"
Content-Type
"
,
"
application/json
"
)
res
.
send
(
result
)
...
...
router/top_artists.js
0 → 100644
浏览文件 @
0baed1a6
const
express
=
require
(
"
express
"
)
const
router
=
express
()
const
{
createRequest
}
=
require
(
"
../util/util
"
)
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
const
offset
=
req
.
query
.
offset
||
0
const
limit
=
req
.
query
.
limit
||
50
createRequest
(
`/api/artist/top?offset=
${
offset
}
&total=false&limit=
${
limit
}
`
,
'
GET
'
,
null
)
.
then
(
result
=>
{
res
.
setHeader
(
"
Content-Type
"
,
"
application/json
"
)
res
.
send
(
result
)
})
.
catch
(
err
=>
{
res
.
status
(
502
).
send
(
'
fetch error
'
)
})
})
module
.
exports
=
router
\ No newline at end of file
router/top_playlist.js
0 → 100644
浏览文件 @
0baed1a6
const
express
=
require
(
"
express
"
)
const
router
=
express
()
const
{
createWebAPIRequest
}
=
require
(
"
../util/util
"
)
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
const
cookie
=
req
.
get
(
'
Cookie
'
)
?
req
.
get
(
'
Cookie
'
)
:
''
// order可为 'hot' 可为 'new'
const
data
=
{
cat
:
req
.
query
.
cat
||
"
全部
"
,
order
:
req
.
query
.
order
||
"
hot
"
,
offset
:
req
.
query
.
offset
||
0
,
total
:
req
.
query
.
offset
?
'
true
'
:
'
false
'
,
limit
:
req
.
query
.
limit
||
50
}
createWebAPIRequest
(
'
music.163.com
'
,
'
/api/playlist/list
'
,
'
POST
'
,
data
,
cookie
,
music_req
=>
res
.
send
(
music_req
),
err
=>
res
.
status
(
502
).
send
(
'
fetch error
'
)
)
})
module
.
exports
=
router
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录