Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

Commit

Permalink
更新获取音乐 url接口,未登录状态返回试听片段 #897
Browse files Browse the repository at this point in the history
  • Loading branch information
Binaryify committed Sep 20, 2020
1 parent 372a81f commit d09c19c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# 更新日志
### 3.41.2 | 2020.09.20
- 更新`获取音乐 url`接口,未登录状态返回试听片段 [#897](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/897)

### 3.41.1 | 2020.09.19
- 新增`电台个性推荐接口` [#824](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/824)

Expand Down
3 changes: 1 addition & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1093,8 +1093,7 @@ tags: 歌单标签

### 获取音乐 url

说明 : 使用歌单详情接口后 , 能得到的音乐的 id, 但不能得到的音乐 url, 调用此接口
, 传入的音乐 id( 可多个 , 用逗号隔开 ), 可以获取对应的音乐的 url( 不需要登录 )
说明 : 使用歌单详情接口后 , 能得到的音乐的 id, 但不能得到的音乐 url, 调用此接口, 传入的音乐 id( 可多个 , 用逗号隔开 ), 可以获取对应的音乐的 url,未登录状态返回试听片段(返回字段包含被截取的正常歌曲的开始时间和结束时间)

> 注 : 部分用户反馈获取的 url 会 403,[hwaphon](https://github.com/hwaphon)找到的解决方案是当获取到音乐的 id 后,将 https://music.163.com/song/media/outer/url?id=id.mp3 以 src 赋予 Audio 即可播放
Expand Down
5 changes: 3 additions & 2 deletions module/song_url.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ module.exports = (query, request) => {
}
return request(
'POST',
`https://music.163.com/api/song/enhance/player/url`,
`https://interface3.music.163.com/eapi/song/enhance/player/url`,
data,
{
crypto: 'linuxapi',
crypto: 'eapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
url: '/api/song/enhance/player/url',
},
)
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "NeteaseCloudMusicApi",
"version": "3.41.1",
"version": "3.41.2",
"description": "网易云音乐 NodeJS 版 API",
"scripts": {
"start": "node app.js",
Expand Down

1 comment on commit d09c19c

@vercel
Copy link

@vercel vercel bot commented on d09c19c Sep 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.