main.py 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  1. import asyncio
  2. from aiohttp import ClientSession
  3. from aiohttp_socks import ProxyConnector
  4. from typing import Callable, Awaitable
  5. from functools import partial, wraps
  6. from loguru import logger
  7. from capmonster_python import RecaptchaV2Task as CapmonsterRecaptcha
  8. from python_anticaptcha import AnticaptchaClient, NoCaptchaTaskProxylessTask as AnticaptchaRecaptcha
  9. from twocaptcha import TwoCaptcha
  10. from web3.auto import w3
  11. from random import choice
  12. from re import findall
  13. from sys import stdout
  14. from concurrent.futures import ThreadPoolExecutor
  15. EMAIL_HEADERS = {
  16. "requestverificationtoken": "CfDJ8AXQ6d5LLCdGlZgtgxMvXnffRzu6mjGpKijTrjU8SM30he2w6vsOIz0UsIXA0svp6zhNo9sHQs7L1sSoGHIdiUek5cwBg13l-_zH21rY3rs4XmbQhycnKuGIGaMwL3BxW3BxJX2_exIgHQRNTJEv2j8",
  17. "cookie": ".AspNetCore.Antiforgery.dXyz_uFU2og=CfDJ8AXQ6d5LLCdGlZgtgxMvXnc7V3B_a_YUGra_iYnioWQXkCs2xd5Z9gcoYyI0S_fmZADqd6hQlAhNrg3vt2v6m5H5Eu9cXQmUOgBXdo19Rh3i2zZj5nMabAdr3sP-f0VzjhVFzy4ClobRkRTmlqjY4zw; _ym_uid=1654525472841042508; _ym_isad=1; __cf_bm=GQ5MHyKpH8NavH7M6Mz6cRpPI5DkZsVPNd104Jx2sgI-1654525473-0-AaCalJ2vWVFra9K/JtZ/gAx+cyJxsnqE0KDgn363WS1Mj5u6FEPOJ0WspOx/I0bt5doELGKnMZtooTwA82zyKzAPx4XH/RzvQsH4afWGkCPCwdqYRScD7FTOEsrCjxBr6A==",
  18. "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Safari/537.36"
  19. }
  20. def get_proxy():
  21. return choice(proxy)
  22. async def get_message(email: str):
  23. async with create_client(headers=EMAIL_HEADERS) as client:
  24. response = await client.post(
  25. "https://tempmailo.com",
  26. json={"mail": email})
  27. data = await response.json()
  28. for message in data:
  29. if message["from"] == "HELIX <no-reply@helixmetaverse.com>":
  30. return findall(r"VERIFY EMAIL \((.*)\)", message["text"])[0].strip()
  31. await asyncio.sleep(10)
  32. return await get_message(email)
  33. def wrap(func):
  34. @wraps(func)
  35. async def run(*args, loop=None, executor=None, **kwargs):
  36. if loop is None:
  37. loop = asyncio.get_event_loop()
  38. pfunc = partial(func, *args, **kwargs)
  39. return await loop.run_in_executor(executor, pfunc)
  40. return run
  41. async def create_email():
  42. async with create_client(headers=EMAIL_HEADERS) as client:
  43. response = await client.get(
  44. "https://tempmailo.com/changemail?_r=0.6008200314006913")
  45. data = await response.text()
  46. if data.strip() == "":
  47. raise Exception("Не удалось создать почту")
  48. return data.strip()
  49. def create_wallet():
  50. account = w3.eth.account.create()
  51. return account.privateKey.hex(), account.address
  52. @wrap
  53. def solve_by_capmonster(api_key: str, site_url: str, site_key: str):
  54. client = CapmonsterRecaptcha(api_key)
  55. task = client.create_task(site_url, site_key)
  56. data = client.join_task_result(task)
  57. return data.get("gRecaptchaResponse")
  58. @wrap
  59. def solve_by_anticaptcha(api_key: str, site_url: str, site_key: str):
  60. client = AnticaptchaClient(api_key, language_pool="ru")
  61. task = AnticaptchaRecaptcha(site_url, site_key)
  62. task = client.createTask(task)
  63. task.join()
  64. return task.get_solution_response()
  65. @wrap
  66. def solve_by_twocaptcha(api_key: str, site_url: str, site_key: str):
  67. client = TwoCaptcha(api_key)
  68. return client.recaptcha(site_key, site_url).get("code")
  69. solvers: list[Callable[[str, str, str], Awaitable[str]]] = [
  70. solve_by_twocaptcha,
  71. solve_by_anticaptcha,
  72. solve_by_capmonster
  73. ]
  74. def create_client(**kwargs):
  75. proxy, connector = get_proxy(), None
  76. if proxy:
  77. connector = ProxyConnector.from_url(get_proxy())
  78. return ClientSession(connector=connector, **kwargs)
  79. async def create_set_user_request(
  80. solver: Callable[[str, str], Awaitable[str]],
  81. r_id: str):
  82. try:
  83. logger.info("Решение капчи")
  84. code = await solver(
  85. "https://helixmetaverse.com",
  86. "6LeDrh0gAAAAAGeqVs6x1UCYwGELN6aQwV9ETN3Q")
  87. logger.info("Капча решена {}...", code[:4])
  88. logger.info("Создание почты")
  89. email = await create_email()
  90. logger.info("Почта создана {}", email)
  91. logger.info("Создание кошелька")
  92. private_address, address = create_wallet()
  93. logger.info("Кошелек создан {}", address)
  94. async with create_client(
  95. headers={
  96. "user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Safari/537.36",
  97. "accept": "*/*",
  98. "accept-language": "ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7",
  99. "content-type": "text/plain;charset=UTF-8",
  100. "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"99\"",
  101. "sec-ch-ua-mobile": "?0",
  102. "sec-ch-ua-platform": "\"Windows\"",
  103. "sec-fetch-dest": "empty",
  104. "sec-fetch-mode": "cors",
  105. "sec-fetch-site": "cross-site",
  106. "Referer": "https://helixmetaverse.com/",
  107. "Referrer-Policy": "strict-origin-when-cross-origin"}
  108. ) as client:
  109. logger.info("Отправка запроса на регистрацию")
  110. response = await client.post(
  111. "https://mntixvzfga.execute-a"
  112. "pi.us-east-1.amazonaws.com/setUser",
  113. json={
  114. "email": email,
  115. "wallet": address,
  116. "r_id": r_id,
  117. "g-recaptcha-response": code
  118. })
  119. data = await response.json()
  120. if "message" in data:
  121. raise Exception(
  122. "Не удалось зарегистрировать аккаунт {}",
  123. data["message"])
  124. logger.info("Верификация почты")
  125. message = await get_message(email)
  126. response = await client.get(message)
  127. secret = str(response.url).split("secret=")[-1]
  128. logger.info("Отправка верификационного запроса")
  129. response = await client.put(
  130. "https://mntixvzfga.execute-a"
  131. "pi.us-east-1.amazonaws.com/setUser",
  132. json={
  133. "uuid": data["uuid"],
  134. "secret": secret
  135. })
  136. data = await response.json()
  137. if "message" in data:
  138. raise Exception(
  139. "Не уадлось зарегать акк {}",
  140. data["message"])
  141. logger.success("{} - Аккаунт успешно зарегистрирован", data["uuid"])
  142. return email, address, private_address
  143. except Exception:
  144. logger.exception("ОШибка какая-то хуй знает")
  145. async def main():
  146. solver_type, api_key = (
  147. input("Введите тип солвера капчи(1 - рукапча, 2"
  148. " - антикапча, 3 - сапмонстер) -> "),
  149. input("Введите ключ от солвера -> "))
  150. solver = partial(solvers[int(solver_type) - 1], api_key)
  151. accounts_count = int(input("Введите кол-во аккаунтов, ско"
  152. "лько вы хотите зарегистрировать -> "))
  153. r_id = input("Введите реф код -> ")
  154. logger.success("Запуск регистраций")
  155. tasks = [asyncio.create_task(create_set_user_request(solver, r_id))
  156. for _ in range(accounts_count)]
  157. accounts = await asyncio.gather(*tasks)
  158. for account in accounts:
  159. try:
  160. open("accounts.txt", "a+").write(
  161. f"{account[0]}:{account[1]}:{account[2]}\n")
  162. except Exception:
  163. pass
  164. try:
  165. proxy = open("proxies.txt").read().strip().split("\n")
  166. except Exception:
  167. proxy = [None]
  168. asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
  169. asyncio.run(main())