mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-03 15:12:10 +08:00
解决网络拥堵提示问题
This commit is contained in:
parent
b4f6ba0884
commit
3cca8d2924
@ -1,5 +1,5 @@
|
||||
# 更新日志
|
||||
### 4.8.0 | 2022.09.12
|
||||
### 4.8.1 | 2022.09.12
|
||||
- 解决网络拥堵提示问题
|
||||
|
||||
### 4.7.0 | 2022.09.02
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "NeteaseCloudMusicApi",
|
||||
"version": "4.8.0",
|
||||
"version": "4.8.1",
|
||||
"description": "网易云音乐 NodeJS 版 API",
|
||||
"scripts": {
|
||||
"start": "node app.js",
|
||||
|
@ -6,7 +6,6 @@ describe('测试获取歌手专辑列表是否正常', () => {
|
||||
it('数据的 code 应该为200', (done) => {
|
||||
const qs = {
|
||||
id: 32311,
|
||||
cookie: '__remember_me=true; NMTID=xxx',
|
||||
}
|
||||
|
||||
axios
|
||||
|
@ -6,7 +6,6 @@ describe('测试获取评论是否正常', () => {
|
||||
it('数据的 code 应该为200', (done) => {
|
||||
const qs = {
|
||||
id: 32311,
|
||||
cookie: '__remember_me=true; NMTID=xxx',
|
||||
}
|
||||
|
||||
axios
|
||||
|
@ -6,7 +6,6 @@ describe('测试获取歌词是否正常', () => {
|
||||
it('数据应该有 lrc 字段', (done) => {
|
||||
const qs = {
|
||||
id: 347230,
|
||||
cookie: '__remember_me=true; NMTID=xxx',
|
||||
}
|
||||
|
||||
axios
|
||||
|
@ -8,7 +8,6 @@ describe('测试获取歌曲是否正常', () => {
|
||||
id: 462791935,
|
||||
br: 999000,
|
||||
realIP: '116.25.146.177',
|
||||
cookie: '__remember_me=true; NMTID=xxx',
|
||||
}
|
||||
|
||||
axios
|
||||
|
@ -7,7 +7,6 @@ describe('测试搜索是否正常', () => {
|
||||
const qs = {
|
||||
keywords: '海阔天空',
|
||||
type: 1,
|
||||
cookie: '__remember_me=true; NMTID=xxx',
|
||||
}
|
||||
axios
|
||||
.get(`${host}/search`, {
|
||||
|
@ -57,6 +57,11 @@ const createRequest = (method, url, data = {}, options) => {
|
||||
}
|
||||
// headers['X-Real-IP'] = '118.88.88.88'
|
||||
if (typeof options.cookie === 'object') {
|
||||
options.cookie = {
|
||||
...options.cookie,
|
||||
__remember_me: true,
|
||||
NMTID: 'xxx',
|
||||
}
|
||||
if (!options.cookie.MUSIC_U) {
|
||||
// 游客
|
||||
if (!options.cookie.MUSIC_A) {
|
||||
@ -73,6 +78,8 @@ const createRequest = (method, url, data = {}, options) => {
|
||||
.join('; ')
|
||||
} else if (options.cookie) {
|
||||
headers['Cookie'] = options.cookie
|
||||
} else {
|
||||
headers['Cookie'] = '__remember_me=true; NMTID=xxx'
|
||||
}
|
||||
// console.log(options.cookie, headers['Cookie'])
|
||||
if (options.crypto === 'weapi') {
|
||||
|
Loading…
x
Reference in New Issue
Block a user