去除并发, 更改验证码识别密钥不存验证码图片

This commit is contained in:
work
2025-05-26 10:44:16 +08:00
parent 2b857b2685
commit 24722b4363
2 changed files with 27 additions and 28 deletions

27
main.py
View File

@@ -23,8 +23,8 @@ def get_task():
'Content-Type': 'application/json'
}
data = {
"include_task_type": [],
"exclude_task_type": ["login_account"],
"include_task_type": ["login_account"],
"exclude_task_type": []
}
response = requests.post(url, headers=header, json=data)
if response.status_code == 200:
@@ -61,19 +61,18 @@ def execute_task(tid, task_type, **kwargs):
def main():
with ThreadPoolExecutor(max_workers=1) as t:
while True:
try:
task = get_task()
if task is None:
time.sleep(10)
continue
task['data']['tid'] = task['id']
task['data']['task_type'] = task['task_type']
t.submit(execute_task, **task['data'])
except Exception as e:
error_logger.error(f'Main Error: {e}')
while True:
try:
task = get_task()
if task is None:
time.sleep(10)
continue
task['data']['tid'] = task['id']
task['data']['task_type'] = task['task_type']
execute_task(**task['data'])
except Exception as e:
error_logger.error(f'Main Error: {e}')
time.sleep(10)
if __name__ == '__main__':