mirror of
https://github.com/icepage/AutoUpdateJdCookie.git
synced 2026-06-05 21:02:55 +08:00
fix CK检测
This commit is contained in:
parent
971a697cf8
commit
db16b9b960
9
main.py
9
main.py
@ -603,6 +603,15 @@ async def main(mode: str = None):
|
||||
except Exception as e:
|
||||
logger.error(f"检测CK任务失败, 跳过检测, 报错原因为{e}")
|
||||
|
||||
# 再拿一次禁用的用户列表
|
||||
response = await qlapi.get_envs()
|
||||
if response['code'] == 200:
|
||||
logger.info("获取环境变量成功")
|
||||
else:
|
||||
logger.error(f"获取环境变量失败, response: {response}")
|
||||
raise Exception(f"获取环境变量失败, response: {response}")
|
||||
|
||||
user_info = response['data']
|
||||
# 获取需强制更新pt_pin
|
||||
force_update_pt_pins = [user_datas[key]["pt_pin"] for key in user_datas if user_datas[key].get("force_update") is True]
|
||||
# 获取需强制和需要强制更新的users
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
import asyncio
|
||||
from enum import Enum
|
||||
import json
|
||||
import random
|
||||
from utils.tools import send_request
|
||||
from typing import List, Dict, Any
|
||||
|
||||
@ -29,6 +31,8 @@ async def check_ck(
|
||||
"Accept-Encoding": "gzip, deflate, br"
|
||||
}
|
||||
r = await send_request(url, method, headers)
|
||||
# 检测这里太快了, sleep一会儿, 避免FK
|
||||
await asyncio.sleep(random.uniform(0.5,2))
|
||||
return r
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user