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

Commit

Permalink
相似歌手,首页-发现-圆形图标入口列表接口增加匿名token #877,#988,修复音乐 url接口POST方式手动传入co…
Browse files Browse the repository at this point in the history
…okie报错问题 #1005
  • Loading branch information
Binaryify committed Nov 1, 2020
1 parent f4a3a9c commit 65e32ee
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.MD
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# 更新日志
### 3.45.3 | 2020.11.1
- `相似歌手`,`首页-发现-圆形图标入口列表`接口增加匿名token[#877](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/877) [#988](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/988)

- 修复`音乐 url`接口POST方式手动传入cookie报错问题 [#1005](https://github.com/Binaryify/NeteaseCloudMusicApi/issues/1005)

### 3.45.2 | 2020.10.26
- 云贝完成任务接口增加`depositCode`参数

Expand Down
6 changes: 6 additions & 0 deletions module/homepage_dragon_ball.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@
// 这个接口为移动端接口,首页-发现页(每日推荐、歌单、排行榜 那些入口)
// 数据结构可以参考 https://github.com/hcanyz/flutter-netease-music-api/blob/master/lib/src/api/uncategorized/bean.dart#L290 HomeDragonBallWrap
// !需要登录或者匿名登录,非登录返回 []
const config = require('../util/config')
module.exports = (query, request) => {
if (typeof query.cookie === 'string') {
query.cookie = cookieToJson(query.cookie)
}
if (!('MUSIC_U' in query.cookie))
query.cookie.MUSIC_A = config.anonymous_token
const data = {}
return request(
'POST',
Expand Down
7 changes: 6 additions & 1 deletion module/simi_artist.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
// 相似歌手

const config = require('../util/config')
module.exports = (query, request) => {
if (typeof query.cookie === 'string') {
query.cookie = cookieToJson(query.cookie)
}
if (!('MUSIC_U' in query.cookie))
query.cookie.MUSIC_A = config.anonymous_token
const data = {
artistid: query.id,
}
Expand Down
5 changes: 4 additions & 1 deletion module/song_url.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
// 歌曲链接

const crypto = require('crypto')

const { cookieToJson } = require('../util/index')
module.exports = (query, request) => {
if (typeof query.cookie === 'string') {
query.cookie = cookieToJson(query.cookie)
}
if (!('MUSIC_U' in query.cookie))
query.cookie._ntes_nuid = crypto.randomBytes(16).toString('hex')
query.cookie.os = 'pc'
Expand Down
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.45.2",
"version": "3.45.3",
"description": "网易云音乐 NodeJS 版 API",
"scripts": {
"start": "node app.js",
Expand Down
3 changes: 3 additions & 0 deletions util/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"anonymous_token": "8aae43f148f990410b9a2af38324af24e87ab9227c9265627ddd10145db744295fcd8701dc45b1ab8985e142f491516295dd965bae848761274a577a62b0fdc54a50284d1e434dcc04ca6d1a52333c9a"
}

1 comment on commit 65e32ee

@vercel
Copy link

@vercel vercel bot commented on 65e32ee Nov 1, 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.