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

Commit 65e32ee

Browse files
committed
相似歌手,首页-发现-圆形图标入口列表接口增加匿名token #877,#988,修复音乐 url接口POST方式手动传入cookie报错问题 #1005
1 parent f4a3a9c commit 65e32ee

6 files changed

+25
-3
lines changed

CHANGELOG.MD

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
# 更新日志
2+
### 3.45.3 | 2020.11.1
3+
- `相似歌手`,`首页-发现-圆形图标入口列表`接口增加匿名token[#877](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/877) [#988](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/988)
4+
5+
- 修复`音乐 url`接口POST方式手动传入cookie报错问题 [#1005](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1005)
6+
27
### 3.45.2 | 2020.10.26
38
- 云贝完成任务接口增加`depositCode`参数
49

module/homepage_dragon_ball.js

+6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
// 这个接口为移动端接口,首页-发现页(每日推荐、歌单、排行榜 那些入口)
33
// 数据结构可以参考 https://github.com/hcanyz/flutter-netease-music-api/blob/master/lib/src/api/uncategorized/bean.dart#L290 HomeDragonBallWrap
44
// !需要登录或者匿名登录,非登录返回 []
5+
const config = require('../util/config')
56
module.exports = (query, request) => {
7+
if (typeof query.cookie === 'string') {
8+
query.cookie = cookieToJson(query.cookie)
9+
}
10+
if (!('MUSIC_U' in query.cookie))
11+
query.cookie.MUSIC_A = config.anonymous_token
612
const data = {}
713
return request(
814
'POST',

module/simi_artist.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
// 相似歌手
2-
2+
const config = require('../util/config')
33
module.exports = (query, request) => {
4+
if (typeof query.cookie === 'string') {
5+
query.cookie = cookieToJson(query.cookie)
6+
}
7+
if (!('MUSIC_U' in query.cookie))
8+
query.cookie.MUSIC_A = config.anonymous_token
49
const data = {
510
artistid: query.id,
611
}

module/song_url.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
// 歌曲链接
22

33
const crypto = require('crypto')
4-
4+
const { cookieToJson } = require('../util/index')
55
module.exports = (query, request) => {
6+
if (typeof query.cookie === 'string') {
7+
query.cookie = cookieToJson(query.cookie)
8+
}
69
if (!('MUSIC_U' in query.cookie))
710
query.cookie._ntes_nuid = crypto.randomBytes(16).toString('hex')
811
query.cookie.os = 'pc'

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "NeteaseCloudMusicApi",
3-
"version": "3.45.2",
3+
"version": "3.45.3",
44
"description": "网易云音乐 NodeJS 版 API",
55
"scripts": {
66
"start": "node app.js",

util/config.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"anonymous_token": "8aae43f148f990410b9a2af38324af24e87ab9227c9265627ddd10145db744295fcd8701dc45b1ab8985e142f491516295dd965bae848761274a577a62b0fdc54a50284d1e434dcc04ca6d1a52333c9a"
3+
}

0 commit comments

Comments
 (0)