You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
721 B
38 lines
721 B
const uploadPlugin = require('../plugins/upload')
|
|
module.exports = async (query, request) => {
|
|
if (!query.imgFile) {
|
|
return {
|
|
status: 400,
|
|
body: {
|
|
code: 400,
|
|
msg: 'imgFile is required',
|
|
},
|
|
}
|
|
}
|
|
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,
|
|
realIP: query.realIP,
|
|
},
|
|
)
|
|
return {
|
|
status: 200,
|
|
body: {
|
|
code: 200,
|
|
data: {
|
|
...uploadInfo,
|
|
...res.body,
|
|
},
|
|
},
|
|
}
|
|
}
|