diff --git a/package.json b/package.json index b95095b..fb61dc1 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "网易云音乐 NodeJS 版 API", "scripts": { "start": "node app.js", - "test": "mocha -r intelli-espower-loader -t 30000 server.test.js main.test.js --exit", + "test": "mocha -r intelli-espower-loader -t 60000 server.test.js main.test.js --exit", "lint": "eslint \"**/*.{js,ts}\"", "lint-fix": "eslint --fix \"**/*.{js,ts}\"", "prepare": "husky install", diff --git a/util/request.js b/util/request.js index 36c6636..2791eb6 100644 --- a/util/request.js +++ b/util/request.js @@ -1,4 +1,5 @@ const encrypt = require('./crypto') +const crypto = require('crypto') const axios = require('axios') const PacProxyAgent = require('pac-proxy-agent') const http = require('http') @@ -60,7 +61,8 @@ const createRequest = (method, url, data = {}, options) => { options.cookie = { ...options.cookie, __remember_me: true, - NMTID: 'xxx', + NMTID: crypto.randomBytes(16).toString('hex'), + _ntes_nuid: crypto.randomBytes(16).toString('hex'), } if (!options.cookie.MUSIC_U) { // 游客