Skip to content

Commit

Permalink
chore: 优化一下
Browse files Browse the repository at this point in the history
  • Loading branch information
ikun0014 committed Aug 18, 2024
1 parent 8919767 commit 089d1c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion common/default_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,6 @@
value: auto
refresh_login: # cookie池中对于此账号刷新登录的配置,账号间互不干扰
enable: false
interval: 604800
login_url: http://login.user.kugou.com/v4/login_by_token
tx:
Expand Down
6 changes: 3 additions & 3 deletions modules/kg/refresh_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ async def refresh_login_for_pool(user_info):
'KG-Rec': '1',
'KG-RC': '1',
}
login_url = config.read_config('module.kg.user.refresh_token.login_url')
login_url = user_info["refresh_login"]["login_url"]
req = await signRequest(login_url, params, {'method': 'POST', 'json': data, 'headers': headers})
body = req.json()
if body['error_code'] != 0:
Expand Down Expand Up @@ -180,7 +180,7 @@ async def refresh_login_for_pool(user_info):
'KG-Rec': '1',
'KG-RC': '1',
}
login_url = config.read_config('module.kg.user.refresh_token.login_url')
login_url = user_info["refresh_login"]["login_url"]
req = await signRequest(login_url, params, {'method': 'POST', 'json': data, 'headers': headers})
body = req.json()
if body['error_code'] != 0:
Expand All @@ -203,7 +203,7 @@ def reg_refresh_login_pool_task():
for user_info in user_info_pool:
if (user_info['refresh_login'].get('enable')):
scheduler.append(
f'kgmusic_refresh_login_pooled_{user_info["userid"]}', refresh_login_for_pool, user_info['refresh_login']['interval'], args = {'user_info': user_info})
f'kgmusic_refresh_login_pooled_{user_info["userid"]}', refresh_login_for_pool, int(604800), args = {'user_info': user_info})

if (variable.use_cookie_pool):
reg_refresh_login_pool_task()

0 comments on commit 089d1c2

Please sign in to comment.