diff --git a/app.js b/app.js index b4c9dda4d4492f16e0bce6330492bfd833f95eaa..1cbd22e42d60d69ca828284d8fa9e2aa8bd1cca2 100644 --- a/app.js +++ b/app.js @@ -17,8 +17,9 @@ let cache = apicache.middleware // } // next() // }) +const onlyStatus200 = (req, res) => res.statusCode === 200 -app.use(cache('2 minutes')) +app.use(cache('2 minutes', onlyStatus200)) app.use(express.static('public')) diff --git a/package.json b/package.json index fcae6f953288ef78539a4a2cf6f740bdeeefbc7f..b3dacf16bead63a4d82176814ab225af48c88757 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "NeteaseCloudMusicApi", - "version": "2.6.8", + "version": "2.6.9", "description": "网易云音乐 NodeJS 版 API", "scripts": { "start": "node app.js", diff --git a/router/loginCellphone.js b/router/loginCellphone.js index f872affd7610cc4f22d14f761076a6788b335b1e..38c2d2f7a1048f3b84355312b737b43c6a784f2d 100644 --- a/router/loginCellphone.js +++ b/router/loginCellphone.js @@ -13,7 +13,6 @@ router.get('/', (req, res) => { password: md5sum.digest('hex'), rememberLogin: 'true' } - createWebAPIRequest( 'music.163.com', '/weapi/login/cellphone', @@ -21,7 +20,7 @@ router.get('/', (req, res) => { data, cookie, (music_req, cookie) => { - console.log(music_req) + // console.log(music_req) res.set({ 'Set-Cookie': cookie }) diff --git a/router/personal_fm.js b/router/personal_fm.js index c605280028f230d2b2ac01926add0060aa44b7be..a6774e4be8cc0512eaf2c4784ee50aea19ec71b7 100644 --- a/router/personal_fm.js +++ b/router/personal_fm.js @@ -7,7 +7,6 @@ router.get('/', (req, res) => { const data = { csrf_token: '' } - createWebAPIRequest( 'music.163.com', '/weapi/v1/radio/get',