Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
嘻哈兔来辽
NeteaseCloudMusicApi
提交
642d6f53
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,发现更多精彩内容 >>
提交
642d6f53
编写于
1月 12, 2018
作者:
B
binaryify
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
improve
上级
480b1696
变更
7
展开全部
显示空白变更内容
内联
并排
Showing
7 changed file
with
608 addition
and
654 deletion
+608
-654
CHANGELOG.MD
CHANGELOG.MD
+11
-2
app.js
app.js
+12
-11
docs/README.md
docs/README.md
+483
-576
public/test.html
public/test.html
+41
-0
router/loginCellphone.js
router/loginCellphone.js
+24
-24
router/playlist_detail.js
router/playlist_detail.js
+17
-24
router/user_playlist.js
router/user_playlist.js
+20
-17
未找到文件。
CHANGELOG.MD
浏览文件 @
642d6f53
# 更新日志
# 更新日志
### 2.8.3 | 2018.01.12
优化部分功能和文档
### 2.8.2 | 2018.01.05
增加 Dockerfile,支持以 Docker 容器模式运行
### 2.8.1 | 2018.01.04
### 2.8.1 | 2018.01.04
添加了
proxy
功能
添加了
proxy
功能
### 2.8.0 | 2018.01.04
### 2.8.0 | 2018.01.04
...
@@ -9,7 +18,7 @@
...
@@ -9,7 +18,7 @@
### 2.7.9 | 2017.12.11
### 2.7.9 | 2017.12.11
更新排行榜接口
,新增云音乐ACG音乐榜,
云音乐嘻哈榜
更新排行榜接口
, 新增云音乐 ACG 音乐榜 ,
云音乐嘻哈榜
### 2.7.7 | 2017.11.27
### 2.7.7 | 2017.11.27
...
...
app.js
浏览文件 @
642d6f53
...
@@ -6,17 +6,18 @@ const app = express();
...
@@ -6,17 +6,18 @@ const app = express();
let
cache
=
apicache
.
middleware
;
let
cache
=
apicache
.
middleware
;
// 跨域设置
// 跨域设置
// app.all('*', function (req, res, next) {
app
.
all
(
"
*
"
,
function
(
req
,
res
,
next
)
{
// if (req.path !== '/' && !req.path.includes('.')) {
if
(
req
.
path
!==
"
/
"
&&
!
req
.
path
.
includes
(
"
.
"
))
{
// res.header('Access-Control-Allow-Credentials', true)
res
.
header
(
"
Access-Control-Allow-Credentials
"
,
true
);
// // 这里获取 origin 请求头 而不是用 *
// 这里获取 origin 请求头 而不是用 *
// res.header('Access-Control-Allow-Origin', req.headers['origin'] || '*')
res
.
header
(
"
Access-Control-Allow-Origin
"
,
req
.
headers
[
"
origin
"
]
||
"
*
"
);
// res.header('Access-Control-Allow-Headers', 'X-Requested-With')
res
.
header
(
"
Access-Control-Allow-Headers
"
,
"
X-Requested-With
"
);
// res.header('Access-Control-Allow-Methods', 'PUT,POST,GET,DELETE,OPTIONS')
res
.
header
(
"
Access-Control-Allow-Methods
"
,
"
PUT,POST,GET,DELETE,OPTIONS
"
);
// res.header('Content-Type', 'application/json;charset=utf-8')
res
.
header
(
"
Content-Type
"
,
"
application/json;charset=utf-8
"
);
// }
}
// next()
next
();
// })
});
const
onlyStatus200
=
(
req
,
res
)
=>
res
.
statusCode
===
200
;
const
onlyStatus200
=
(
req
,
res
)
=>
res
.
statusCode
===
200
;
app
.
use
(
cache
(
"
2 minutes
"
,
onlyStatus200
));
app
.
use
(
cache
(
"
2 minutes
"
,
onlyStatus200
));
...
...
docs/README.md
浏览文件 @
642d6f53
此差异已折叠。
点击以展开。
public/test.html
0 → 100644
浏览文件 @
642d6f53
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1.0"
>
<meta
http-equiv=
"X-UA-Compatible"
content=
"ie=edge"
>
<title>
test
</title>
</head>
<body>
<script
src=
"https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"
></script>
<script>
$
.
ajax
({
url
:
"
http://localhost:3000/login/cellphone?phone=phone&password=password
"
,
xhrFields
:
{
withCredentials
:
true
},
success
:
function
(
data
)
{
console
.
log
(
data
)
$
.
ajax
({
url
:
"
http://localhost:3000/recommend/songs
"
,
xhrFields
:
{
withCredentials
:
true
},
success
:
function
(
data
)
{
console
.
log
(
data
)
},
error
:
function
(
err
)
{
console
.
log
(
err
)
}
})
},
error
:
function
(
err
)
{
console
.
log
(
err
)
}
})
</script>
</body>
</html>
\ No newline at end of file
router/loginCellphone.js
浏览文件 @
642d6f53
const
express
=
require
(
'
express
'
)
const
express
=
require
(
"
express
"
);
const
crypto
=
require
(
'
crypto
'
)
const
crypto
=
require
(
"
crypto
"
);
const
router
=
express
()
const
router
=
express
()
;
const
{
createWebAPIRequest
}
=
require
(
'
../util/util
'
)
const
{
createWebAPIRequest
}
=
require
(
"
../util/util
"
);
router
.
get
(
'
/
'
,
(
req
,
res
)
=>
{
router
.
get
(
"
/
"
,
(
req
,
res
)
=>
{
const
phone
=
req
.
query
.
phone
const
phone
=
req
.
query
.
phone
;
const
cookie
=
req
.
get
(
'
Cookie
'
)
?
req
.
get
(
'
Cookie
'
)
:
''
const
cookie
=
req
.
get
(
"
Cookie
"
)
?
req
.
get
(
"
Cookie
"
)
:
""
;
const
md5sum
=
crypto
.
createHash
(
'
md5
'
)
const
md5sum
=
crypto
.
createHash
(
"
md5
"
);
md5sum
.
update
(
req
.
query
.
password
)
md5sum
.
update
(
req
.
query
.
password
)
;
const
data
=
{
const
data
=
{
phone
:
phone
,
phone
:
phone
,
password
:
md5sum
.
digest
(
'
hex
'
),
password
:
md5sum
.
digest
(
"
hex
"
),
rememberLogin
:
'
true
'
rememberLogin
:
"
true
"
}
}
;
createWebAPIRequest
(
createWebAPIRequest
(
'
music.163.com
'
,
"
music.163.com
"
,
'
/weapi/login/cellphone
'
,
"
/weapi/login/cellphone
"
,
'
POST
'
,
"
POST
"
,
data
,
data
,
cookie
,
cookie
,
(
music_req
,
cookie
)
=>
{
(
music_req
,
cookie
)
=>
{
// console.log(music_req)
cookie
=
cookie
=
cookie
&&
cookie
.
map
(
x
=>
x
.
replace
(
"
Domain=.music.163.com
"
,
""
))
cookie
&&
cookie
.
map
(
x
=>
x
.
replace
(
"
Domain=.music.163.com
"
,
""
));
res
.
set
({
res
.
set
({
'
Set-Cookie
'
:
cookie
"
Set-Cookie
"
:
cookie
})
})
;
res
.
send
(
music_req
)
res
.
send
(
music_req
)
;
},
},
err
=>
res
.
status
(
502
).
send
(
'
fetch error
'
)
err
=>
res
.
status
(
502
).
send
(
"
fetch error
"
)
)
)
;
})
})
;
module
.
exports
=
router
module
.
exports
=
router
;
router/playlist_detail.js
浏览文件 @
642d6f53
const
http
=
require
(
'
http
'
)
const
http
=
require
(
"
http
"
);
const
express
=
require
(
'
express
'
)
const
express
=
require
(
"
express
"
);
const
router
=
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
cookie
=
req
.
get
(
"
Cookie
"
)
?
req
.
get
(
"
Cookie
"
)
:
""
;
let
detail
,
imgurl
const
data
=
{
const
data
=
{
id
:
req
.
query
.
id
,
id
:
req
.
query
.
id
,
offset
:
0
,
csrf_token
:
""
total
:
true
,
};
limit
:
1000
,
n
:
1000
,
csrf_token
:
''
}
createWebAPIRequest
(
createWebAPIRequest
(
'
music.163.com
'
,
"
music.163.com
"
,
'
/weapi/v3/playlist/detail
'
,
"
/weapi/v3/playlist/detail
"
,
'
POST
'
,
"
POST
"
,
data
,
data
,
cookie
,
cookie
,
music_req
=>
{
music_req
=>
{
console
.
log
(
music_req
)
// console.log(music_req)
// detail = music_req
res
.
send
(
music_req
);
res
.
send
(
music_req
)
// mergeRes()
},
},
err
=>
{
err
=>
{
res
.
status
(
502
).
send
(
'
fetch error
'
)
res
.
status
(
502
).
send
(
"
fetch error
"
);
}
}
)
)
;
// FIXME:i dont know the api to get coverimgurl
// FIXME:i dont know the api to get coverimgurl
// so i get it by parsing html
// so i get it by parsing html
...
@@ -62,6 +55,6 @@ router.get('/', (req, res) => {
...
@@ -62,6 +55,6 @@ router.get('/', (req, res) => {
// res.send(detail)
// res.send(detail)
// }
// }
// }
// }
})
})
;
module
.
exports
=
router
module
.
exports
=
router
;
router/user_playlist.js
浏览文件 @
642d6f53
const
express
=
require
(
'
express
'
)
const
express
=
require
(
"
express
"
);
const
router
=
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
cookie
=
req
.
get
(
"
Cookie
"
)
?
req
.
get
(
"
Cookie
"
)
:
""
;
const
data
=
{
const
data
=
{
offset
:
0
,
offset
:
req
.
query
.
offset
||
0
,
uid
:
req
.
query
.
uid
,
uid
:
req
.
query
.
uid
,
limit
:
1000
,
limit
:
req
.
query
.
limit
||
30
,
//貌似无效
csrf_token
:
''
csrf_token
:
""
}
}
;
createWebAPIRequest
(
createWebAPIRequest
(
'
music.163.com
'
,
"
music.163.com
"
,
'
/weapi/user/playlist
'
,
"
/weapi/user/playlist
"
,
'
POST
'
,
"
POST
"
,
data
,
data
,
cookie
,
cookie
,
music_req
=>
res
.
send
(
music_req
),
music_req
=>
{
err
=>
res
.
status
(
502
).
send
(
'
fetch error
'
)
res
.
send
(
music_req
);
)
// console.log(JSON.parse(music_req))
})
},
err
=>
res
.
status
(
502
).
send
(
"
fetch error
"
)
);
});
module
.
exports
=
router
module
.
exports
=
router
;
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录