Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
m0_66418769
NeteaseCloudMusicApi
提交
96f84b0a
N
NeteaseCloudMusicApi
项目概览
m0_66418769
/
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 搜索 >>
提交
96f84b0a
编写于
11月 20, 2021
作者:
S
SnowingFox
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feature: 新增获取歌单所有歌曲的API
上级
6c374395
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
48 addition
and
14 deletion
+48
-14
module/playlist_catlist.js
module/playlist_catlist.js
+1
-13
module/playlist_track_all.js
module/playlist_track_all.js
+47
-0
package-lock.json
package-lock.json
+0
-1
未找到文件。
module/playlist_catlist.js
浏览文件 @
96f84b0a
// 全部歌单分类
module
.
exports
=
(
query
,
request
)
=>
{
return
request
(
'
POST
'
,
`https://music.163.com/weapi/playlist/catalogue`
,
{},
{
crypto
:
'
weapi
'
,
cookie
:
query
.
cookie
,
proxy
:
query
.
proxy
,
realIP
:
query
.
realIP
,
},
)
}
module
.
exports
=
(
query
,
request
)
=>
{}
module/playlist_track_all.js
0 → 100644
浏览文件 @
96f84b0a
// 通过传过来的歌单id拿到所有歌曲数据
// 支持传递参数limit来限制获取歌曲的数据数量 例如: /playlist/track/all?id=7044354223&limit=10
module
.
exports
=
(
query
,
request
)
=>
{
const
data
=
{
id
:
query
.
id
,
n
:
100000
,
s
:
query
.
s
||
8
,
}
//不放在data里面避免请求带上无用的数据
let
limit
=
query
.
limit
let
trackIds
let
idsData
=
Object
.
create
(
null
)
return
request
(
'
POST
'
,
`https://music.163.com/api/v6/playlist/detail`
,
data
,
{
crypto
:
'
api
'
,
cookie
:
query
.
cookie
,
proxy
:
query
.
proxy
,
realIP
:
query
.
realIP
,
}).
then
((
res
)
=>
{
const
ids
=
[]
let
trackIds
=
res
.
body
.
playlist
.
trackIds
if
(
typeof
limit
===
'
undefined
'
)
{
limit
=
trackIds
.
length
}
trackIds
.
forEach
((
item
,
index
)
=>
{
if
(
index
<
limit
)
{
ids
.
push
(
item
.
id
)
}
})
idsData
=
{
c
:
'
[
'
+
ids
.
map
((
id
)
=>
'
{"id":
'
+
id
+
'
}
'
).
join
(
'
,
'
)
+
'
]
'
,
}
return
request
(
'
POST
'
,
`https://music.163.com/api/v3/song/detail`
,
idsData
,
{
crypto
:
'
weapi
'
,
cookie
:
query
.
cookie
,
proxy
:
query
.
proxy
,
realIP
:
query
.
realIP
,
},
)
})
}
package-lock.json
浏览文件 @
96f84b0a
...
...
@@ -5,7 +5,6 @@
"requires"
:
true
,
"packages"
:
{
""
:
{
"name"
:
"NeteaseCloudMusicApi"
,
"version"
:
"4.0.23"
,
"license"
:
"MIT"
,
"dependencies"
:
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录