mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 21:58:03 +00:00
fix: add netease_api
This commit is contained in:
parent
fc0367c9b4
commit
0b701d23da
304 changed files with 27205 additions and 1 deletions
39
netease_api/module/login_cellphone.js
Normal file
39
netease_api/module/login_cellphone.js
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
// 手机登录
|
||||
|
||||
const crypto = require('crypto')
|
||||
|
||||
module.exports = async (query, request) => {
|
||||
query.cookie.os = 'pc'
|
||||
const data = {
|
||||
phone: query.phone,
|
||||
countrycode: query.countrycode || '86',
|
||||
password:
|
||||
query.md5_password ||
|
||||
crypto.createHash('md5').update(query.password).digest('hex'),
|
||||
rememberLogin: 'true',
|
||||
}
|
||||
let result = await request(
|
||||
'POST',
|
||||
`https://music.163.com/weapi/login/cellphone`,
|
||||
data,
|
||||
{
|
||||
crypto: 'weapi',
|
||||
ua: 'pc',
|
||||
cookie: query.cookie,
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
},
|
||||
)
|
||||
|
||||
if (result.body.code === 200) {
|
||||
result = {
|
||||
status: 200,
|
||||
body: {
|
||||
...result.body,
|
||||
cookie: result.cookie.join(';'),
|
||||
},
|
||||
cookie: result.cookie,
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue