diff --git a/docs/README.md b/docs/README.md index 72ada14..5db8242 100644 --- a/docs/README.md +++ b/docs/README.md @@ -276,7 +276,7 @@ $ set PORT=4000 && node app.js `/top/playlist/highquality` **调用例子:** -`/playlist/detail?id=24381616` +`/top/playlist/highquality?limit=30` ### 获取歌单详情 diff --git a/router/playlist_detail.js b/router/playlist_detail.js index 33dbffa..fc3546a 100644 --- a/router/playlist_detail.js +++ b/router/playlist_detail.js @@ -23,8 +23,9 @@ router.get("/", (req, res) => { cookie, music_req => { console.log(music_req) - detail = music_req - mergeRes() + // detail = music_req + res.send(music_req) + // mergeRes() }, err => { res.status(502).send('fetch error') @@ -33,34 +34,34 @@ router.get("/", (req, res) => { // FIXME:i dont know the api to get coverimgurl // so i get it by parsing html - const http_client = http.get({ - hostname: 'music.163.com', - path: '/playlist?id=' + req.query.id, - headers: { - 'Referer': 'http://music.163.com', - }, - }, function (res) { - res.setEncoding('utf8') - let html = '' - res.on('data', function (chunk) { - html += chunk - }) - res.on('end', function () { - console.log('end', html) - const regImgCover = /\