daily_3dos.py 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. # -*- coding: utf-8 -*-
  2. import os
  3. from httpx import Client
  4. from concurrent.futures import ThreadPoolExecutor, as_completed
  5. def daily_claim_3dos(email, password):
  6. client = Client(proxy="http://127.0.0.1:7890")
  7. # client = Client()
  8. login_url = "https://api.dashboard.3dos.io/api/auth/login"
  9. login_headers = {
  10. "Accept": "application/json, text/plain, */*",
  11. "Accept-Encoding": "gzip, deflate, br, zstd",
  12. "Accept-Language": "zh-CN,zh;q=0.9",
  13. "Content-Type": "application/json",
  14. "Origin": "https://dashboard.3dos.io",
  15. "Priority": "u=1, i",
  16. "Referer": "https://dashboard.3dos.io/",
  17. "Sec-CH-UA": '"Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"',
  18. "Sec-CH-UA-Mobile": "?0",
  19. "Sec-CH-UA-Platform": '"Windows"',
  20. "Sec-Fetch-Dest": "empty",
  21. "Sec-Fetch-Mode": "cors",
  22. "Sec-Fetch-Site": "same-site",
  23. "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36"
  24. }
  25. login_payload = {
  26. "email": email,
  27. "password": password
  28. }
  29. try:
  30. login_response = client.post(login_url, json=login_payload, headers=login_headers)
  31. except Exception as e:
  32. print(f"登录请求失败:{e}")
  33. return False
  34. if login_response.status_code == 200:
  35. # print(f"{email}: 登录成功!")
  36. login_data = login_response.json()
  37. # print("登录响应内容:", login_data)
  38. data = login_data.get("data")
  39. token = data.get("access_token") or data.get("token")
  40. token_type = data.get("token_type")
  41. if not token or not token_type:
  42. print("登录响应中未找到 Token 或 Token 类型!")
  43. return False
  44. authorization_header = f"{token_type} {token}"
  45. else:
  46. print("登录失败!")
  47. print("登录响应状态码:", login_response.status_code)
  48. print("登录响应内容:", login_response.json())
  49. return False
  50. options_url = "https://api.dashboard.3dos.io/api/claim-reward"
  51. options_headers = {
  52. "Accept": "*/*",
  53. "Accept-Encoding": "gzip, deflate, br, zstd",
  54. "Accept-Language": "zh-CN,zh;q=0.9",
  55. "Access-Control-Request-Headers": "authorization,cache-control,content-type,expires,pragma",
  56. "Access-Control-Request-Method": "POST",
  57. "Origin": "https://dashboard.3dos.io",
  58. "Priority": "u=1, i",
  59. "Referer": "https://dashboard.3dos.io/",
  60. "Sec-Fetch-Dest": "empty",
  61. "Sec-Fetch-Mode": "cors",
  62. "Sec-Fetch-Site": "same-site",
  63. "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36"
  64. }
  65. try:
  66. options_response = client.options(options_url, headers=options_headers)
  67. except Exception as e:
  68. print(f"OPTIONS 请求失败:{e}")
  69. return False
  70. # print("OPTIONS 请求响应状态码:", options_response.status_code)
  71. claim_url = "https://api.dashboard.3dos.io/api/claim-reward"
  72. claim_headers = {
  73. "Accept": "application/json, text/plain, */*",
  74. "Authorization": authorization_header,
  75. "Cache-Control": "no-cache",
  76. "Content-Type": "application/json",
  77. "Expires": "0",
  78. "Origin": "https://dashboard.3dos.io",
  79. "Pragma": "no-cache",
  80. "Priority": "u=1, i",
  81. "Referer": "https://dashboard.3dos.io/",
  82. "Sec-CH-UA": '"Chromium";v="130", "Google Chrome";v="130", "Not?A_Brand";v="99"',
  83. "Sec-CH-UA-Mobile": "?0",
  84. "Sec-CH-UA-Platform": '"Windows"',
  85. "Sec-Fetch-Dest": "empty",
  86. "Sec-Fetch-Mode": "cors",
  87. "Sec-Fetch-Site": "same-site",
  88. "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36"
  89. }
  90. claim_payload = {
  91. "id": "daily-reward-api"
  92. }
  93. try:
  94. claim_response = client.post(claim_url, json=claim_payload, headers=claim_headers)
  95. except Exception as e:
  96. print(f"{email} claim-reward 请求失败:{e}")
  97. return False
  98. message = claim_response.json().get("message")
  99. if claim_response.status_code not in [200, 429]:
  100. print(f"{email} claim 报错: {message}, 状态码{claim_response.status_code}")
  101. return False
  102. result = f"{email}: {message}"
  103. return result
  104. def main():
  105. print("开始执行...")
  106. account_list = [
  107. "jack0210_@hotmail.com|||aaaAAA111!!!",
  108. "yujieccyj01@hotmail.com|||aaaAAA111!!!",
  109. "yujieccyj02@hotmail.com|||aaaAAA111!!!",
  110. "yujieccyj03@hotmail.com|||aaaAAA111!!!",
  111. "yujieccyj04@hotmail.com|||aaaAAA111!!!",
  112. "yujieccyj05@hotmail.com|||aaaaAA111!!!",
  113. "yujieccyj06@hotmail.com|||aaaAAA111!!!",
  114. "yujieccyj07@hotmail.com|||aaaAAA111!!!",
  115. "yujieccyj08@hotmail.com|||aaaAAA111!!!",
  116. "yujieccyj09@hotmail.com|||aaaAAA111!!!",
  117. "yujieccyj10@hotmail.com|||aaaAAA111!!!",
  118. ]
  119. with ThreadPoolExecutor(max_workers=len(account_list)) as executor:
  120. futures = []
  121. for account in account_list:
  122. email, password = account.split("|||")
  123. futures.append(executor.submit(daily_claim_3dos, email, password))
  124. for future in as_completed(futures):
  125. result = future.result()
  126. if result:
  127. print(result)
  128. if __name__ == "__main__":
  129. main()