From 193618b34e397608ed1943052c06a6148f17b902 Mon Sep 17 00:00:00 2001 From: ikun Date: Tue, 17 Sep 2024 20:56:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dvkey=20api=E9=83=A8?= =?UTF-8?q?=E5=88=86=E6=96=87=E4=BB=B6404=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/tx/player.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/tx/player.py b/modules/tx/player.py index 0690062..669eaec 100644 --- a/modules/tx/player.py +++ b/modules/tx/player.py @@ -21,14 +21,15 @@ index_map = { 'master': 3 } -async def vkeyUrl(q, b): +async def vkeyUrl(i, q, b): apiNode = config.read_config("module.tx.vkey_api.vkey_api_url") filename = b['track_info']['file']['media_mid'] if (q in index_map.keys()): filename = b['track_info']['vs'][index_map[q]] if (not filename): raise FailedException('未找到该音质') filename = f"{tools.fileInfo[q]['h']}{filename}{tools.fileInfo[q]['e']}" - url = apiNode + f"?filename={filename}&guid={config.read_config('module.tx.vkeyserver.guid')}&uin={config.read_config('module.tx.vkeyserver.uin')}" + src = f"{tools.fileInfo[q]['h']}{i}{tools.fileInfo[q]['e']}" + url = apiNode + f'?filename={filename}&guid={config.read_config("module.tx.vkeyserver.guid")}&uin={config.read_config("module.tx.vkeyserver.uin")}&src={src}' req = await Httpx.AsyncRequest(url) body = req.json() purl = body['data'][0]['purl'] @@ -42,7 +43,7 @@ async def url(songId, quality): infoBody = await getMusicInfo(songId) strMediaMid = infoBody['track_info']['file']['media_mid'] if (config.read_config("module.tx.vkey_api.use_vkey_api")): - return await vkeyUrl(quality, infoBody) + return await vkeyUrl(songId, quality, infoBody) user_info = config.read_config('module.tx.user') if (not variable.use_cookie_pool) else random.choice(config.read_config('module.cookiepool.tx')) requestBody = { 'req_0': {