新增更新头像,歌单封面上传接口和相关例子 #403 #857

This commit is contained in:
binaryify
2020-08-03 23:09:36 +08:00
parent 0ad746dad4
commit 8df5d7a790
11 changed files with 356 additions and 52 deletions
+22
View File
@@ -0,0 +1,22 @@
const uploadPlugin = require('../plugins/upload')
module.exports = async (query, request) => {
const uploadInfo = await uploadPlugin(query, request)
const res = await request(
'POST',
`https://music.163.com/weapi/user/avatar/upload/v1`,
{
imgid: uploadInfo.imgId
},
{ crypto: 'weapi', cookie: query.cookie, proxy: query.proxy }
)
return {
status: 200,
body: {
code: 200,
data: {
...uploadInfo,
...res.body,
},
},
}
}
+23
View File
@@ -0,0 +1,23 @@
const uploadPlugin = require('../plugins/upload')
module.exports = async (query, request) => {
const uploadInfo = await uploadPlugin(query, request)
const res = await request(
'POST',
`https://music.163.com/weapi/playlist/cover/update`,
{
id: query.id,
coverImgId: uploadInfo.imgId
},
{ crypto: 'weapi', cookie: query.cookie, proxy: query.proxy }
)
return {
status: 200,
body: {
code: 200,
data: {
...uploadInfo,
...res.body,
},
},
}
}
-1
View File
@@ -7,7 +7,6 @@ module.exports = (query, request) => {
need_preview_url: 'true',
total: true
}
console.log({data})
// /api/videotimeline/otherclient/get
return request(
'POST', `https://music.163.com/api/videotimeline/otherclient/get`, data, {