mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-07-03 19:02:08 +08:00
优化缓存
This commit is contained in:
parent
cde7863060
commit
53b75c31cc
3
app.js
3
app.js
@ -17,8 +17,9 @@ let cache = apicache.middleware
|
|||||||
// }
|
// }
|
||||||
// next()
|
// next()
|
||||||
// })
|
// })
|
||||||
|
const onlyStatus200 = (req, res) => res.statusCode === 200
|
||||||
|
|
||||||
app.use(cache('2 minutes'))
|
app.use(cache('2 minutes', onlyStatus200))
|
||||||
|
|
||||||
app.use(express.static('public'))
|
app.use(express.static('public'))
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "NeteaseCloudMusicApi",
|
"name": "NeteaseCloudMusicApi",
|
||||||
"version": "2.6.8",
|
"version": "2.6.9",
|
||||||
"description": "网易云音乐 NodeJS 版 API",
|
"description": "网易云音乐 NodeJS 版 API",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "node app.js",
|
"start": "node app.js",
|
||||||
|
@ -13,7 +13,6 @@ router.get('/', (req, res) => {
|
|||||||
password: md5sum.digest('hex'),
|
password: md5sum.digest('hex'),
|
||||||
rememberLogin: 'true'
|
rememberLogin: 'true'
|
||||||
}
|
}
|
||||||
|
|
||||||
createWebAPIRequest(
|
createWebAPIRequest(
|
||||||
'music.163.com',
|
'music.163.com',
|
||||||
'/weapi/login/cellphone',
|
'/weapi/login/cellphone',
|
||||||
@ -21,7 +20,7 @@ router.get('/', (req, res) => {
|
|||||||
data,
|
data,
|
||||||
cookie,
|
cookie,
|
||||||
(music_req, cookie) => {
|
(music_req, cookie) => {
|
||||||
console.log(music_req)
|
// console.log(music_req)
|
||||||
res.set({
|
res.set({
|
||||||
'Set-Cookie': cookie
|
'Set-Cookie': cookie
|
||||||
})
|
})
|
||||||
|
@ -7,7 +7,6 @@ router.get('/', (req, res) => {
|
|||||||
const data = {
|
const data = {
|
||||||
csrf_token: ''
|
csrf_token: ''
|
||||||
}
|
}
|
||||||
|
|
||||||
createWebAPIRequest(
|
createWebAPIRequest(
|
||||||
'music.163.com',
|
'music.163.com',
|
||||||
'/weapi/v1/radio/get',
|
'/weapi/v1/radio/get',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user