Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
嗯菜
NeteaseCloudMusicApi
提交
a91bae2e
N
NeteaseCloudMusicApi
项目概览
嗯菜
/
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,发现更多精彩内容 >>
提交
a91bae2e
编写于
8月 17, 2017
作者:
B
binaryify
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
增加缓存机制
上级
2bccab0e
变更
20
展开全部
隐藏空白更改
内联
并排
Showing
20 changed file
with
281 addition
and
461 deletion
+281
-461
app.js
app.js
+49
-45
package-lock.json
package-lock.json
+78
-265
package.json
package.json
+1
-0
router/simi_playlist.js
router/simi_playlist.js
+4
-4
router/simi_song.js
router/simi_song.js
+4
-4
router/song_detail.js
router/song_detail.js
+7
-7
router/top_album.js
router/top_album.js
+9
-10
router/top_artists.js
router/top_artists.js
+10
-7
router/top_list.js
router/top_list.js
+27
-28
router/top_mv.js
router/top_mv.js
+9
-11
router/top_playlist.js
router/top_playlist.js
+6
-6
router/top_playlist_highquality.js
router/top_playlist_highquality.js
+5
-5
router/top_songs.js
router/top_songs.js
+9
-10
router/user_detail.js
router/user_detail.js
+6
-6
router/user_dj.js
router/user_dj.js
+8
-8
router/user_playlist.js
router/user_playlist.js
+8
-8
router/user_playrecord.js
router/user_playrecord.js
+6
-8
router/user_subcount.js
router/user_subcount.js
+5
-5
util/crypto.js
util/crypto.js
+23
-22
util/util.js
util/util.js
+7
-2
未找到文件。
app.js
浏览文件 @
a91bae2e
const
express
=
require
(
'
express
'
)
const
http
=
require
(
'
http
'
)
const
apicache
=
require
(
'
apicache
'
)
const
app
=
express
()
let
cache
=
apicache
.
middleware
// 跨域设置
// app.all('*', function (req, res, next) {
...
...
@@ -13,7 +16,9 @@ const app = express()
// next()
// })
app
.
use
(
express
.
static
(
'
public
'
));
app
.
use
(
cache
(
'
5 minutes
'
))
app
.
use
(
express
.
static
(
'
public
'
))
// 获取专辑内容
app
.
use
(
'
/album
'
,
require
(
'
./router/album
'
))
...
...
@@ -25,24 +30,20 @@ app.use('/artists', require('./router/artists'))
app
.
use
(
'
/artist/album
'
,
require
(
'
./router/artist_album
'
))
//艺术家-信息
app
.
use
(
"
/artist/desc
"
,
require
(
"
./router/artists_desc
"
))
app
.
use
(
'
/artist/desc
'
,
require
(
'
./router/artists_desc
'
))
//艺术家-mv
app
.
use
(
"
/artist/mv
"
,
require
(
"
./router/artists_mv
"
))
app
.
use
(
'
/artist/mv
'
,
require
(
'
./router/artists_mv
'
))
// 获取 banner
app
.
use
(
'
/banner
'
,
require
(
'
./router/banner
'
))
app
.
use
(
'
/check/music
'
,
require
(
'
./router/check_music
'
))
app
.
use
(
'
/comment/music
'
,
require
(
'
./router/comment_music
'
))
app
.
use
(
'
/comment/mv
'
,
require
(
'
./router/comment_mv
'
))
app
.
use
(
'
/comment/album
'
,
require
(
'
./router/comment_album
'
))
app
.
use
(
'
/comment/playlist
'
,
require
(
'
./router/comment_playlist
'
))
...
...
@@ -53,40 +54,40 @@ app.use('/comment/like', require('./router/comment_like'))
app
.
use
(
'
/comment/dj
'
,
require
(
'
./router/comment_dj
'
))
//签到
app
.
use
(
"
/daily_signin
"
,
require
(
"
./router/daily_signin
"
))
app
.
use
(
'
/daily_signin
'
,
require
(
'
./router/daily_signin
'
))
//djradio detail
app
.
use
(
"
/dj/detail
"
,
require
(
"
./router/dj_detail
"
))
app
.
use
(
'
/dj/detail
'
,
require
(
'
./router/dj_detail
'
))
//dj主播 radio
app
.
use
(
"
/dj/program
"
,
require
(
"
./router/dj_program
"
))
app
.
use
(
'
/dj/program
'
,
require
(
'
./router/dj_program
'
))
app
.
use
(
"
/dj/program/detail
"
,
require
(
"
./router/dj_program_detail
"
))
app
.
use
(
'
/dj/program/detail
'
,
require
(
'
./router/dj_program_detail
'
))
app
.
use
(
"
/dj/sub
"
,
require
(
"
./router/dj_sub
"
))
app
.
use
(
'
/dj/sub
'
,
require
(
'
./router/dj_sub
'
))
app
.
use
(
"
/dj/catelist
"
,
require
(
"
./router/dj_catelist
"
))
app
.
use
(
'
/dj/catelist
'
,
require
(
'
./router/dj_catelist
'
))
app
.
use
(
"
/dj/hot
"
,
require
(
"
./router/dj_hot
"
))
app
.
use
(
'
/dj/hot
'
,
require
(
'
./router/dj_hot
'
))
// 精选电台
app
.
use
(
"
/dj/recommend
"
,
require
(
"
./router/dj_recommend
"
))
app
.
use
(
'
/dj/recommend
'
,
require
(
'
./router/dj_recommend
'
))
//精选电台-分类电台
app
.
use
(
"
/dj/recommend/type
"
,
require
(
"
./router/dj_recommend_type
"
))
app
.
use
(
'
/dj/recommend/type
'
,
require
(
'
./router/dj_recommend_type
'
))
//获取动态
app
.
use
(
"
/event
"
,
require
(
"
./router/event
"
))
app
.
use
(
'
/event
'
,
require
(
'
./router/event
'
))
//垃圾桶
app
.
use
(
"
/fm_trash
"
,
require
(
"
./router/fm_trash
"
))
app
.
use
(
'
/fm_trash
'
,
require
(
'
./router/fm_trash
'
))
app
.
use
(
"
/follow
"
,
require
(
"
./router/follow
"
))
app
.
use
(
'
/follow
'
,
require
(
'
./router/follow
'
))
// 喜欢歌曲
app
.
use
(
"
/like
"
,
require
(
"
./router/like
"
))
app
.
use
(
'
/like
'
,
require
(
'
./router/like
'
))
app
.
use
(
"
/likelist
"
,
require
(
"
./router/likelist
"
))
app
.
use
(
'
/likelist
'
,
require
(
'
./router/likelist
'
))
//手机登录
app
.
use
(
'
/login/cellphone
'
,
require
(
'
./router/loginCellphone
'
))
...
...
@@ -107,31 +108,34 @@ app.use('/lyric', require('./router/lyric'))
app
.
use
(
'
/music/url
'
,
require
(
'
./router/musicUrl
'
))
//最新 mv
app
.
use
(
"
/mv/first
"
,
require
(
"
./router/mv_first
"
))
app
.
use
(
'
/mv/first
'
,
require
(
'
./router/mv_first
'
))
//播放 mv
app
.
use
(
"
/mv/url
"
,
require
(
"
./router/mv_url
"
))
app
.
use
(
'
/mv/url
'
,
require
(
'
./router/mv_url
'
))
//mv
app
.
use
(
"
/mv
"
,
require
(
"
./router/mv
"
))
app
.
use
(
'
/mv
'
,
require
(
'
./router/mv
'
))
// 私人 FM
app
.
use
(
"
/personal_fm
"
,
require
(
"
./router/personal_fm
"
))
app
.
use
(
'
/personal_fm
'
,
require
(
'
./router/personal_fm
'
))
//推荐歌单
app
.
use
(
"
/personalized
"
,
require
(
"
./router/personalized
"
))
app
.
use
(
'
/personalized
'
,
require
(
'
./router/personalized
'
))
//推荐dj
app
.
use
(
"
/personalized/djprogram
"
,
require
(
"
./router/personalized_djprogram
"
))
app
.
use
(
'
/personalized/djprogram
'
,
require
(
'
./router/personalized_djprogram
'
))
//推荐新音乐
app
.
use
(
"
/personalized/newsong
"
,
require
(
"
./router/personalized_newsong
"
))
app
.
use
(
'
/personalized/newsong
'
,
require
(
'
./router/personalized_newsong
'
))
//独家放送
app
.
use
(
"
/personalized/privatecontent
"
,
require
(
"
./router/personalized_privatecontent
"
))
app
.
use
(
'
/personalized/privatecontent
'
,
require
(
'
./router/personalized_privatecontent
'
)
)
//推荐mv
app
.
use
(
"
/personalized/mv
"
,
require
(
"
./router/personalized_mv
"
))
app
.
use
(
'
/personalized/mv
'
,
require
(
'
./router/personalized_mv
'
))
// 获取歌单内列表
app
.
use
(
'
/playlist/detail
'
,
require
(
'
./router/playlist_detail
'
))
...
...
@@ -144,7 +148,7 @@ app.use('/playlist/hot', require('./router/playlist_hot'))
app
.
use
(
'
/playlist/catlist
'
,
require
(
'
./router/playlist_catlist
'
))
//推荐节目
app
.
use
(
"
/program/recommend
"
,
require
(
"
./router/program_recommend
"
))
app
.
use
(
'
/program/recommend
'
,
require
(
'
./router/program_recommend
'
))
// 获取每日推荐歌曲
app
.
use
(
'
/recommend/songs
'
,
require
(
'
./router/recommend_songs
'
))
...
...
@@ -155,7 +159,6 @@ app.use('/recommend/resource', require('./router/recommend_resource'))
//取消推荐
app
.
use
(
'
/recommend/dislike
'
,
require
(
'
./router/recommend_dislike
'
))
app
.
use
(
'
/resource/like
'
,
require
(
'
./router/resource_like
'
))
// 搜索
...
...
@@ -171,19 +174,19 @@ app.use('/search/multimatch', require('./router/search_multimatch'))
app
.
use
(
'
/search/suggest
'
,
require
(
'
./router/search_suggest
'
))
//simi ,相似歌单
app
.
use
(
"
/simi/playlist
"
,
require
(
"
./router/simi_playlist
"
))
app
.
use
(
'
/simi/playlist
'
,
require
(
'
./router/simi_playlist
'
))
//simi ,相似歌曲
app
.
use
(
"
/simi/song
"
,
require
(
"
./router/simi_song
"
))
app
.
use
(
'
/simi/song
'
,
require
(
'
./router/simi_song
'
))
//相似 mv
app
.
use
(
"
/simi/mv
"
,
require
(
"
./router/simi_mv
"
))
app
.
use
(
'
/simi/mv
'
,
require
(
'
./router/simi_mv
'
))
//simi ,相似关注的用户
app
.
use
(
"
/simi/user
"
,
require
(
"
./router/simi_user
"
))
app
.
use
(
'
/simi/user
'
,
require
(
'
./router/simi_user
'
))
//相似歌手
app
.
use
(
"
/simi/artist
"
,
require
(
"
./router/simi_artists
"
))
app
.
use
(
'
/simi/artist
'
,
require
(
'
./router/simi_artists
'
))
// 获取音乐详情
app
.
use
(
'
/song/detail
'
,
require
(
'
./router/song_detail
'
))
...
...
@@ -199,10 +202,13 @@ app.use('/top/list', require('./router/top_list'))
app
.
use
(
'
/top/mv
'
,
require
(
'
./router/top_mv
'
))
//分类歌单
app
.
use
(
"
/top/playlist
"
,
require
(
"
./router/top_playlist
"
))
app
.
use
(
'
/top/playlist
'
,
require
(
'
./router/top_playlist
'
))
//精品歌单
app
.
use
(
"
/top/playlist/highquality
"
,
require
(
"
./router/top_playlist_highquality
"
))
app
.
use
(
'
/top/playlist/highquality
'
,
require
(
'
./router/top_playlist_highquality
'
)
)
app
.
use
(
'
/top/song
'
,
require
(
'
./router/top_songs
'
))
...
...
@@ -219,12 +225,12 @@ app.use('/user/playlist', require('./router/user_playlist'))
app
.
use
(
'
/user/audio
'
,
require
(
'
./router/user_audio
'
))
//云盘数据
app
.
use
(
"
/user/cloud
"
,
require
(
"
./router/user_cloud
"
))
app
.
use
(
'
/user/cloud
'
,
require
(
'
./router/user_cloud
'
))
//云盘数据详情? 暂时不要使用
app
.
use
(
"
/user/cloud/search
"
,
require
(
"
./router/user_cloud_search
"
))
app
.
use
(
'
/user/cloud/search
'
,
require
(
'
./router/user_cloud_search
'
))
//用户动态
app
.
use
(
"
/user/event
"
,
require
(
"
./router/user_event
"
))
app
.
use
(
'
/user/event
'
,
require
(
'
./router/user_event
'
))
app
.
use
(
'
/user/detail
'
,
require
(
'
./router/user_detail
'
))
...
...
@@ -236,9 +242,7 @@ app.use('/user/follows', require('./router/user_follows'))
app
.
use
(
'
/user/subcount
'
,
require
(
'
./router/user_subcount
'
))
app
.
use
(
"
/user/record
"
,
require
(
"
./router/user_playrecord
"
))
app
.
use
(
'
/user/record
'
,
require
(
'
./router/user_playrecord
'
))
const
port
=
process
.
env
.
PORT
||
3000
...
...
package-lock.json
浏览文件 @
a91bae2e
此差异已折叠。
点击以展开。
package.json
浏览文件 @
a91bae2e
...
...
@@ -15,6 +15,7 @@
"author"
:
""
,
"license"
:
"
MIT
"
,
"dependencies"
:
{
"
apicache
"
:
"
^0.9.0
"
,
"
big-integer
"
:
"
^1.6.17
"
,
"
express
"
:
"
^4.15.2
"
,
"
request
"
:
"
^2.81.0
"
...
...
router/simi_playlist.js
浏览文件 @
a91bae2e
const
express
=
require
(
"
express
"
)
const
express
=
require
(
'
express
'
)
const
router
=
express
()
const
{
createWebAPIRequest
}
=
require
(
"
../util/util
"
)
const
{
createWebAPIRequest
}
=
require
(
'
../util/util
'
)
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
router
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
const
cookie
=
req
.
get
(
'
Cookie
'
)
?
req
.
get
(
'
Cookie
'
)
:
''
const
data
=
{
songid
:
req
.
query
.
id
,
...
...
@@ -22,4 +22,4 @@ router.get("/", (req, res) => {
)
})
module
.
exports
=
router
\ No newline at end of file
module
.
exports
=
router
router/simi_song.js
浏览文件 @
a91bae2e
const
express
=
require
(
"
express
"
)
const
express
=
require
(
'
express
'
)
const
router
=
express
()
const
{
createWebAPIRequest
}
=
require
(
"
../util/util
"
)
const
{
createWebAPIRequest
}
=
require
(
'
../util/util
'
)
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
router
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
const
cookie
=
req
.
get
(
'
Cookie
'
)
?
req
.
get
(
'
Cookie
'
)
:
''
const
data
=
{
songid
:
req
.
query
.
id
,
...
...
@@ -22,4 +22,4 @@ router.get("/", (req, res) => {
)
})
module
.
exports
=
router
\ No newline at end of file
module
.
exports
=
router
router/song_detail.js
浏览文件 @
a91bae2e
const
express
=
require
(
"
express
"
)
const
express
=
require
(
'
express
'
)
const
router
=
express
()
const
{
createWebAPIRequest
}
=
require
(
"
../util/util
"
)
const
{
createWebAPIRequest
}
=
require
(
'
../util/util
'
)
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
router
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
const
cookie
=
req
.
get
(
'
Cookie
'
)
?
req
.
get
(
'
Cookie
'
)
:
''
const
id
=
parseInt
(
req
.
query
.
ids
)
const
data
=
{
// "id": id,
'
c
'
:
JSON
.
stringify
([{
id
:
id
}]),
"
ids
"
:
'
[
'
+
id
+
'
]
'
,
"
csrf_token
"
:
""
c
:
JSON
.
stringify
([{
id
:
id
}]),
ids
:
'
[
'
+
id
+
'
]
'
,
csrf_token
:
''
}
console
.
log
(
data
)
createWebAPIRequest
(
...
...
@@ -25,4 +25,4 @@ router.get("/", (req, res) => {
)
})
module
.
exports
=
router
\ No newline at end of file
module
.
exports
=
router
router/top_album.js
浏览文件 @
a91bae2e
//最新mv
const
express
=
require
(
"
express
"
)
const
express
=
require
(
'
express
'
)
const
router
=
express
()
const
{
createWebAPIRequest
}
=
require
(
"
../util/util
"
)
const
{
createWebAPIRequest
}
=
require
(
'
../util/util
'
)
// type ALL, ZH,EA,KR,JP
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
router
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
const
cookie
=
req
.
get
(
'
Cookie
'
)
?
req
.
get
(
'
Cookie
'
)
:
''
const
data
=
{
'
offset
'
:
req
.
query
.
offset
,
'
total
'
:
true
,
'
limit
'
:
req
.
query
.
limit
,
'
area
'
:
req
.
query
.
type
,
"
csrf_token
"
:
""
offset
:
req
.
query
.
offset
,
total
:
true
,
limit
:
req
.
query
.
limit
,
area
:
req
.
query
.
type
,
csrf_token
:
''
}
createWebAPIRequest
(
'
music.163.com
'
,
...
...
@@ -26,5 +26,4 @@ router.get("/", (req, res) => {
)
})
module
.
exports
=
router
\ No newline at end of file
module
.
exports
=
router
router/top_artists.js
浏览文件 @
a91bae2e
const
express
=
require
(
"
express
"
)
const
express
=
require
(
'
express
'
)
const
router
=
express
()
const
{
createRequest
}
=
require
(
"
../util/util
"
)
const
{
createRequest
}
=
require
(
'
../util/util
'
)
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
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
)
createRequest
(
`/api/artist/top?offset=
${
offset
}
&total=false&limit=
${
limit
}
`
,
'
GET
'
,
null
)
.
then
(
result
=>
{
res
.
setHeader
(
"
Content-Type
"
,
"
application/json
"
)
res
.
setHeader
(
'
Content-Type
'
,
'
application/json
'
)
res
.
send
(
result
)
})
.
catch
(
err
=>
{
...
...
@@ -15,5 +19,4 @@ router.get("/", (req, res) => {
})
})
module
.
exports
=
router
\ No newline at end of file
module
.
exports
=
router
router/top_list.js
浏览文件 @
a91bae2e
const
top_list_all
=
{
"
0
"
:
[
'
云音乐新歌榜
'
,
'
/api/playlist/detail?id=3779629
'
],
"
1
"
:
[
'
云音乐热歌榜
'
,
'
/api/playlist/detail?id=3778678
'
],
"
2
"
:
[
'
网易原创歌曲榜
'
,
'
/api/playlist/detail?id=2884035
'
],
"
3
"
:
[
'
云音乐飙升榜
'
,
'
/api/playlist/detail?id=19723756
'
],
"
4
"
:
[
'
云音乐电音榜
'
,
'
/api/playlist/detail?id=10520166
'
],
"
5
"
:
[
'
UK排行榜周榜
'
,
'
/api/playlist/detail?id=180106
'
],
"
6
"
:
[
'
美国Billboard周榜
'
,
'
/api/playlist/detail?id=60198
'
],
"
7
"
:
[
'
KTV嗨榜
'
,
'
/api/playlist/detail?id=21845217
'
],
"
8
"
:
[
'
iTunes榜
'
,
'
/api/playlist/detail?id=11641012
'
],
"
9
"
:
[
'
Hit FM Top榜
'
,
'
/api/playlist/detail?id=120001
'
],
"
10
"
:
[
'
日本Oricon周榜
'
,
'
/api/playlist/detail?id=60131
'
],
"
11
"
:
[
'
韩国Melon排行榜周榜
'
,
'
/api/playlist/detail?id=3733003
'
],
"
12
"
:
[
'
韩国Mnet排行榜周榜
'
,
'
/api/playlist/detail?id=60255
'
],
"
13
"
:
[
'
韩国Melon原声周榜
'
,
'
/api/playlist/detail?id=46772709
'
],
"
14
"
:
[
'
中国TOP排行榜(港台榜)
'
,
'
/api/playlist/detail?id=112504
'
],
"
15
"
:
[
'
中国TOP排行榜(内地榜)
'
,
'
/api/playlist/detail?id=64016
'
],
"
16
"
:
[
'
香港电台中文歌曲龙虎榜
'
,
'
/api/playlist/detail?id=10169002
'
],
"
17
"
:
[
'
华语金曲榜
'
,
'
/api/playlist/detail?id=4395559
'
],
"
18
"
:
[
'
中国嘻哈榜
'
,
'
/api/playlist/detail?id=1899724
'
],
"
19
"
:
[
'
法国 NRJ EuroHot 30周榜
'
,
'
/api/playlist/detail?id=27135204
'
],
"
20
"
:
[
'
台湾Hito排行榜
'
,
'
/api/playlist/detail?id=112463
'
],
"
21
"
:
[
'
Beatport全球电子舞曲榜
'
,
'
/api/playlist/detail?id=3812895
'
]
'
0
'
:
[
'
云音乐新歌榜
'
,
'
/api/playlist/detail?id=3779629
'
],
'
1
'
:
[
'
云音乐热歌榜
'
,
'
/api/playlist/detail?id=3778678
'
],
'
2
'
:
[
'
网易原创歌曲榜
'
,
'
/api/playlist/detail?id=2884035
'
],
'
3
'
:
[
'
云音乐飙升榜
'
,
'
/api/playlist/detail?id=19723756
'
],
'
4
'
:
[
'
云音乐电音榜
'
,
'
/api/playlist/detail?id=10520166
'
],
'
5
'
:
[
'
UK排行榜周榜
'
,
'
/api/playlist/detail?id=180106
'
],
'
6
'
:
[
'
美国Billboard周榜
'
,
'
/api/playlist/detail?id=60198
'
],
'
7
'
:
[
'
KTV嗨榜
'
,
'
/api/playlist/detail?id=21845217
'
],
'
8
'
:
[
'
iTunes榜
'
,
'
/api/playlist/detail?id=11641012
'
],
'
9
'
:
[
'
Hit FM Top榜
'
,
'
/api/playlist/detail?id=120001
'
],
'
10
'
:
[
'
日本Oricon周榜
'
,
'
/api/playlist/detail?id=60131
'
],
'
11
'
:
[
'
韩国Melon排行榜周榜
'
,
'
/api/playlist/detail?id=3733003
'
],
'
12
'
:
[
'
韩国Mnet排行榜周榜
'
,
'
/api/playlist/detail?id=60255
'
],
'
13
'
:
[
'
韩国Melon原声周榜
'
,
'
/api/playlist/detail?id=46772709
'
],
'
14
'
:
[
'
中国TOP排行榜(港台榜)
'
,
'
/api/playlist/detail?id=112504
'
],
'
15
'
:
[
'
中国TOP排行榜(内地榜)
'
,
'
/api/playlist/detail?id=64016
'
],
'
16
'
:
[
'
香港电台中文歌曲龙虎榜
'
,
'
/api/playlist/detail?id=10169002
'
],
'
17
'
:
[
'
华语金曲榜
'
,
'
/api/playlist/detail?id=4395559
'
],
'
18
'
:
[
'
中国嘻哈榜
'
,
'
/api/playlist/detail?id=1899724
'
],
'
19
'
:
[
'
法国 NRJ EuroHot 30周榜
'
,
'
/api/playlist/detail?id=27135204
'
],
'
20
'
:
[
'
台湾Hito排行榜
'
,
'
/api/playlist/detail?id=112463
'
],
'
21
'
:
[
'
Beatport全球电子舞曲榜
'
,
'
/api/playlist/detail?id=3812895
'
]
}
const
express
=
require
(
"
express
"
)
const
express
=
require
(
'
express
'
)
const
router
=
express
()
const
{
createRequest
}
=
require
(
"
../util/util
"
)
const
{
createRequest
}
=
require
(
'
../util/util
'
)
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
router
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
const
idx
=
req
.
query
.
idx
const
action
=
'
http://music.163.com
'
+
top_list_all
[
idx
][
1
]
createRequest
(
`
${
action
}
`
,
'
GET
'
,
null
)
.
then
(
result
=>
{
res
.
setHeader
(
"
Content-Type
"
,
"
application/json
"
)
res
.
setHeader
(
'
Content-Type
'
,
'
application/json
'
)
res
.
send
(
result
)
})
.
catch
(
err
=>
{
...
...
@@ -39,5 +39,4 @@ router.get("/", (req, res) => {
})
})
module
.
exports
=
router
\ No newline at end of file
module
.
exports
=
router
router/top_mv.js
浏览文件 @
a91bae2e
const
express
=
require
(
"
express
"
)
const
express
=
require
(
'
express
'
)
const
router
=
express
()
const
{
createWebAPIRequest
}
=
require
(
"
../util/util
"
)
const
{
createWebAPIRequest
}
=
require
(
'
../util/util
'
)
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
router
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
const
cookie
=
req
.
get
(
'
Cookie
'
)
?
req
.
get
(
'
Cookie
'
)
:
''
const
data
=
{
'
offset
'
:
req
.
query
.
offset
||
0
,
'
total
'
:
true
,
'
limit
'
:
req
.
query
.
limit
||
30
,
"
csrf_token
"
:
""
offset
:
req
.
query
.
offset
||
0
,
total
:
true
,
limit
:
req
.
query
.
limit
||
30
,
csrf_token
:
''
}
createWebAPIRequest
(
...
...
@@ -18,13 +18,11 @@ router.get("/", (req, res) => {
data
,
cookie
,
music_req
=>
{
res
.
setHeader
(
"
Content-Type
"
,
"
application/json
"
)
res
.
setHeader
(
'
Content-Type
'
,
'
application/json
'
)
res
.
send
(
music_req
)
},
err
=>
res
.
status
(
502
).
send
(
'
fetch error
'
)
)
})
module
.
exports
=
router
\ No newline at end of file
module
.
exports
=
router
router/top_playlist.js
浏览文件 @
a91bae2e
//分类歌单
const
express
=
require
(
"
express
"
)
const
express
=
require
(
'
express
'
)
const
router
=
express
()
const
{
createWebAPIRequest
}
=
require
(
"
../util/util
"
)
const
{
createWebAPIRequest
}
=
require
(
'
../util/util
'
)
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
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
"
,
cat
:
req
.
query
.
cat
||
'
全部
'
,
order
:
req
.
query
.
order
||
'
hot
'
,
offset
:
req
.
query
.
offset
||
0
,
total
:
req
.
query
.
total
?
'
true
'
:
'
false
'
,
limit
:
req
.
query
.
limit
||
50
...
...
@@ -26,4 +26,4 @@ router.get("/", (req, res) => {
)
})
module
.
exports
=
router
\ No newline at end of file
module
.
exports
=
router
router/top_playlist_highquality.js
浏览文件 @
a91bae2e
const
express
=
require
(
"
express
"
)
const
express
=
require
(
'
express
'
)
const
router
=
express
()
const
{
createWebAPIRequest
}
=
require
(
"
../util/util
"
)
const
{
createWebAPIRequest
}
=
require
(
'
../util/util
'
)
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
router
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
const
cookie
=
req
.
get
(
'
Cookie
'
)
?
req
.
get
(
'
Cookie
'
)
:
''
const
data
=
{
cat
:
req
.
query
.
cat
||
"
全部
"
,
cat
:
req
.
query
.
cat
||
'
全部
'
,
offset
:
req
.
query
.
offset
||
0
,
limit
:
req
.
query
.
limit
||
20
}
...
...
@@ -22,4 +22,4 @@ router.get("/", (req, res) => {
)
})
module
.
exports
=
router
\ No newline at end of file
module
.
exports
=
router
router/top_songs.js
浏览文件 @
a91bae2e
//新歌上架
const
express
=
require
(
"
express
"
)
const
express
=
require
(
'
express
'
)
const
router
=
express
()
const
{
createWebAPIRequest
}
=
require
(
"
../util/util
"
)
const
{
createWebAPIRequest
}
=
require
(
'
../util/util
'
)
// type ALL, ZH,EA,KR,JP
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
router
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
const
cookie
=
req
.
get
(
'
Cookie
'
)
?
req
.
get
(
'
Cookie
'
)
:
''
const
data
=
{
'
offset
'
:
request
.
query
.
offset
,
'
total
'
:
true
,
'
limit
'
:
request
.
query
.
limit
,
'
area
'
:
request
.
query
.
type
,
"
csrf_token
"
:
""
offset
:
request
.
query
.
offset
,
total
:
true
,
limit
:
request
.
query
.
limit
,
area
:
request
.
query
.
type
,
csrf_token
:
''
}
createWebAPIRequest
(
'
music.163.com
'
,
...
...
@@ -26,5 +26,4 @@ router.get("/", (req, res) => {
)
})
module
.
exports
=
router
\ No newline at end of file
module
.
exports
=
router
router/user_detail.js
浏览文件 @
a91bae2e
// 用户详情
const
express
=
require
(
"
express
"
)
const
express
=
require
(
'
express
'
)
const
router
=
express
()
const
{
createWebAPIRequest
}
=
require
(
"
../util/util
"
)
const
{
createWebAPIRequest
}
=
require
(
'
../util/util
'
)
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
router
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
const
cookie
=
req
.
get
(
'
Cookie
'
)
?
req
.
get
(
'
Cookie
'
)
:
''
const
id
=
req
.
query
.
uid
const
data
=
{
"
csrf_token
"
:
""
}
csrf_token
:
''
}
createWebAPIRequest
(
'
music.163.com
'
,
`/api/v1/user/detail/
${
id
}
`
,
...
...
@@ -22,4 +22,4 @@ router.get("/", (req, res) => {
)
})
module
.
exports
=
router
\ No newline at end of file
module
.
exports
=
router
router/user_dj.js
浏览文件 @
a91bae2e
// 用户电台
const
express
=
require
(
"
express
"
)
const
express
=
require
(
'
express
'
)
const
router
=
express
()
const
{
createWebAPIRequest
}
=
require
(
"
../util/util
"
)
const
{
createWebAPIRequest
}
=
require
(
'
../util/util
'
)
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
router
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
const
cookie
=
req
.
get
(
'
Cookie
'
)
?
req
.
get
(
'
Cookie
'
)
:
''
const
id
=
req
.
query
.
uid
const
data
=
{
'
offset
'
:
req
.
query
.
offset
||
'
0
'
,
'
limit
'
:
req
.
query
.
limit
||
30
,
"
csrf_token
"
:
""
}
offset
:
req
.
query
.
offset
||
'
0
'
,
limit
:
req
.
query
.
limit
||
30
,
csrf_token
:
''
}
createWebAPIRequest
(
'
music.163.com
'
,
`/weapi/dj/program/
${
id
}
`
,
...
...
@@ -24,4 +24,4 @@ router.get("/", (req, res) => {
)
})
module
.
exports
=
router
\ No newline at end of file
module
.
exports
=
router
router/user_playlist.js
浏览文件 @
a91bae2e
const
express
=
require
(
"
express
"
)
const
express
=
require
(
'
express
'
)
const
router
=
express
()
const
{
createWebAPIRequest
}
=
require
(
"
../util/util
"
)
const
{
createWebAPIRequest
}
=
require
(
'
../util/util
'
)
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
router
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
const
cookie
=
req
.
get
(
'
Cookie
'
)
?
req
.
get
(
'
Cookie
'
)
:
''
const
data
=
{
"
offset
"
:
0
,
"
uid
"
:
req
.
query
.
uid
,
"
limit
"
:
1000
,
"
csrf_token
"
:
""
offset
:
0
,
uid
:
req
.
query
.
uid
,
limit
:
1000
,
csrf_token
:
''
}
createWebAPIRequest
(
'
music.163.com
'
,
...
...
@@ -21,4 +21,4 @@ router.get("/", (req, res) => {
)
})
module
.
exports
=
router
\ No newline at end of file
module
.
exports
=
router
router/user_playrecord.js
浏览文件 @
a91bae2e
//播放记录
const
express
=
require
(
"
express
"
)
const
express
=
require
(
'
express
'
)
const
router
=
express
()
const
{
createWebAPIRequest
}
=
require
(
"
../util/util
"
)
const
{
createWebAPIRequest
}
=
require
(
'
../util/util
'
)
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
router
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
const
cookie
=
req
.
get
(
'
Cookie
'
)
?
req
.
get
(
'
Cookie
'
)
:
''
// type=1时只返回weekData, type=0时返回allData
const
data
=
{
'
type
'
:
req
.
query
.
type
||
0
,
type
:
req
.
query
.
type
||
0
,
uid
:
req
.
query
.
uid
,
//用户 id,
"
csrf_token
"
:
""
csrf_token
:
''
}
const
action
=
`/weapi/v1/play/record`
createWebAPIRequest
(
...
...
@@ -24,6 +24,4 @@ router.get("/", (req, res) => {
)
})
module
.
exports
=
router
\ No newline at end of file
module
.
exports
=
router
router/user_subcount.js
浏览文件 @
a91bae2e
const
express
=
require
(
"
express
"
)
const
express
=
require
(
'
express
'
)
const
router
=
express
()
const
{
createWebAPIRequest
}
=
require
(
"
../util/util
"
)
const
{
createWebAPIRequest
}
=
require
(
'
../util/util
'
)
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
router
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
const
cookie
=
req
.
get
(
'
Cookie
'
)
?
req
.
get
(
'
Cookie
'
)
:
''
const
data
=
{
"
csrf_token
"
:
""
csrf_token
:
''
}
createWebAPIRequest
(
'
music.163.com
'
,
...
...
@@ -18,4 +18,4 @@ router.get("/", (req, res) => {
)
})
module
.
exports
=
router
\ No newline at end of file
module
.
exports
=
router
util/crypto.js
浏览文件 @
a91bae2e
...
...
@@ -2,36 +2,37 @@
'
use strict
'
const
crypto
=
require
(
'
crypto
'
)
const
bigInt
=
require
(
'
big-integer
'
)
const
modulus
=
'
00e0b509f6259df8642dbc35662901477df22677ec152b5ff68ace615bb7b725152b3ab17a876aea8a5aa76d2e417629ec4ee341f56135fccf695280104e0312ecbda92557c93870114af6c9d05c4f7f0c3685b7a46bee255932575cce10b424d813cfe4875d3e82047b97ddef52741d546b8e289dc6935b3ece0462db0a22b8e7
'
const
modulus
=
'
00e0b509f6259df8642dbc35662901477df22677ec152b5ff68ace615bb7b725152b3ab17a876aea8a5aa76d2e417629ec4ee341f56135fccf695280104e0312ecbda92557c93870114af6c9d05c4f7f0c3685b7a46bee255932575cce10b424d813cfe4875d3e82047b97ddef52741d546b8e289dc6935b3ece0462db0a22b8e7
'
const
nonce
=
'
0CoJUm6Qyw8W8jud
'
const
pubKey
=
'
010001
'
String
.
prototype
.
hexEncode
=
function
(){
let
hex
,
i
String
.
prototype
.
hexEncode
=
function
()
{
let
hex
,
i
let
result
=
""
for
(
i
=
0
;
i
<
this
.
length
;
i
++
)
{
hex
=
this
.
charCodeAt
(
i
).
toString
(
16
)
result
+=
(
""
+
hex
).
slice
(
-
4
)
}
return
result
let
result
=
''
for
(
i
=
0
;
i
<
this
.
length
;
i
++
)
{
hex
=
this
.
charCodeAt
(
i
).
toString
(
16
)
result
+=
(
''
+
hex
).
slice
(
-
4
)
}
return
result
}
function
createSecretKey
(
size
)
{
const
keys
=
"
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
"
let
key
=
""
const
keys
=
'
abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789
'
let
key
=
''
for
(
let
i
=
0
;
i
<
size
;
i
++
)
{
let
pos
=
Math
.
random
()
*
keys
.
length
pos
=
Math
.
floor
(
pos
)
key
=
key
+
keys
.
charAt
(
pos
)
let
pos
=
Math
.
random
()
*
keys
.
length
pos
=
Math
.
floor
(
pos
)
key
=
key
+
keys
.
charAt
(
pos
)
}
return
key
}
function
aesEncrypt
(
text
,
secKey
)
{
const
_text
=
text
const
lv
=
new
Buffer
(
'
0102030405060708
'
,
"
binary
"
)
const
_secKey
=
new
Buffer
(
secKey
,
"
binary
"
)
const
lv
=
new
Buffer
(
'
0102030405060708
'
,
'
binary
'
)
const
_secKey
=
new
Buffer
(
secKey
,
'
binary
'
)
const
cipher
=
crypto
.
createCipheriv
(
'
AES-128-CBC
'
,
_secKey
,
lv
)
let
encrypted
=
cipher
.
update
(
_text
,
'
utf8
'
,
'
base64
'
)
encrypted
+=
cipher
.
final
(
'
base64
'
)
...
...
@@ -39,16 +40,16 @@ function aesEncrypt(text, secKey) {
}
function
zfill
(
str
,
size
)
{
while
(
str
.
length
<
size
)
str
=
"
0
"
+
str
return
str
while
(
str
.
length
<
size
)
str
=
'
0
'
+
str
return
str
}
function
rsaEncrypt
(
text
,
pubKey
,
modulus
)
{
const
_text
=
text
.
split
(
''
).
reverse
().
join
(
''
)
const
biText
=
bigInt
(
new
Buffer
(
_text
).
toString
(
'
hex
'
),
16
),
biEx
=
bigInt
(
pubKey
,
16
),
biMod
=
bigInt
(
modulus
,
16
),
biRet
=
biText
.
modPow
(
biEx
,
biMod
)
biEx
=
bigInt
(
pubKey
,
16
),
biMod
=
bigInt
(
modulus
,
16
),
biRet
=
biText
.
modPow
(
biEx
,
biMod
)
return
zfill
(
biRet
.
toString
(
16
),
256
)
}
...
...
@@ -63,4 +64,4 @@ function Encrypt(obj) {
}
}
module
.
exports
=
Encrypt
\ No newline at end of file
module
.
exports
=
Encrypt
util/util.js
浏览文件 @
a91bae2e
const
Encrypt
=
require
(
'
./crypto.js
'
)
const
http
=
require
(
'
http
'
)
const
querystring
=
require
(
'
querystring
'
)
function
randomUserAgent
()
{
const
userAgentList
=
[
'
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36
'
,
...
...
@@ -79,7 +81,10 @@ function createWebAPIRequest(
}
)
http_client
.
write
(
'
params=
'
+
cryptoreq
.
params
+
'
&encSecKey=
'
+
cryptoreq
.
encSecKey
querystring
.
stringify
({
params
:
cryptoreq
.
params
,
encSecKey
:
cryptoreq
.
encSecKey
})
)
http_client
.
end
()
}
...
...
@@ -121,4 +126,4 @@ function createRequest(path, method, data, callback, errorcallback) {
module
.
exports
=
{
createWebAPIRequest
,
createRequest
}
\ No newline at end of file
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录