forked from Binaryify/NeteaseCloudMusicApi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request Binaryify#242 from LightStrawberry/master
user_update and playlist_update api
- Loading branch information
Showing
3 changed files
with
79 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
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 playlist_id = req.query.id; | ||
const desc_detail = req.query.desc || ""; | ||
const tags_detail = req.query.tags || ""; | ||
const name_detail = req.query.name; | ||
const data = { | ||
"/api/playlist/desc/update": | ||
'{"id":' + playlist_id + ',"desc":"' + desc_detail + '"}', | ||
"/api/playlist/tags/update": | ||
'{"id":' + playlist_id + ',"tags":"' + tags_detail + '"}', | ||
"/api/playlist/update/name": | ||
'{"id":' + playlist_id + ',"name":"' + name_detail + '"}', | ||
csrf_token: "" | ||
}; | ||
createWebAPIRequest( | ||
"music.163.com", | ||
"/weapi/batch", | ||
"POST", | ||
data, | ||
cookie, | ||
music_req => { | ||
res.send(music_req); | ||
}, | ||
err => res.status(502).send("fetch error") | ||
); | ||
}); | ||
|
||
module.exports = router; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const express = require("express"); | ||
const router = express(); | ||
const { createWebAPIRequest } = require("../util/util"); | ||
|
||
router.get("/", (req, res) => { | ||
const cookie = req.get("Cookie") ? req.get("Cookie") : ""; | ||
// 暂时不提供更换头像接口 | ||
// gender为0表示保密,1为男性,2为女性 | ||
const gender_type = req.query.gender; | ||
// birthday 为unix13位时间戳 | ||
// province_number and city_number | ||
const data = { | ||
avatarImgId: "0", | ||
birthday: req.query.birthday, | ||
city: req.query.city, | ||
gender: gender_type, | ||
nickname: req.query.nickname, | ||
province: req.query.province, | ||
signature: req.query.signature, | ||
csrf_token: "" | ||
}; | ||
createWebAPIRequest( | ||
"music.163.com", | ||
"/weapi/user/profile/update", | ||
"POST", | ||
data, | ||
cookie, | ||
music_req => res.send(music_req), | ||
err => res.status(502).send("fetch error") | ||
); | ||
}); | ||
|
||
module.exports = router; |