mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-07 02:32:06 +08:00
增加缓存机制
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
const Encrypt = require('./crypto.js')
|
||||
const http = require('http')
|
||||
const querystring = require('querystring')
|
||||
|
||||
function randomUserAgent() {
|
||||
const userAgentList = [
|
||||
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36',
|
||||
@ -79,7 +81,10 @@ function createWebAPIRequest(
|
||||
}
|
||||
)
|
||||
http_client.write(
|
||||
'params=' + cryptoreq.params + '&encSecKey=' + cryptoreq.encSecKey
|
||||
querystring.stringify({
|
||||
params: cryptoreq.params,
|
||||
encSecKey: cryptoreq.encSecKey
|
||||
})
|
||||
)
|
||||
http_client.end()
|
||||
}
|
||||
@ -121,4 +126,4 @@ function createRequest(path, method, data, callback, errorcallback) {
|
||||
module.exports = {
|
||||
createWebAPIRequest,
|
||||
createRequest
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user