mirror of
https://github.com/GiriNeko/YesPlayMusic.git
synced 2025-12-17 13:48:02 +00:00
fix: add netease_api
This commit is contained in:
parent
fc0367c9b4
commit
0b701d23da
304 changed files with 27205 additions and 1 deletions
28
netease_api/module/song_url.js
Normal file
28
netease_api/module/song_url.js
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
// 歌曲链接
|
||||
|
||||
const crypto = require('crypto')
|
||||
const { cookieToJson } = require('../util/index')
|
||||
module.exports = (query, request) => {
|
||||
if (typeof query.cookie === 'string') {
|
||||
query.cookie = cookieToJson(query.cookie)
|
||||
}
|
||||
if (!('MUSIC_U' in query.cookie))
|
||||
query.cookie._ntes_nuid = crypto.randomBytes(16).toString('hex')
|
||||
query.cookie.os = 'pc'
|
||||
const data = {
|
||||
ids: '[' + query.id + ']',
|
||||
br: parseInt(query.br || 999000),
|
||||
}
|
||||
return request(
|
||||
'POST',
|
||||
`https://interface3.music.163.com/eapi/song/enhance/player/url`,
|
||||
data,
|
||||
{
|
||||
crypto: 'eapi',
|
||||
cookie: query.cookie,
|
||||
proxy: query.proxy,
|
||||
realIP: query.realIP,
|
||||
url: '/api/song/enhance/player/url',
|
||||
},
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue