mirror of
https://gitlab.com/Binaryify/neteasecloudmusicapi.git
synced 2025-05-23 22:37:41 +08:00
artist subscribe & unsubscribe
This commit is contained in:
parent
7c524ec79f
commit
5e363fb2ee
6
app.js
6
app.js
@ -47,6 +47,12 @@ app.use("/artist/desc", require("./router/artists_desc"));
|
|||||||
//艺术家-mv
|
//艺术家-mv
|
||||||
app.use("/artist/mv", require("./router/artists_mv"));
|
app.use("/artist/mv", require("./router/artists_mv"));
|
||||||
|
|
||||||
|
// 收藏歌手
|
||||||
|
app.use("/artist/sub", require("./router/artist_sub"));
|
||||||
|
|
||||||
|
// 取消收藏歌手
|
||||||
|
app.use("/artist/unsub", require("./router/artist_unsub"));
|
||||||
|
|
||||||
// 获取 banner
|
// 获取 banner
|
||||||
app.use("/banner", require("./router/banner"));
|
app.use("/banner", require("./router/banner"));
|
||||||
|
|
||||||
|
23
router/artist_sub.js
Normal file
23
router/artist_sub.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
const express = require("express");
|
||||||
|
const router = express();
|
||||||
|
const { createWebAPIRequest } = require("../util/util");
|
||||||
|
|
||||||
|
router.get("/", (req, res) => {
|
||||||
|
const cookie = req.get("Cookie") ? req.get("Cookie") : "";
|
||||||
|
const data = {
|
||||||
|
artistId: `${req.query.id}`
|
||||||
|
};
|
||||||
|
createWebAPIRequest(
|
||||||
|
"music.163.com",
|
||||||
|
"/weapi/artist/sub",
|
||||||
|
"POST",
|
||||||
|
data,
|
||||||
|
cookie,
|
||||||
|
music_req => {
|
||||||
|
res.send(music_req);
|
||||||
|
},
|
||||||
|
err => res.status(502).send("fetch error")
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = router;
|
24
router/artist_unsub.js
Normal file
24
router/artist_unsub.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
const express = require("express");
|
||||||
|
const router = express();
|
||||||
|
const { createWebAPIRequest } = require("../util/util");
|
||||||
|
|
||||||
|
router.get("/", (req, res) => {
|
||||||
|
const cookie = req.get("Cookie") ? req.get("Cookie") : "";
|
||||||
|
const data = {
|
||||||
|
artistId: `${req.query.id}`,
|
||||||
|
artistIds: `[${req.query.id}]`
|
||||||
|
};
|
||||||
|
createWebAPIRequest(
|
||||||
|
"music.163.com",
|
||||||
|
"/weapi/artist/unsub",
|
||||||
|
"POST",
|
||||||
|
data,
|
||||||
|
cookie,
|
||||||
|
music_req => {
|
||||||
|
res.send(music_req);
|
||||||
|
},
|
||||||
|
err => res.status(502).send("fetch error")
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
module.exports = router;
|
Loading…
x
Reference in New Issue
Block a user