Skip to content

Commit

Permalink
fix: 修复vkey api部分文件404的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ikun0014 committed Sep 17, 2024
1 parent e62ef1c commit 193618b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions modules/tx/player.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@
'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']
Expand All @@ -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': {
Expand Down

0 comments on commit 193618b

Please sign in to comment.