mirror of
https://github.com/MeoProject/lx-music-api-server.git
synced 2025-05-23 19:17:41 +08:00
feat: wyy音质检查
This commit is contained in:
parent
3d2d241a36
commit
225753a7a2
@ -19,9 +19,9 @@ tools = {
|
||||
'320k': 'exhigh',
|
||||
'flac': 'lossless',
|
||||
'flac24bit': 'hires',
|
||||
"jyeffect": "jyeffect",
|
||||
"jysky": "jysky",
|
||||
"jymaster": "jymaster",
|
||||
"dolby": "jyeffect",
|
||||
"sky": "jysky",
|
||||
"master": "jymaster",
|
||||
},
|
||||
'cookie': config.read_config('module.wy.user.cookie'),
|
||||
}
|
||||
@ -43,4 +43,7 @@ async def url(songId, quality):
|
||||
body = json.loads(req.text)
|
||||
if (not body.get("data") or (not body.get("data")) or (not body.get("data")[0].get("url"))):
|
||||
raise FailedException("failed")
|
||||
if (config.read_config('module.wy.reject_unmatched_quality')):
|
||||
if (body['data'][0]['level'] != tools['qualityMap'][quality]):
|
||||
raise FailedException("reject unmatched quality")
|
||||
return body["data"][0]["url"].split("?")[0]
|
||||
|
@ -165,7 +165,9 @@ default = {
|
||||
"user": {
|
||||
"desc": "账号cookie数据,可以通过浏览器获取,需要vip账号来获取会员歌曲,如果没有请留为空值",
|
||||
"cookie": ""
|
||||
}
|
||||
},
|
||||
"reject_unmatcher_quality": True,
|
||||
"_reject_unmatcher_quality-desc": "是否拒绝不匹配的音质(默认拒绝),网易云API在当前环境无法获取该音质时会自动将低音质,开启此功能将拒绝被降级的音质返回",
|
||||
},
|
||||
"mg": {
|
||||
"desc": "咪咕音乐相关配置",
|
||||
|
Loading…
x
Reference in New Issue
Block a user