Skip to content

Commit

Permalink
[pull] master from Binaryify:master (#28)
Browse files Browse the repository at this point in the history
* fix: 修复匿名登录下,部分接口提示网络太拥挤问题 Binaryify#1829

* update: Dockfile

* lock文件更新

* 修复 Docker 构建镜像安装依赖速度慢的问题

* update: dockerfile 配置更新

* CI 更新

* ci 更新

* CI 更新

* CI 更新

* CI 更新

* bump to 4.13.8

* chore: update type

* docs: sync type definition

* fix: error when query.id is number

* feat: 播客声音排序

* feat: 播客列表详情

* doc: 更新文档

* feat: crypto.js 重构 Binaryify#1839

* update:lock文件更新

* [fix] removed unnecessary console log in song_url_v1

* update: song upload use up-to-date ip

* fix: use variable bucket name

* feat:歌曲红心数量,歌曲音质详情,本地歌曲文件匹配网易云歌曲信息

feat:本地歌曲文件匹配网易云歌曲信息
feat:歌曲音质详情
feat:歌曲红心数量

* update: appver更新

* fix: lint error

* fix: /artist/detail  登录状态下调用提示网络拥挤的问题 Binaryify#1853

* Update README.MD

add Python SDK

* Update README.MD

* update: 文档更新

* update: 移除多余代码

* bump to 4.14.0

---------

Co-authored-by: binaryify <[email protected]>
Co-authored-by: WooMai <[email protected]>
Co-authored-by: 龙打野 <[email protected]>
Co-authored-by: Unics Yu <[email protected]>
Co-authored-by: Akane <[email protected]>
Co-authored-by: 5unV <[email protected]>
Co-authored-by: 盧瞳 <[email protected]>
  • Loading branch information
8 people authored Dec 23, 2023
1 parent 311b18a commit a331b03
Show file tree
Hide file tree
Showing 53 changed files with 9,204 additions and 3,267 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/Build_Image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,14 @@ jobs:
id: get_version
if: startsWith(github.ref, 'refs/tags/') && startsWith(github.repository, 'Binaryify/NeteaseCloudMusicApi')
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
- name: Set Swap Space
uses: pierotofy/set-swap-space@master
with:
swap-size-gb: 10
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build and publish image
uses: ilteoood/docker_buildx@master
uses: elgohr/Publish-Docker-Github-Action@v5
if: startsWith(github.ref, 'refs/tags/') && startsWith(github.repository, 'Binaryify/NeteaseCloudMusicApi')
with:
publish: true
imageName: binaryify/netease_cloud_music_api # dockerid/imageName
platform: linux/ppc64le,linux/arm64,linux/amd64,linux/arm/v6,linux/arm/v7 # 你准备构建的镜像平台
tag: latest,${{ steps.get_version.outputs.VERSION }}
dockerUser: ${{ secrets.DOCKER_USERNAME }} # docker hub userid 在setting创建secrets name=DOCKER_USERNAME value=dockerid
dockerPassword: ${{ secrets.DOCKER_PASSWORD }} # docker hub password,在setting创建secrets name=DOCKER_PASSWORD value=dockerpassword
name: binaryify/netease_cloud_music_api # dockerid/imageName
platforms: linux/arm64,linux/amd64 # 你准备构建的镜像平台
tags: latest,${{ steps.get_version.outputs.VERSION }}
username: ${{ secrets.DOCKER_USERNAME }} # docker hub userid 在setting创建secrets name=DOCKER_USERNAME value=dockerid
password: ${{ secrets.DOCKER_PASSWORD }} # docker hub password,在setting创建secrets name=DOCKER_PASSWORD value=dockerpassword
20 changes: 20 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,11 +1,31 @@
# 更新日志
### 4.14.0 | 2023.12.20
- appver更新
- fix: /artist/detail 登录状态下调用提示网络拥挤的问题 #1853
- 歌曲红心数量,歌曲音质详情,本地歌曲文件匹配网易云歌曲信息 #1852
- crypto.js 重构 #1839
- 播客列表详情, 播客声音排序 #1843
- song_url number 类型修复 #1837
- 更新获取歌曲详情接口的 TypeScript 定义与文档,增加 Hi-Res 类型 #1836


### 4.13.8 | 2023.10.27
- Docker 构建平台支持调整(只支持linux/arm64和linux/amd64)

### 4.13.7 | 2023.10.26
- 修复 Docker 构建镜像安装依赖速度慢的问题

### 4.13.6 | 2023.10.26
- 修复匿名登录下,部分接口提示网络太拥挤问题 #1829

### 4.13.5 | 2023.10.22
- Dockfile 更新,移除 linux/s390x 平台,防止构建失败

### 4.13.4 | 2023.10.22
- 修复`更新用户信息`接口报错问题 #1824

- 部分接口移除`avatarImgId_str`字段
- 新增日推歌曲不感兴趣接口 #1816

### 4.13.3 | 2023.10.10
- 添加播客声音搜索接口 #1814
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ WORKDIR /app

COPY --chown=node:node . ./

RUN npm i --omit=dev --ignore-scripts
RUN yarn --network-timeout=100000

EXPOSE 3000

Expand Down
10 changes: 6 additions & 4 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -422,10 +422,12 @@ $ npm test

## SDK

| 语言 | 作者 | 地址 | 类型 |
| :--: | :-----------------------------------------: | :----------------------------------------------------------: | :----: |
| Java | [JackuXL](https://github.com/JackuXL) | [https://github.com/JackuXL/NeteaseCloudMusicApi-SDK](https://github.com/JackuXL/NeteaseCloudMusicApi-SDK) | 第三方 |
| Java | [1015770492](https://github.com/1015770492) | https://github.com/1015770492/yumbo-music-utils | 第三方 |
| 语言 | 作者 | 地址 | 类型 |
| :--: | :-----------------------------------------: | :----------------------------------------------------------: | :----: |
| Java | [JackuXL](https://github.com/JackuXL) | [https://github.com/JackuXL/NeteaseCloudMusicApi-SDK](https://github.com/JackuXL/NeteaseCloudMusicApi-SDK) | 第三方 |
| Java | [1015770492](https://github.com/1015770492) | https://github.com/1015770492/yumbo-music-utils | 第三方 |
| Python | [盧瞳](https://github.com/2061360308) | [NeteaseCloudMusic_PythonSDK](https://github.com/2061360308/NeteaseCloudMusic_PythonSDK) | 第三方 |


## 贡献者

Expand Down
86 changes: 84 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,11 @@
268. 用户贡献条目、积分、云贝数量
269. 年度听歌报告
270. 播客声音搜索
271. 播客声音排序
272. 播客列表详情
273. 本地歌曲文件匹配网易云歌曲信息
274. 歌曲音质详情
275. 歌曲红心数量

## 安装

Expand Down Expand Up @@ -2263,6 +2268,7 @@ crbt: Option<String>, None或字符串表示的十六进制,功能未知
cf: Option<String>, 空白字串或者None,功能未知
al: Album, 专辑,如果是DJ节目(dj_type != 0)或者无专辑信息(single == 1),则专辑id为0
dt: u64, 歌曲时长
hr: Option<Quality>, Hi-Res质量文件信息
sq: Option<Quality>, 无损质量文件信息
h: Option<Quality>, 高质量文件信息
m: Option<Quality>, 中质量文件信息
Expand Down Expand Up @@ -4294,6 +4300,30 @@ ONLINE 已发布
同上
```

### 播客声音排序

说明: 调整声音在列表中的顺序, 每个声音都有固定的序号, 例如将4的声音移动到1后, 原来的1、2、3增加为2、3、4, 其他不变

**接口地址:** `/voicelist/trans`

**必选参数:**

`position`: 位置, 最小为1, 最大为歌曲数量, 超过最大则为移动到最底, 小于1报错

`programId`: 播客声音id, 即voiceId

`radioId`: 电台id, 即voiceListId

### 播客列表详情

说明: 可以获取播客封面、分类、名称、简介等

**接口地址:** `/voicelist/detail`

**必选参数:**

`id`: 播客id,即voiceListId

### 播客上传声音
说明: 可以上传声音到播客,例子在 `/public/voice_upload.html` 访问地址: <a href="/voice_upload.html" target="_blank">/voice_upload.html</a>

Expand Down Expand Up @@ -4475,15 +4505,67 @@ qrCodeStatus:20,detailReason:0 验证成功qrCodeStatus:21,detailReason:0 二
**调用例子:** `/ugc/user/devote`

### 年度听歌报告
说明: 登录后调用此接口,使用此接口,可获取当前登录用户年度听歌报告,目前支持2017-2022年的报告
说明: 登录后调用此接口,使用此接口,可获取当前登录用户年度听歌报告,目前支持2017-2023年的报告

**必选参数:**

`year`: 报告年份

**接口地址:** `/summary/annual`

**调用例子:** `/summary/annual?year=2022`
**调用例子:** `/summary/annual?year=2023`

### 本地歌曲文件匹配网易云歌曲信息

说明: 调用此接口可以为本地歌曲文件搜索匹配歌曲ID、专辑封面等信息

**必选参数:**

`title`: 文件的标题信息,是文件属性里的标题属性,并非文件名

`album`: 文件的专辑信息

`artist`: 文件的艺术家信息

`duration`: 文件的时长,单位为秒

`md5`: 文件的md5

**接口地址:** `/search/match`

**调用例子:** `/search/match?title=富士山下&album=&artist=陈奕迅&duration=259.21&md5=bd708d006912a09d827f02e754cf8e56`

### 歌曲音质详情

说明: 调用此接口获取歌曲各个音质的文件信息,与 `获取歌曲详情` 接口相比,多出 `高清环绕声``沉浸环绕声``超清母带`等音质的信息

**必选参数:**

`id`: 歌曲id

**接口地址:** `song/music/detail`

**调用例子:** `song/music/detail?id=2082700997`

返回字段说明 :
```
"br": 比特率Bit Rate,
"size": 文件大小,
"vd": Volume Delta,
"sr": 采样率Sample Rate
```

### 歌曲红心数量

说明: 调用此接口获取歌曲的红心用户数量

**必选参数:**

`id`: 歌曲id

**接口地址:** `/song/red/count`

**调用例子:** `/song/red/count?id=186016`

## 离线访问此文档

Expand Down
2 changes: 1 addition & 1 deletion interface.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1085,7 +1085,7 @@ type SongDetail = {
m: SongDetailQuality | null
l: SongDetailQuality | null
sq: SongDetailQuality | null
hr: unknown
hr: SongDetailQuality | null
a: unknown | null
cd: string
no: number
Expand Down
2 changes: 1 addition & 1 deletion module/aidj_content_rcmd.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module.exports = (query, request) => {
const data = {
extInfo: JSON.stringify(extInfo),
}
console.log(data)
// console.log(data)
return request(
'POST',
`https://interface3.music.163.com/eapi/aidj/content/rcmd/info`,
Expand Down
2 changes: 2 additions & 0 deletions module/artist_detail.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module.exports = (query, request) => {
query.cookie.os = 'ios'
query.cookie.appver = '8.20.21'
return request(
'POST',
`https://music.163.com/api/artist/head/info/get`,
Expand Down
2 changes: 1 addition & 1 deletion module/artist_new_mv.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = (query, request) => {
query.cookie.os = 'ios'
query.cookie.appver = '8.7.01'
query.cookie.appver = '8.20.21'
const data = {
limit: query.limit || 20,
startTimestamp: query.before || Date.now(),
Expand Down
2 changes: 1 addition & 1 deletion module/artist_new_song.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = (query, request) => {
query.cookie.os = 'ios'
query.cookie.appver = '8.7.01'
query.cookie.appver = '8.20.21'
const data = {
limit: query.limit || 20,
startTimestamp: query.before || Date.now(),
Expand Down
2 changes: 1 addition & 1 deletion module/cloud_match.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = (query, request) => {
query.cookie.os = 'ios'
query.cookie.appver = '8.7.01'
query.cookie.appver = '8.20.21'
const data = {
userId: query.uid,
songId: query.sid,
Expand Down
2 changes: 1 addition & 1 deletion module/comment_hug_list.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { resourceTypeMap } = require('../util/config.json')
module.exports = (query, request) => {
query.cookie.os = 'ios'
query.cookie.appver = '8.7.01'
query.cookie.appver = '8.20.21'
query.type = resourceTypeMap[query.type || 0]
const threadId = query.type + query.sid
const data = {
Expand Down
1 change: 0 additions & 1 deletion module/creator_authinfo_get.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// 获取达人用户信息
const crypto = require('crypto')
module.exports = (query, request) => {
const data = {}
return request(
Expand Down
1 change: 0 additions & 1 deletion module/fanscenter_basicinfo_age_get.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// 粉丝年龄比例
const crypto = require('crypto')
module.exports = (query, request) => {
const data = {}
return request(
Expand Down
1 change: 0 additions & 1 deletion module/fanscenter_basicinfo_gender_get.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// 粉丝性别比例
const crypto = require('crypto')
module.exports = (query, request) => {
const data = {}
return request(
Expand Down
1 change: 0 additions & 1 deletion module/fanscenter_basicinfo_province_get.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// 粉丝省份比例
const crypto = require('crypto')
module.exports = (query, request) => {
const data = {}
return request(
Expand Down
1 change: 0 additions & 1 deletion module/fanscenter_overview_get.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// 粉丝数量
const crypto = require('crypto')
module.exports = (query, request) => {
const data = {}
return request(
Expand Down
1 change: 0 additions & 1 deletion module/fanscenter_trend_list.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// 粉丝来源
const crypto = require('crypto')
module.exports = (query, request) => {
const data = {
startTime: query.startTime || Date.now() - 7 * 24 * 3600 * 1000,
Expand Down
2 changes: 1 addition & 1 deletion module/homepage_block_page.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// query.refresh 是否刷新数据
module.exports = (query, request) => {
query.cookie.os = 'ios'
query.cookie.appver = '8.7.01'
query.cookie.appver = '8.20.21'
const data = { refresh: query.refresh || false, cursor: query.cursor }
return request(
'POST',
Expand Down
2 changes: 1 addition & 1 deletion module/homepage_dragon_ball.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module.exports = (query, request) => {
const data = {}
query.cookie.os = 'ios'
query.cookie.appver = '8.7.01'
query.cookie.appver = '8.20.21'
return request(
'POST',
`https://music.163.com/eapi/homepage/dragon/ball/static`,
Expand Down
2 changes: 1 addition & 1 deletion module/hug_comment.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const { resourceTypeMap } = require('../util/config.json')
module.exports = (query, request) => {
query.cookie.os = 'ios'
query.cookie.appver = '8.7.01'
query.cookie.appver = '8.20.21'
query.type = resourceTypeMap[query.type || 0]
const threadId = query.type + query.sid
const data = {
Expand Down
2 changes: 1 addition & 1 deletion module/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const crypto = require('crypto')

module.exports = async (query, request) => {
query.cookie.os = 'ios'
query.cookie.appver = '8.7.01'
query.cookie.appver = '8.20.21'
const data = {
username: query.email,
password:
Expand Down
2 changes: 1 addition & 1 deletion module/login_cellphone.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const crypto = require('crypto')

module.exports = async (query, request) => {
query.cookie.os = 'ios'
query.cookie.appver = '8.7.01'
query.cookie.appver = '8.20.21'
const data = {
phone: query.phone,
countrycode: query.countrycode || '86',
Expand Down
1 change: 0 additions & 1 deletion module/playmode_song_vector.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
// 云随机播放
const crypto = require('crypto')
module.exports = (query, request) => {
const data = {
ids: query.ids,
Expand Down
28 changes: 28 additions & 0 deletions module/search_match.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// 本地歌曲匹配音乐信息

module.exports = (query, request) => {
let songs = [
{
title: query.title || '',
album: query.album || '',
artist: query.artist || '',
duration: query.duration || 0,
persistId: query.md5,
},
]
const data = {
songs: JSON.stringify(songs),
}
return request(
'POST',
`https://interface3.music.163.com/eapi/search/match/new`,
data,
{
crypto: 'eapi',
cookie: query.cookie,
proxy: query.proxy,
url: '/api/search/match/new',
realIP: query.realIP,
},
)
}
2 changes: 1 addition & 1 deletion module/send_album.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module.exports = (query, request) => {
query.cookie.os = 'ios'
query.cookie.appver = '8.7.01'
query.cookie.appver = '8.20.21'
const data = {
id: query.id,
msg: query.msg || '',
Expand Down
2 changes: 1 addition & 1 deletion module/send_song.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module.exports = (query, request) => {
query.cookie.os = 'ios'
query.cookie.appver = '8.7.01'
query.cookie.appver = '8.20.21'
const data = {
id: query.id,
msg: query.msg || '',
Expand Down
Loading

1 comment on commit a331b03

@vercel
Copy link

@vercel vercel bot commented on a331b03 Dec 23, 2023

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.