mirror of
https://github.com/NeteaseCloudMusicApiEnhanced/api-enhanced.git
synced 2026-10-20 22:51:23 +08:00
feat: 新增 eapi 解析接口和使用 demo
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
const { eapiResDecrypt, eapiReqDecrypt } = require('../util/crypto')
|
||||
|
||||
module.exports = async (query, request) => {
|
||||
const hexString = query.hexString
|
||||
const isFormat = query.isFormat != 'false'
|
||||
if (!hexString) {
|
||||
return {
|
||||
status: 400,
|
||||
body: {
|
||||
code: 400,
|
||||
message: 'hex string is required',
|
||||
},
|
||||
}
|
||||
}
|
||||
// 去除空格
|
||||
let pureHexString = hexString.replace(/\s/g, '')
|
||||
return {
|
||||
status: 200,
|
||||
body: {
|
||||
code: 200,
|
||||
data: isFormat
|
||||
? eapiReqDecrypt(pureHexString)
|
||||
: eapiResDecrypt(pureHexString),
|
||||
},
|
||||
}
|
||||
}
|
||||
+13
-10
@@ -1,12 +1,15 @@
|
||||
module.exports = (query, request) => {
|
||||
const data = {
|
||||
type: '0',
|
||||
}
|
||||
return request('POST', `https://music.163.com/api/point/dailyTask`, data, {
|
||||
crypto: 'weapi',
|
||||
cookie: query.cookie,
|
||||
ua: query.ua || '',
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
})
|
||||
const data = {}
|
||||
return request(
|
||||
'POST',
|
||||
`https://music.163.com/api/pointmall/user/sign`,
|
||||
data,
|
||||
{
|
||||
crypto: 'weapi',
|
||||
cookie: query.cookie,
|
||||
ua: query.ua || '',
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user