Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
m0_57517058
NeteaseCloudMusicApi
提交
35dbd5cb
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 搜索 >>
提交
35dbd5cb
编写于
1月 16, 2018
作者:
B
binaryify
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修复歌单详情接口数据不完整的问题 #167
上级
4856050b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
12 addition
and
35 deletion
+12
-35
CHANGELOG.MD
CHANGELOG.MD
+4
-0
package.json
package.json
+1
-1
router/playlist_detail.js
router/playlist_detail.js
+3
-32
util/util.js
util/util.js
+4
-2
未找到文件。
CHANGELOG.MD
浏览文件 @
35dbd5cb
# 更新日志
### 2.8.6 | 2018.01.16
修复歌单详情接口数据不完整的问题
### 2.8.5 | 2018.01.16
修复评论点赞失败的问题
...
...
package.json
浏览文件 @
35dbd5cb
{
"name"
:
"NeteaseCloudMusicApi"
,
"version"
:
"2.8.
5
"
,
"version"
:
"2.8.
6
"
,
"description"
:
"网易云音乐 NodeJS 版 API"
,
"scripts"
:
{
"start"
:
"node app.js"
,
...
...
router/playlist_detail.js
浏览文件 @
35dbd5cb
...
...
@@ -7,6 +7,7 @@ router.get("/", (req, res) => {
const
cookie
=
req
.
get
(
"
Cookie
"
)
?
req
.
get
(
"
Cookie
"
)
:
""
;
const
data
=
{
id
:
req
.
query
.
id
,
n
:
100000
,
csrf_token
:
""
};
...
...
@@ -17,44 +18,14 @@ router.get("/", (req, res) => {
data
,
cookie
,
music_req
=>
{
// console.log(music_req)
// console.log(JSON.parse(music_req).playlist.tracks.length)
// console.log(JSON.parse(music_req).playlist.trackIds.length)
res
.
send
(
music_req
);
},
err
=>
{
res
.
status
(
502
).
send
(
"
fetch error
"
);
}
);
// FIXME:i dont know the api to get coverimgurl
// so i get it by parsing html
// const http_client = http.get({
// hostname: 'music.163.com',
// path: '/playlist?id=' + req.query.id,
// headers: {
// 'Referer': 'http://music.163.com',
// },
// }, function (res) {
// res.setEncoding('utf8')
// let html = ''
// res.on('data', function (chunk) {
// html += chunk
// })
// res.on('end', function () {
// console.log('end', html)
// const regImgCover = /\<img src=\"(.*)\" class="j-img"/ig
// imgurl = regImgCover.exec(html)[1]
// mergeRes()
// })
// })
// function mergeRes() {
// if (imgurl != undefined && detail != undefined) {
// detail = JSON.parse(detail)
// detail.playlist.picUrl = imgurl
// res.send(detail)
// }
// }
});
module
.
exports
=
router
;
util/util.js
浏览文件 @
35dbd5cb
...
...
@@ -39,7 +39,7 @@ function createWebAPIRequest(
callback
,
errorcallback
)
{
console
.
log
(
cookie
);
//
console.log(cookie);
const
proxy
=
cookie
.
split
(
"
__proxy__
"
)[
1
];
cookie
=
cookie
.
split
(
"
__proxy__
"
)[
0
];
const
cryptoreq
=
Encrypt
(
data
);
...
...
@@ -71,7 +71,9 @@ function createWebAPIRequest(
//如: Domain=.music.163.com
let
cookie
=
res
.
headers
[
"
set-cookie
"
];
if
(
Array
.
isArray
(
cookie
))
{
cookie
=
cookie
.
map
(
x
=>
x
.
replace
(
/.music.163.com/g
,
""
)).
sort
((
a
,
b
)
=>
a
.
length
-
b
.
length
)
cookie
=
cookie
.
map
(
x
=>
x
.
replace
(
/.music.163.com/g
,
""
))
.
sort
((
a
,
b
)
=>
a
.
length
-
b
.
length
);
}
callback
(
body
,
cookie
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录