提交 e8f9a753 编写于 作者: B binaryify

修复代理配置失效的问题 #992,修复新碟上架不返回周数据的问题,修复推荐新音乐接口返回数量问题,并添加limit参数支持 #981, 添加`云贝`相关接口...

修复代理配置失效的问题 #992,修复新碟上架不返回周数据的问题,修复推荐新音乐接口返回数量问题,并添加limit参数支持 #981, 添加`云贝`相关接口 #985,添加`用户账号信息`接口,替换接口文件所有http url 为 https
上级 0ca29afd
......@@ -2,7 +2,7 @@
name: 创建问题反馈
about: 问题反馈
title: "<不按照模版格式或者删除模版信息将得不到处理,确认看完了调用前须知再发 issues>"
labels: bug
labels: ''
assignees: ''
---
......@@ -25,6 +25,10 @@ assignees: ''
---
>维护项目都是业余时间,精力有限,我只能挑容易解决的issues处理,为了节约双方时间,请尽可能提供足够的有用的信息,给的信息不够我只能根据精力和时间看情况处理,如果模板信息看都不看就删掉,我不会进行任何回复,并且一个月后close掉issue
>先看文档有没有相关说明,调用前须知必看,确认看完了调用前须知再发 issues
>先在 issues 搜一下是否有相似问题,没有再发,否则直接关闭
......
# 更新日志
### 3.45.0 | 2020.10.25
- 修复代理配置失效的问题 [#992](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/992)
- 修复新碟上架不返回周数据的问题,修复推荐新音乐接口返回数量问题,并添加limit参数支持 [#981](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/981)
- 添加`云贝`相关接口 [#985](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/985)
- 添加`用户账号信息`接口
- 替换接口文件所有http url 为 https
### 3.44.0 | 2020.10.17
- 更新`电台详情`,`电台节目详情`接口 [#977](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/977)
......
......@@ -279,7 +279,16 @@ banner({ type:0 }).then(res=>{
177. 最近播放的视频
178. 音乐日历
179. 电台订阅者列表
180. 云贝签到信息
181. 云贝签到
182. 云贝所有任务
183. 云贝todo任务
184. 云贝今日签到信息
185. 云贝完成任务
186. 云贝收入
187. 云贝支出
188. 云贝账户信息
189. 账号信息
## 更新日志
......
......@@ -195,6 +195,16 @@
177. 最近播放的视频
178. 音乐日历
179. 电台订阅者列表
180. 云贝签到信息
181. 云贝签到
182. 云贝所有任务
183. 云贝todo任务
184. 云贝今日签到信息
185. 云贝完成任务
186. 云贝收入
187. 云贝支出
188. 云贝账户信息
189. 账号信息
## 安装
......@@ -520,6 +530,14 @@ v3.30.0后支持手动传入cookie,登录接口返回内容新增 `cookie` 字
**调用例子 :** `/user/detail?uid=32953014`
### 获取账号信息
说明 : 登录后调用此接口 ,可获取用户账号信息
**接口地址 :** `/user/account`
**调用例子 :** `/user/account`
### 获取用户信息 , 歌单,收藏,mv, dj 数量
说明 : 登录后调用此接口 , 可以获取用户信息
......@@ -2179,12 +2197,12 @@ mp3url 不能直接用 , 可通过 `/song/url` 接口传入歌曲 id 获取具
**调用例子 :** `/personalized?limit=1`
### 推荐新音乐
说明 : 调用此接口 , 可获取推荐新音乐
**可选参数 :** `limit`: 取出数量 , 默认为 10 (不支持 offset)
**接口地址 :** `/personalized/newsong`
**调用例子 :** `/personalized/newsong`
......@@ -2916,12 +2934,82 @@ type='1009' 获取其 id, 如`/search?keywords= 代码时间 &type=1009`
**调用例子 :** `/digitalAlbum/ordering?id=86286082&payment=3&quantity=1`
### 音乐日历
说明 : 登录后调用此接口 传入开始和结束时间,可获取音乐日历
说明 : 登录后调用此接口,传入开始和结束时间,可获取音乐日历
**接口地址 :** `/calendar`
**调用例子 :** `/calendar?startTime=1606752000000&endTime=1609430399999`
### 云贝
说明 : 登录后调用此接口可获取云贝签到信息(连续签到天数,第二天全部可获得的云贝)
**接口地址 :** `/yunbei`
**调用例子 :** `/yunbei`
### 云贝今日签到信息
说明 : 登录后调用此接口可获取云贝今日签到信息(今日签到获取的云贝数)
**接口地址 :** `/yunbei/today`
**调用例子 :** `/yunbei/today`
### 云贝签到
说明 : 登录后调用此接口可进行云贝签到
**接口地址 :** `/yunbei/sign`
**调用例子 :** `/yunbei/sign`
### 云贝账户信息
说明 :登录后调用此接口可获取云贝账户信息(账户云贝数)
**接口地址 :** `/yunbei/info`
**调用例子 :** `/yunbei/info`
### 云贝所有任务
说明 :登录后调用此接口可获取云贝所有任务
**接口地址 :** `/yunbei/tasks`
**调用例子 :** `/yunbei/tasks`
### 云贝todo任务
说明 :登录后调用此接口可获取云贝todo任务
**接口地址 :** `/yunbei/tasks/todo`
**调用例子 :** `/yunbei/tasks/todo`
### 云贝完成任务
**必选参数 :**
`userTaskId` : 任务id
**接口地址 :** `/yunbei/task/finish`
**调用例子 :** `/yunbei/task/finish?userTaskId=5146243240`
### 云贝收入
说明 :登录后调用此接口可获取云贝收入
**可选参数 :** `limit`: 取出评论数量 , 默认为 10
`offset`: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)\*10, 其中 10 为 limit 的值
**接口地址 :** `/yunbei/tasks/receipt`
**调用例子 :** `/yunbei/tasks/receipt?limit=1`
### 云贝支出
说明 :登录后调用此接口可获取云贝支出
**可选参数 :** `limit`: 取出评论数量 , 默认为 10
`offset`: 偏移数量 , 用于分页 , 如 :( 评论页数 -1)\*10, 其中 10 为 limit 的值
**接口地址 :** `/yunbei/tasks/expense`
**调用例子 :** `/yunbei/tasks/expense?limit=1`
### batch批量请求接口
说明 : 登录后调用此接口 ,传入接口和对应原始参数(原始参数非文档里写的参数,需参考源码),可批量请求接口
......
......@@ -802,7 +802,10 @@ export function personalized_djprogram(
export function personalized_mv(params: RequestBaseConfig): Promise<Response>
export function personalized_newsong(
params: RequestBaseConfig,
params: {
area?: string | number
limit?: string | number
} & RequestBaseConfig,
): Promise<Response>
export function personalized_privatecontent(
......@@ -1269,3 +1272,35 @@ export function dj_subscriber(
time?: number | string
} & RequestBaseConfig,
): Promise<Response>
export function user_account(params: RequestBaseConfig): Promise<Response>
export function yunbei(params: RequestBaseConfig): Promise<Response>
export function yunbei_info(params: RequestBaseConfig): Promise<Response>
export function yunbei_sign(params: RequestBaseConfig): Promise<Response>
export function yunbei_receipt(
params: {
limit?: number | string
offset?: number | string
} & RequestBaseConfig,
): Promise<Response>
export function yunbei_expense(
params: {
limit?: number | string
offset?: number | string
} & RequestBaseConfig,
): Promise<Response>
export function yunbei_tasks(params: RequestBaseConfig): Promise<Response>
export function yunbei_today(params: RequestBaseConfig): Promise<Response>
export function yunbei_tasks_todo(params: RequestBaseConfig): Promise<Response>
export function yunbei_task_finish(
params: { userTaskId?: number | string } & RequestBaseConfig,
): Promise<Response>
......@@ -6,7 +6,7 @@ module.exports = (query, request) => {
}
return request(
'POST',
`http://music.163.com/eapi/activate/initProfile`,
`https://music.163.com/eapi/activate/initProfile`,
data,
{
crypto: 'eapi',
......
......@@ -9,7 +9,7 @@ module.exports = (query, request) => {
data[i] = query[i]
}
})
return request('POST', `http://music.163.com/eapi/batch`, data, {
return request('POST', `https://music.163.com/eapi/batch`, data, {
crypto: 'eapi',
proxy: query.proxy,
url: '/api/batch',
......
......@@ -7,7 +7,7 @@ module.exports = (query, request) => {
}
return request(
'POST',
`http://music.163.com/eapi/cellphone/existence/check`,
`https://music.163.com/eapi/cellphone/existence/check`,
data,
{
crypto: 'eapi',
......
......@@ -3,7 +3,7 @@ module.exports = (query, request) => {
const data = {}
return request(
'POST',
`http://interface3.music.163.com/eapi/lbs/countries/v1`,
`https://interface3.music.163.com/eapi/lbs/countries/v1`,
data,
{
crypto: 'eapi',
......
......@@ -5,7 +5,7 @@ module.exports = (query, request) => {
query.cookie.os = 'pc'
return request(
'POST',
`http://music.163.com/weapi/djradio/banner/get`,
`https://music.163.com/weapi/djradio/banner/get`,
{},
{
crypto: 'weapi',
......
......@@ -3,7 +3,7 @@
module.exports = (query, request) => {
return request(
'POST',
`http://music.163.com/weapi/djradio/category/excludehot`,
`https://music.163.com/weapi/djradio/category/excludehot`,
{},
{
crypto: 'weapi',
......
......@@ -3,7 +3,7 @@
module.exports = (query, request) => {
return request(
'POST',
`http://music.163.com/weapi/djradio/home/category/recommend`,
`https://music.163.com/weapi/djradio/home/category/recommend`,
{},
{
crypto: 'weapi',
......
......@@ -6,7 +6,7 @@ module.exports = (query, request) => {
}
return request(
'POST',
`http://music.163.com/weapi/djradio/home/today/perfered`,
`https://music.163.com/weapi/djradio/home/today/perfered`,
data,
{
crypto: 'weapi',
......
......@@ -5,7 +5,7 @@ module.exports = (query, request) => {
limit: query.limit || 20,
offset: query.offset || 0,
}
return request('POST', `http://music.163.com/weapi/act/hot`, data, {
return request('POST', `https://music.163.com/weapi/act/hot`, data, {
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
......
......@@ -3,6 +3,8 @@
module.exports = (query, request) => {
const data = {
type: 'recommend',
limit: query.limit || 10,
areaId: query.areaId || 0,
}
return request(
'POST',
......
......@@ -7,7 +7,7 @@ module.exports = (query, request) => {
}
return request(
'POST',
`http://interface3.music.163.com/eapi/playlist/desc/update`,
`https://interface3.music.163.com/eapi/playlist/desc/update`,
data,
{
crypto: 'eapi',
......
......@@ -7,7 +7,7 @@ module.exports = (query, request) => {
}
return request(
'POST',
`http://interface3.music.163.com/eapi/playlist/update/name`,
`https://interface3.music.163.com/eapi/playlist/update/name`,
data,
{
crypto: 'eapi',
......
......@@ -7,7 +7,7 @@ module.exports = (query, request) => {
}
return request(
'POST',
`http://interface3.music.163.com/eapi/playlist/tags/update`,
`https://interface3.music.163.com/eapi/playlist/tags/update`,
data,
{
crypto: 'eapi',
......
......@@ -11,7 +11,7 @@ module.exports = async (query, request) => {
}
console.log(data)
return request('POST', `http://music.163.com/api/playlist/track/add`, data, {
return request('POST', `https://music.163.com/api/playlist/track/add`, data, {
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
......
......@@ -14,7 +14,7 @@ module.exports = async (query, request) => {
return request(
'POST',
`http://music.163.com/api/playlist/track/delete`,
`https://music.163.com/api/playlist/track/delete`,
data,
{
crypto: 'weapi',
......
......@@ -13,7 +13,7 @@ module.exports = async (query, request) => {
try {
const res = await request(
'POST',
`http://music.163.com/api/playlist/manipulate/tracks`,
`https://music.163.com/api/playlist/manipulate/tracks`,
data,
{
crypto: 'weapi',
......@@ -32,7 +32,7 @@ module.exports = async (query, request) => {
if (error.body.code === 512) {
return request(
'POST',
`http://music.163.com/api/playlist/manipulate/tracks`,
`https://music.163.com/api/playlist/manipulate/tracks`,
{
op: query.op, // del,add
pid: query.pid, // 歌单id
......
......@@ -10,7 +10,7 @@ module.exports = (query, request) => {
}
return request(
'POST',
`http://music.163.com/weapi/playmode/intelligence/list`,
`https://music.163.com/weapi/playmode/intelligence/list`,
data,
{
crypto: 'weapi',
......
......@@ -9,15 +9,10 @@ module.exports = (query, request) => {
password: crypto.createHash('md5').update(query.password).digest('hex'),
nickname: query.nickname,
}
return request(
'POST',
`https://music.163.com/weapi/register/cellphone`,
data,
{
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
},
)
return request('POST', `https://music.163.com/api/register/cellphone`, data, {
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
})
}
......@@ -3,7 +3,7 @@
module.exports = (query, request) => {
return request(
'POST',
`http://interface3.music.163.com/eapi/search/defaultkeyword/get`,
`https://interface3.music.163.com/eapi/search/defaultkeyword/get`,
{},
{
crypto: 'eapi',
......
......@@ -8,7 +8,7 @@ module.exports = (query, request) => {
}
return request(
'POST',
`http://music.163.com/weapi/share/friends/resource`,
`https://music.163.com/weapi/share/friends/resource`,
data,
{
crypto: 'weapi',
......
module.exports = (query, request) => {
const data = {}
return request('POST', `https://music.163.com/api/nuser/account/get`, data, {
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
})
}
......@@ -4,7 +4,7 @@ module.exports = (query, request) => {
const data = {
songIds: [query.id],
}
return request('POST', `http://music.163.com/weapi/cloud/del`, data, {
return request('POST', `https://music.163.com/weapi/cloud/del`, data, {
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
......
module.exports = (query, request) => {
const data = {}
// /api/point/today/get
return request('POST', `https://music.163.com/api/point/signed/get`, data, {
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
})
}
module.exports = (query, request) => {
const data = {
limit: query.limit || 10,
offset: query.offset || 0,
}
return request(
'POST',
`https://music.163.com/store/api/point/expense`,
data,
{
crypto: 'api',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
},
)
}
module.exports = (query, request) => {
const data = {}
return request('POST', `https://music.163.com/api/v1/user/info`, data, {
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
})
}
module.exports = (query, request) => {
const data = {
limit: query.limit || 10,
offset: query.offset || 0,
}
return request(
'POST',
`https://music.163.com/store/api/point/receipt`,
data,
{
crypto: 'api',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
},
)
}
module.exports = (query, request) => {
const data = {
type: '0',
}
return request('POST', `https://music.163.com/api/point/dailyTask`, data, {
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
})
}
module.exports = (query, request) => {
const data = {
userTaskId: query.userTaskId,
depositCode: '0',
}
return request(
'POST',
`https://music.163.com/api/usertool/task/point/receive`,
data,
{
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
},
)
}
module.exports = (query, request) => {
const data = {}
return request(
'POST',
`https://music.163.com/api/usertool/task/list/all`,
data,
{
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
},
)
}
module.exports = (query, request) => {
const data = {}
return request(
'POST',
`https://music.163.com/api/usertool/task/todo/query`,
data,
{
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
},
)
}
module.exports = (query, request) => {
const data = {}
return request('POST', `https://music.163.com/api/point/today/get`, data, {
crypto: 'weapi',
cookie: query.cookie,
proxy: query.proxy,
realIP: query.realIP,
})
}
{
"name": "NeteaseCloudMusicApi",
"version": "3.44.0",
"version": "3.45.0",
"description": "网易云音乐 NodeJS 版 API",
"scripts": {
"start": "node app.js",
......@@ -44,7 +44,8 @@
"axios": "^0.20.0",
"express": "^4.17.1",
"express-fileupload": "^1.1.9",
"pac-proxy-agent": "^4.0.0"
"pac-proxy-agent": "^4.0.0",
"tunnel": "^0.0.6"
},
"devDependencies": {
"@types/node": "14.11.10",
......
......@@ -4,11 +4,11 @@ const queryString = require('querystring')
const PacProxyAgent = require('pac-proxy-agent')
const http = require('http')
const https = require('https')
const tunnel = require('tunnel')
const qs = require('url')
// request.debug = true // 开启可看到更详细信息
const chooseUserAgent = (ua = false) => {
// UA 列表要经常更新啊
const userAgentList = {