Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Little_xu
NeteaseCloudMusicApi
提交
696e4b46
N
NeteaseCloudMusicApi
项目概览
Little_xu
/
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 搜索 >>
提交
696e4b46
编写于
10月 20, 2018
作者:
N
Nzix
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
internal modify
上级
7fdccd44
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
20 deletion
+18
-20
module/banner.js
module/banner.js
+2
-14
module/check_music.js
module/check_music.js
+8
-4
module/top_song.js
module/top_song.js
+8
-2
未找到文件。
module/banner.js
浏览文件 @
696e4b46
...
...
@@ -2,19 +2,7 @@
module
.
exports
=
(
query
,
request
)
=>
{
return
request
(
'
GET
'
,
`http://music.163.com/discover`
,
{
},
{
ua
:
'
pc
'
,
proxy
:
query
.
proxy
}
'
POST
'
,
`http://music.163.com/api/v2/banner/get`
,
{
clientType
:
"
pc
"
},
{
crypto
:
'
linuxapi
'
,
proxy
:
query
.
proxy
}
)
.
then
(
response
=>
{
try
{
const
banners
=
eval
(
`(
${
/
Gbanners
\
s
*=
\
s
*
([
^
;]
+
);
/.exec
(
response.body
)[
1
]
}
)
`
)
response
.
body
=
{
code
:
200
,
banners
:
banners
}
return
response
}
catch(err){
response.status = 500
response.body = {code: 500, msg: err.stack}
return Promise.reject(response)
}
})
}
\ No newline at end of file
module/check_music.js
浏览文件 @
696e4b46
...
...
@@ -10,12 +10,16 @@ module.exports = (query, request) => {
{
crypto
:
'
weapi
'
,
cookie
:
query
.
cookie
,
proxy
:
query
.
proxy
}
)
.
then
(
response
=>
{
if
(
response
.
body
.
code
==
200
)
{
if
(
response
.
body
.
data
[
0
]
.
code
==
200
){
response
.
body
=
{
success
:
true
,
message
:
'
ok
'
}
return
respons
e
let
playable
=
false
if
(
response
.
body
.
code
==
200
){
if
(
response
.
body
.
data
[
0
].
code
==
200
){
playable
=
tru
e
}
}
if
(
playable
){
response
.
body
=
{
success
:
true
,
message
:
'
ok
'
}
return
response
}
else
{
response
.
status
=
404
response
.
body
=
{
success
:
false
,
message
:
'
亲爱的,暂无版权
'
}
...
...
module/top_song.js
浏览文件 @
696e4b46
//
最新单曲(暂时废弃?)
//
新歌速递
module
.
exports
=
(
query
,
request
)
=>
{
const
data
=
{
areaId
:
query
.
type
||
0
,
// 全部:0 华语:7 欧美:96 日本:8 韩国:16
limit
:
query
.
limit
||
100
,
offset
:
query
.
offset
||
0
,
total
:
true
}
return
request
(
'
POST
'
,
`http://music.163.com/weapi/v1/discovery/new/songs`
,
{}
,
'
POST
'
,
`http://music.163.com/weapi/v1/discovery/new/songs`
,
data
,
{
crypto
:
'
weapi
'
,
cookie
:
query
.
cookie
,
proxy
:
query
.
proxy
}
)
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录