jack 7 сар өмнө
parent
commit
1fe8b708ba

+ 5 - 6
daily/daily_3dos.py

@@ -10,7 +10,7 @@ sys.path.append(os.path.join(os.path.abspath(__file__).split('auto')[0] + 'auto'
 from utils.utils_send_gotify import *
 from utils.utils_daily_task_scheduler import *
 
-DEBUG_MODE = 0
+DEBUG_MODE = 1
 
 
 def daily_claim_3dos(email, password):
@@ -61,8 +61,7 @@ def daily_claim_3dos(email, password):
     else:
         print("登录失败!")
         print("登录响应状态码:", login_response.status_code)
-        print("登录响应内容:", login_response.json())
-        return False
+        exit(1)
 
     options_url = "https://api.dashboard.3dos.io/api/claim-reward"
     options_headers = {
@@ -84,7 +83,7 @@ def daily_claim_3dos(email, password):
         options_response = client.options(options_url, headers=options_headers)
     except Exception as e:
         print(f"OPTIONS 请求失败:{e}")
-        return False
+        exit(1)
 
     # print("OPTIONS 请求响应状态码:", options_response.status_code)
 
@@ -115,13 +114,13 @@ def daily_claim_3dos(email, password):
         claim_response = client.post(claim_url, json=claim_payload, headers=claim_headers)
     except Exception as e:
         print(f"{email} claim-reward 请求失败:{e}")
-        return False
+        exit(1)
 
     message = claim_response.json().get("message")
 
     if claim_response.status_code not in [200, 429]:
         print(f"{email} claim 报错: {message}, 状态码{claim_response.status_code}")
-        return False
+        exit(1)
 
     result = f"{email}: {message}"
     return result

+ 1 - 1
utils/utils_daily_task_scheduler.py

@@ -43,7 +43,7 @@ class TaskScheduler:
             with open(self.file_path, "w") as file:
                 file.write(str(timestamp_now))
             print('创建执行时间文件 {}'.format(datetime.fromtimestamp(timestamp_now).strftime('%Y-%m-%d %H:%M:%S')))
-            return 0
+            return timestamp_now
         else:
             with open(self.file_path, "r") as file:
                 start_time = int(file.read())