mirror of
https://github.com/MeoProject/lx-music-api-server.git
synced 2025-05-23 19:17:41 +08:00
fix: 修复wy源 sky 音质的获取
This commit is contained in:
parent
bbdb3eea7a
commit
24b7082d0e
@ -17,15 +17,23 @@ import ujson as json
|
|||||||
tools = {
|
tools = {
|
||||||
'qualityMap': {
|
'qualityMap': {
|
||||||
'128k': 'standard',
|
'128k': 'standard',
|
||||||
|
"192k": "higher",
|
||||||
'320k': 'exhigh',
|
'320k': 'exhigh',
|
||||||
'flac': 'lossless',
|
'flac': 'lossless',
|
||||||
'flac24bit': 'hires',
|
'flac24bit': 'hires',
|
||||||
"dolby": "jyeffect",
|
"dolby": "jyeffect",
|
||||||
"sky": "jysky",
|
"sky": "sky",
|
||||||
"master": "jymaster",
|
"master": "jymaster",
|
||||||
|
"standard": "standard",
|
||||||
|
"exhigh": "exhigh",
|
||||||
|
"lossless": "lossless",
|
||||||
|
"hires": "hires",
|
||||||
|
"jyeffect": "jyeffect",
|
||||||
|
"jymaster": "jymaster",
|
||||||
},
|
},
|
||||||
'qualityMapReverse': {
|
'qualityMapReverse': {
|
||||||
'standard': '128k',
|
'standard': '128k',
|
||||||
|
"higher": "192k",
|
||||||
'exhigh': '320k',
|
'exhigh': '320k',
|
||||||
'lossless': 'flac',
|
'lossless': 'flac',
|
||||||
'hires': 'flac24bit',
|
'hires': 'flac24bit',
|
||||||
@ -38,16 +46,19 @@ tools = {
|
|||||||
async def url(songId, quality):
|
async def url(songId, quality):
|
||||||
path = '/api/song/enhance/player/url/v1'
|
path = '/api/song/enhance/player/url/v1'
|
||||||
requestUrl = 'https://interface.music.163.com/eapi/song/enhance/player/url/v1'
|
requestUrl = 'https://interface.music.163.com/eapi/song/enhance/player/url/v1'
|
||||||
|
requestBody = {
|
||||||
|
"ids": json.dumps([songId]),
|
||||||
|
"level": tools["qualityMap"][quality],
|
||||||
|
"encodeType": "flac",
|
||||||
|
}
|
||||||
|
if (quality == "sky"):
|
||||||
|
requestBody["immerseType"] = "c51"
|
||||||
req = await Httpx.AsyncRequest(requestUrl, {
|
req = await Httpx.AsyncRequest(requestUrl, {
|
||||||
'method': 'POST',
|
'method': 'POST',
|
||||||
'headers': {
|
'headers': {
|
||||||
'Cookie': config.read_config('module.wy.user.cookie') if (not variable.use_cookie_pool) else random.choice(config.read_config('module.cookiepool.wy'))['cookie'],
|
'Cookie': config.read_config('module.wy.user.cookie') if (not variable.use_cookie_pool) else random.choice(config.read_config('module.cookiepool.wy'))['cookie'],
|
||||||
},
|
},
|
||||||
'form': eapiEncrypt(path, json.dumps({
|
'form': eapiEncrypt(path, json.dumps())
|
||||||
"ids": json.dumps([songId]),
|
|
||||||
"level": tools["qualityMap"][quality],
|
|
||||||
"encodeType": "flac",
|
|
||||||
}))
|
|
||||||
})
|
})
|
||||||
body = req.json()
|
body = req.json()
|
||||||
if (not body.get("data") or (not body.get("data")) or (not body.get("data")[0].get("url"))):
|
if (not body.get("data") or (not body.get("data")) or (not body.get("data")[0].get("url"))):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user