mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-22 15:41:23 +08:00
修复歌单详情接口数据不完整的问题 #167
This commit is contained in:
@@ -7,6 +7,7 @@ router.get("/", (req, res) => {
|
||||
const cookie = req.get("Cookie") ? req.get("Cookie") : "";
|
||||
const data = {
|
||||
id: req.query.id,
|
||||
n: 100000,
|
||||
csrf_token: ""
|
||||
};
|
||||
|
||||
@@ -17,44 +18,14 @@ router.get("/", (req, res) => {
|
||||
data,
|
||||
cookie,
|
||||
music_req => {
|
||||
// console.log(music_req)
|
||||
// console.log(JSON.parse(music_req).playlist.tracks.length)
|
||||
// console.log(JSON.parse(music_req).playlist.trackIds.length)
|
||||
res.send(music_req);
|
||||
},
|
||||
err => {
|
||||
res.status(502).send("fetch error");
|
||||
}
|
||||
);
|
||||
|
||||
// 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 = /\<img src=\"(.*)\" class="j-img"/ig
|
||||
// imgurl = regImgCover.exec(html)[1]
|
||||
// mergeRes()
|
||||
|
||||
// })
|
||||
// })
|
||||
|
||||
// function mergeRes() {
|
||||
// if (imgurl != undefined && detail != undefined) {
|
||||
// detail = JSON.parse(detail)
|
||||
// detail.playlist.picUrl = imgurl
|
||||
// res.send(detail)
|
||||
// }
|
||||
// }
|
||||
});
|
||||
|
||||
module.exports = router;
|
||||
|
||||
Reference in New Issue
Block a user