· 4 years ago · May 05, 2021, 07:22 AM
1import os
2import random
3import re
4import secrets
5import string
6import time
7import requests
8import json
9
10
11class Email:
12 """Класс предназначен для работы с почтой. Использует сервис авто регистрации почты (
13 https://temporary-mail-afeg-ru.p.rapidapi.com) """
14
15 def __init__(self, key_api):
16 self.domain = ["googla.gq", "yanbex.tk", "axeb.ru", "ourmail.ga", "mail2020.cf", "a5e.ru", "meil.tk",
17 "yanbex.gq",
18 "yanbex.ga", "afeg.ru", "googlie.gq", "keerpich.ru", "meil.ga", "allmail.gq", "ourmail.gq",
19 "allsso.xyz", "youmail.monster", "zamb.ga", "googlie.gq"]
20 self.standart_domain = "yanbex.ga"
21 if type(key_api) == str:
22 self.key_api = key_api
23 self.headers = {
24 'x-rapidapi-key': self.key_api,
25 'x-rapidapi-host': "temporary-mail-afeg-ru.p.rapidapi.com"
26 }
27
28 def create_email(self, domen):
29 """Возвращает данные почты (адресс)"""
30 if type(domen) == str and domen is not None:
31 data = {"domain": domen}
32 else:
33 raise ValueError("Параметр domen должен быть str и != null")
34 try:
35 response = requests.get("https://temporary-mail-afeg-ru.p.rapidapi.com/api/create", headers=self.headers,
36 params=data)
37 return response.text
38 except:
39 raise ValueError("Ошибка при создании почты(отправка запроса на создание)")
40
41 def create_email_random_domain(self):
42 """Создает почту с рондомным доменом"""
43 domen = self.domain[random.randint(0, len(self.standart_domain) - 1)]
44 data = {"domain": domen}
45
46 try:
47 response = requests.get("https://temporary-mail-afeg-ru.p.rapidapi.com/api/create", headers=self.headers,
48 params=data)
49 return response.text
50 except:
51 raise ValueError("Ошибка при создании почты(отправка запроса на создание)")
52
53 def read_email(self, email):
54 """Читает почту и возвращает ссылку на подтверждение почты втопе"""
55 if type(email) == str:
56 data = {"email": email}
57 else:
58 raise ValueError("Параметр email должен быть str.")
59
60 try:
61 response = requests.get("https://temporary-mail-afeg-ru.p.rapidapi.com/api/fetch", headers=self.headers,
62 params=data)
63 except:
64 raise ValueError("Произошла ошибка при отправке запроса на чтение почты.")
65 try:
66 result_link = re.findall("https:.+?\"", response.text)
67 if len(result_link) == 1:
68 result_link = result_link[0].replace("\\", "").replace("\"", "")
69 except:
70 raise ValueError("Произошла ошибка при парсинге сообшения от почты")
71 return result_link
72
73
74class Registration_account:
75 def __init__(self):
76 self.session = requests.session()
77 self.head = {
78 'User-Agent': 'Mozilla/5.0'}
79 self.alphabet = string.ascii_letters + string.digits
80
81 def email_confirmation_request(self):
82 """Отправляет запрос на подверджение почты"""
83 url = "https://vto.pe/webapi/register_resend"
84 data = {
85 "source": "modal"
86 }
87 response = self.session.post(url, json=data, headers=self.head)
88 return response.status_code
89
90 def generation_password(self, length):
91 """Генератор паролей"""
92 if type(length) == int:
93 return ''.join(secrets.choice(self.alphabet) for _ in range(length))
94
95 def confirm_link_for_email(self, link_for_confirm):
96 """Подтверждает ссылку полученную при парсинге почты."""
97 if type(link_for_confirm) == str:
98 response = self.session.get(link_for_confirm)
99 if response.status_code == 200:
100 return True, self.session
101 else:
102 raise ValueError("Произошла ошибка при подтверждении почты")
103
104 def give_api_key(self, password):
105 """Получает родной user. Меняет api key в аккаунте,в ответ получает новый api key."""
106 response = self.session.get("https://vto.pe/docs/api/?tab=api-tasks").text
107 id_user = re.findall('"user": \d\d\d\d\d\d\d', response)
108 if len(id_user) == 1:
109 id_user = id_user[0].replace('"user": ', "")
110 response = self.session.post("https://vto.pe/webapi/key/change", json={"password": password},
111 headers=self.head).text
112 key = json.loads(response)["key"]
113 return id_user, key
114
115 return False
116
117 def registration(self, email, password):
118 """Регестрирует аккаунт по введеным данным"""
119 if type(email) == str and type(password) == str:
120 try:
121 url = "https://vto.pe/webapi/new/register"
122 json_for_vtope_reg = {"email": email, "password": password, "checkbox": True, "captcha": ""}
123 response = self.session.post(url, json=json_for_vtope_reg, headers=self.head)
124
125 if response.status_code == 200:
126 return True
127 if response.status_code == 400:
128 return False
129 except:
130 raise ValueError("Произошла ошибка при регистрации")
131
132class Vtope_api (Registration_account):
133 def __init__(self):
134 pass
135 def cheating_on_instagram(self):
136 def cheating_follower():
137 pass
138def main(api_key_email):
139 vtope = Registration_account()
140 email = Email(api_key_email)
141 email_adress = email.create_email_random_domain()
142 password = vtope.generation_password(10)
143 status = vtope.registration(email_adress, password)
144 if status == False:
145
146 return {
147 "status": status,
148 "email": email_adress,
149 "password": password,
150 }
151 vtope.email_confirmation_request()
152 time.sleep(3)
153 link = email.read_email(email_adress)
154 status, session = vtope.confirm_link_for_email(link_for_confirm=link)
155 id_user, api_key_vtope_account = vtope.give_api_key(password)
156
157 result={
158 "status": status,
159 "email": email_adress,
160 "password": password,
161 "API": {"ID USER": id_user, "API KEY": api_key_vtope_account}
162 }
163 return result
164def write_result(result):
165 try:
166 json_file = json.dumps(result, ensure_ascii=False)
167 with open(rf"{os.path.expanduser('~/Desktop')}/registr.txt", "a") as file:
168 file.write(json_file + "\n")
169 return True
170 except:
171 return False
172if __name__ == '__main__':
173 while True:
174 try:
175 result = main("c80355cc90msh4bea59a81fee35ep1c8ff0jsn98b936907308")
176 if result["status"] == False:
177 print(
178 f"Status-{result['status']}\nПочта-{result['email']}\nПароль-{result['password']}\nБлок на регестрацию,ждем 240 сек")
179 time.sleep(240)
180 if result["status"] == True:
181 result_write = write_result(result)
182 if result_write == True:
183 print(
184 f"Аккаунт зарегистрирован и записан успешно\n"
185 f"Status-{result['status']}\nПочта-{result['email']}\nПароль-{result['password']}\nid-{result['API']['ID USER']}\nAPI-KEY-{result['API']['API KEY']}")
186 except:
187 pass