mirror of
https://github.com/MeoProject/lx-music-api-server.git
synced 2025-05-23 19:17:41 +08:00
fix: 修复引入账号池后导致的bug
This commit is contained in:
parent
3f300833d3
commit
1690c9600c
@ -27,18 +27,17 @@ async def getMusicInfo(hash_, use_cache = True):
|
||||
"User-Agent": "Android712-AndroidPhone-11451-376-0-FeeCacheUpdate-wifi",
|
||||
"x-router": "kmr.service.kugou.com",
|
||||
},
|
||||
"data": {
|
||||
"body": {
|
||||
"area_code": "1",
|
||||
"show_privilege": "1",
|
||||
"show_album_info": "1",
|
||||
"is_publish": "",
|
||||
"appid": 1005,
|
||||
"clientver": 11451,
|
||||
"mid": tools.mid,
|
||||
"mid": '114514',
|
||||
"dfid": "-",
|
||||
"clienttime": tn,
|
||||
"key": 'OIlwlieks28dk2k092lksi2UIkp',
|
||||
"fields": "",
|
||||
"data": [
|
||||
{
|
||||
"hash": hash_
|
||||
@ -48,7 +47,6 @@ async def getMusicInfo(hash_, use_cache = True):
|
||||
'cache': 86400 * 30 if use_cache else 'no-cache',
|
||||
'cache-ignore': [tn]
|
||||
}
|
||||
options['body'] = json.dumps(options['data']).replace(', ', ',').replace(': ', ':')
|
||||
body = await Httpx.AsyncRequest(url, dict(options))
|
||||
body = body.json()
|
||||
return body['data'][0][0] if (body['data'] and body['data'][0]) else {}
|
||||
|
@ -26,16 +26,16 @@ async def url(songId, quality):
|
||||
'method': 'CgiGetVkey',
|
||||
'param': {
|
||||
'filename': [f"{tools.fileInfo[quality]['h']}{strMediaMid}{tools.fileInfo[quality]['e']}"],
|
||||
'guid': user_info['guid'],
|
||||
'guid': config.read_config('module.tx.vkeyserver.guid'),
|
||||
'songmid': [songId],
|
||||
'songtype': [0],
|
||||
'uin': user_info['uin'],
|
||||
'uin': str(user_info['uin']),
|
||||
'loginflag': 1,
|
||||
'platform': '20',
|
||||
},
|
||||
},
|
||||
'comm': {
|
||||
"qq": user_info['uin'],
|
||||
"qq": str(user_info['uin']),
|
||||
"authst": user_info['qqmusic_key'],
|
||||
"ct": "26",
|
||||
"cv": "2010101",
|
||||
|
@ -63,7 +63,7 @@ async def refresh():
|
||||
else:
|
||||
logger.info('刷新登录成功')
|
||||
config.write_config('module.tx.user.uin',
|
||||
body['req1']['data']['musicid'])
|
||||
str(body['req1']['data']['musicid']))
|
||||
logger.info('已通过相应数据更新uin')
|
||||
config.write_config('module.tx.user.qqmusic_key',
|
||||
body['req1']['data']['musickey'])
|
||||
@ -93,7 +93,7 @@ async def refresh():
|
||||
else:
|
||||
logger.info('刷新登录成功')
|
||||
config.write_config('module.tx.user.uin',
|
||||
body['req1']['data']['musicid'])
|
||||
str(body['req1']['data']['musicid']))
|
||||
logger.info('已通过相应数据更新uin')
|
||||
config.write_config('module.tx.user.qqmusic_key',
|
||||
body['req1']['data']['musickey'])
|
||||
@ -158,7 +158,7 @@ async def refresh_login_for_pool(user_info):
|
||||
user_list[user_list.index(
|
||||
user_info)]['qqmusic_key'] = body['req1']['data']['musickey']
|
||||
user_list[user_list.index(
|
||||
user_info)]['uin'] = body['req1']['data']['musicid']
|
||||
user_info)]['uin'] = str(body['req1']['data']['musicid'])
|
||||
config.write_config('module.cookiepool.tx', user_list)
|
||||
logger.info(f'为QQ音乐账号(WeChat_{user_info["uin"]})数据更新完毕')
|
||||
return
|
||||
@ -190,7 +190,7 @@ async def refresh_login_for_pool(user_info):
|
||||
user_list[user_list.index(
|
||||
user_info)]['qqmusic_key'] = body['req1']['data']['musickey']
|
||||
user_list[user_list.index(
|
||||
user_info)]['uin'] = body['req1']['data']['musicid']
|
||||
user_info)]['uin'] = str(body['req1']['data']['musicid'])
|
||||
config.write_config('module.cookiepool.tx', user_list)
|
||||
logger.info(f'为QQ音乐账号(QQ_{user_info["uin"]})数据更新完毕')
|
||||
return
|
||||
|
@ -41,7 +41,7 @@ async def url(songId, quality):
|
||||
req = await Httpx.AsyncRequest(requestUrl, {
|
||||
'method': 'POST',
|
||||
'headers': {
|
||||
'Cookie': config.read_config('module.wy.cookie') if (not variable.use_cookie_pool) else random.choice(config.read_config('module.cookiepool.wy')),
|
||||
'Cookie': config.read_config('module.wy.cookie') if (not variable.use_cookie_pool) else random.choice(config.read_config('module.cookiepool.wy'))['cookie'],
|
||||
},
|
||||
'form': eapiEncrypt(path, json.dumps({
|
||||
"ids": json.dumps([songId]),
|
||||
|
Loading…
x
Reference in New Issue
Block a user