t.me/xtekky
commited on
Commit
•
2b30701
1
Parent(s):
f8780b0
poe.com update (still patched)
Browse files- quora/__init__.py +47 -62
- quora/cookies.txt +9 -0
- quora/mail.py +60 -33
- quora/poe_account_create_test.py +104 -0
quora/__init__.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
from quora.api import Client as PoeClient
|
2 |
-
from quora.mail import
|
3 |
from requests import Session
|
|
|
4 |
from re import search, findall
|
5 |
from json import loads
|
6 |
from time import sleep
|
@@ -13,6 +14,9 @@ from hashlib import md5
|
|
13 |
from json import dumps
|
14 |
from pypasser import reCaptchaV3
|
15 |
|
|
|
|
|
|
|
16 |
def extract_formkey(html):
|
17 |
script_regex = r'<script>if\(.+\)throw new Error;(.+)</script>'
|
18 |
script_text = search(script_regex, html).group(1)
|
@@ -157,50 +161,54 @@ class Model:
|
|
157 |
|
158 |
return ModelResponse(response.json())
|
159 |
|
|
|
160 |
class Account:
|
161 |
def create(proxy: None or str = None, logging: bool = False, enable_bot_creation: bool = False):
|
162 |
-
client =
|
163 |
client.proxies = {
|
164 |
'http': f'http://{proxy}',
|
165 |
'https': f'http://{proxy}'} if proxy else None
|
166 |
|
167 |
-
|
168 |
-
|
169 |
-
_, mail_address = mail.get_mail()
|
170 |
-
if mail_address is None:
|
171 |
-
raise Exception('Error creating mail, please use proxies')
|
172 |
|
173 |
if logging: print('email', mail_address)
|
174 |
|
175 |
client.headers = {
|
176 |
-
|
177 |
-
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
-
|
182 |
-
|
183 |
-
|
184 |
-
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
}
|
193 |
|
194 |
client.headers["poe-formkey"] = extract_formkey(client.get('https://poe.com/login').text)
|
195 |
client.headers["poe-tchannel"] = client.get('https://poe.com/api/settings').json()['tchannelData']['channel']
|
196 |
|
197 |
-
token = reCaptchaV3('https://www.recaptcha.net/recaptcha/enterprise/anchor?ar=1&k=6LflhEElAAAAAI_ewVwRWI9hsyV4mbZnYAslSvlG&co=aHR0cHM6Ly9wb2UuY29tOjQ0Mw..&hl=en&v=
|
|
|
|
|
|
|
|
|
|
|
|
|
198 |
|
199 |
payload = dumps(separators = (',', ':'), obj = {
|
200 |
'queryName': 'MainSignupLoginSection_sendVerificationCodeMutation_Mutation',
|
201 |
'variables': {
|
202 |
-
'emailAddress': mail_address,
|
203 |
-
'phoneNumber': None,
|
204 |
'recaptchaToken': token
|
205 |
},
|
206 |
'query': 'mutation MainSignupLoginSection_sendVerificationCodeMutation_Mutation(\n $emailAddress: String\n $phoneNumber: String\n $recaptchaToken: String\n) {\n sendVerificationCode(verificationReason: login, emailAddress: $emailAddress, phoneNumber: $phoneNumber, recaptchaToken: $recaptchaToken) {\n status\n errorMessage\n }\n}\n',
|
@@ -208,33 +216,31 @@ class Account:
|
|
208 |
|
209 |
base_string = payload + client.headers["poe-formkey"] + 'WpuLMiXEKKE98j56k'
|
210 |
client.headers["poe-tag-id"] = md5(base_string.encode()).hexdigest()
|
211 |
-
|
|
|
|
|
212 |
response = client.post('https://poe.com/api/gql_POST', data=payload)
|
|
|
|
|
|
|
|
|
213 |
if 'Bad Request' in response.text:
|
214 |
if logging: print('bad request, retrying...' , response.json())
|
215 |
quit()
|
216 |
|
217 |
if logging: print('send_code' ,response.json())
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
messages = mail.fetch_inbox()
|
222 |
-
|
223 |
-
if len(messages["messages"]) > 0:
|
224 |
-
email_content = mail.get_message_content(messages["messages"][0]["_id"])
|
225 |
-
mail_token = findall(r';">(\d{6,7})</div>', email_content)[0]
|
226 |
-
|
227 |
-
if mail_token:
|
228 |
-
break
|
229 |
|
230 |
if logging: print('code', mail_token)
|
231 |
|
232 |
payload = dumps(separators = (',', ':'), obj={
|
233 |
"queryName": "SignupOrLoginWithCodeSection_signupWithVerificationCodeMutation_Mutation",
|
234 |
"variables": {
|
235 |
-
"verificationCode"
|
236 |
-
"emailAddress"
|
237 |
-
"phoneNumber"
|
238 |
},
|
239 |
"query": "mutation SignupOrLoginWithCodeSection_signupWithVerificationCodeMutation_Mutation(\n $verificationCode: String!\n $emailAddress: String\n $phoneNumber: String\n) {\n signupWithVerificationCode(verificationCode: $verificationCode, emailAddress: $emailAddress, phoneNumber: $phoneNumber) {\n status\n errorMessage\n }\n}\n"
|
240 |
})
|
@@ -244,27 +250,6 @@ class Account:
|
|
244 |
|
245 |
response = client.post('https://poe.com/api/gql_POST', data = payload)
|
246 |
if logging: print('verify_code', response.json())
|
247 |
-
|
248 |
-
token = parse.unquote(client.cookies.get_dict()['p-b'])
|
249 |
-
|
250 |
-
with open(Path(__file__).resolve().parent / 'cookies.txt', 'a') as f:
|
251 |
-
f.write(f'{token}\n')
|
252 |
-
|
253 |
-
if enable_bot_creation:
|
254 |
-
|
255 |
-
payload = dumps(separators = (',', ':'), obj={
|
256 |
-
"queryName": "UserProfileConfigurePreviewModal_markMultiplayerNuxCompleted_Mutation",
|
257 |
-
"variables": {},
|
258 |
-
"query": "mutation UserProfileConfigurePreviewModal_markMultiplayerNuxCompleted_Mutation {\n markMultiplayerNuxCompleted {\n viewer {\n hasCompletedMultiplayerNux\n id\n }\n }\n}\n"
|
259 |
-
})
|
260 |
-
|
261 |
-
base_string = payload + client.headers["poe-formkey"] + 'WpuLMiXEKKE98j56k'
|
262 |
-
client.headers["poe-tag-id"] = md5(base_string.encode()).hexdigest()
|
263 |
-
|
264 |
-
resp = client.post("https://poe.com/api/gql_POST", data = payload)
|
265 |
-
if logging: print(resp.json())
|
266 |
-
|
267 |
-
return token
|
268 |
|
269 |
def get():
|
270 |
cookies = open(Path(__file__).resolve().parent / 'cookies.txt', 'r').read().splitlines()
|
|
|
1 |
from quora.api import Client as PoeClient
|
2 |
+
from quora.mail import Emailnator
|
3 |
from requests import Session
|
4 |
+
from tls_client import Session as TLS
|
5 |
from re import search, findall
|
6 |
from json import loads
|
7 |
from time import sleep
|
|
|
14 |
from json import dumps
|
15 |
from pypasser import reCaptchaV3
|
16 |
|
17 |
+
# from twocaptcha import TwoCaptcha
|
18 |
+
# solver = TwoCaptcha('72747bf24a9d89b4dcc1b24875efd358')
|
19 |
+
|
20 |
def extract_formkey(html):
|
21 |
script_regex = r'<script>if\(.+\)throw new Error;(.+)</script>'
|
22 |
script_text = search(script_regex, html).group(1)
|
|
|
161 |
|
162 |
return ModelResponse(response.json())
|
163 |
|
164 |
+
|
165 |
class Account:
|
166 |
def create(proxy: None or str = None, logging: bool = False, enable_bot_creation: bool = False):
|
167 |
+
client = TLS(client_identifier='chrome110')
|
168 |
client.proxies = {
|
169 |
'http': f'http://{proxy}',
|
170 |
'https': f'http://{proxy}'} if proxy else None
|
171 |
|
172 |
+
mail_client = Emailnator()
|
173 |
+
mail_address = mail_client.get_mail()
|
|
|
|
|
|
|
174 |
|
175 |
if logging: print('email', mail_address)
|
176 |
|
177 |
client.headers = {
|
178 |
+
'authority' : 'poe.com',
|
179 |
+
'accept' : '*/*',
|
180 |
+
'accept-language': 'en,fr-FR;q=0.9,fr;q=0.8,es-ES;q=0.7,es;q=0.6,en-US;q=0.5,am;q=0.4,de;q=0.3',
|
181 |
+
'content-type' : 'application/json',
|
182 |
+
'origin' : 'https://poe.com',
|
183 |
+
'poe-formkey' : 'null',
|
184 |
+
'poe-tag-id' : 'null',
|
185 |
+
'poe-tchannel' : 'null',
|
186 |
+
'referer' : 'https://poe.com/login',
|
187 |
+
'sec-ch-ua' : '"Chromium";v="112", "Google Chrome";v="112", "Not:A-Brand";v="99"',
|
188 |
+
'sec-ch-ua-mobile' : '?0',
|
189 |
+
'sec-ch-ua-platform': '"macOS"',
|
190 |
+
'sec-fetch-dest': 'empty',
|
191 |
+
'sec-fetch-mode': 'cors',
|
192 |
+
'sec-fetch-site': 'same-origin',
|
193 |
+
'user-agent' : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36'
|
194 |
}
|
195 |
|
196 |
client.headers["poe-formkey"] = extract_formkey(client.get('https://poe.com/login').text)
|
197 |
client.headers["poe-tchannel"] = client.get('https://poe.com/api/settings').json()['tchannelData']['channel']
|
198 |
|
199 |
+
token = reCaptchaV3('https://www.recaptcha.net/recaptcha/enterprise/anchor?ar=1&k=6LflhEElAAAAAI_ewVwRWI9hsyV4mbZnYAslSvlG&co=aHR0cHM6Ly9wb2UuY29tOjQ0Mw..&hl=en&v=4PnKmGB9wRHh1i04o7YUICeI&size=invisible&cb=bi6ivxoskyal')
|
200 |
+
# token = solver.recaptcha(sitekey='6LflhEElAAAAAI_ewVwRWI9hsyV4mbZnYAslSvlG',
|
201 |
+
# url = 'https://poe.com/login?redirect_url=%2F',
|
202 |
+
# version = 'v3',
|
203 |
+
# enterprise = 1,
|
204 |
+
# invisible = 1,
|
205 |
+
# action = 'login',)['code']
|
206 |
|
207 |
payload = dumps(separators = (',', ':'), obj = {
|
208 |
'queryName': 'MainSignupLoginSection_sendVerificationCodeMutation_Mutation',
|
209 |
'variables': {
|
210 |
+
'emailAddress' : mail_address,
|
211 |
+
'phoneNumber' : None,
|
212 |
'recaptchaToken': token
|
213 |
},
|
214 |
'query': 'mutation MainSignupLoginSection_sendVerificationCodeMutation_Mutation(\n $emailAddress: String\n $phoneNumber: String\n $recaptchaToken: String\n) {\n sendVerificationCode(verificationReason: login, emailAddress: $emailAddress, phoneNumber: $phoneNumber, recaptchaToken: $recaptchaToken) {\n status\n errorMessage\n }\n}\n',
|
|
|
216 |
|
217 |
base_string = payload + client.headers["poe-formkey"] + 'WpuLMiXEKKE98j56k'
|
218 |
client.headers["poe-tag-id"] = md5(base_string.encode()).hexdigest()
|
219 |
+
|
220 |
+
print(dumps(client.headers, indent=4))
|
221 |
+
|
222 |
response = client.post('https://poe.com/api/gql_POST', data=payload)
|
223 |
+
|
224 |
+
if 'automated_request_detected' in response.text:
|
225 |
+
print('please try using a proxy / wait for fix')
|
226 |
+
|
227 |
if 'Bad Request' in response.text:
|
228 |
if logging: print('bad request, retrying...' , response.json())
|
229 |
quit()
|
230 |
|
231 |
if logging: print('send_code' ,response.json())
|
232 |
+
|
233 |
+
mail_content = mail_client.get_message()
|
234 |
+
mail_token = findall(r';">(\d{6,7})</div>', mail_content)[0]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
235 |
|
236 |
if logging: print('code', mail_token)
|
237 |
|
238 |
payload = dumps(separators = (',', ':'), obj={
|
239 |
"queryName": "SignupOrLoginWithCodeSection_signupWithVerificationCodeMutation_Mutation",
|
240 |
"variables": {
|
241 |
+
"verificationCode": str(mail_token),
|
242 |
+
"emailAddress": mail_address,
|
243 |
+
"phoneNumber": None
|
244 |
},
|
245 |
"query": "mutation SignupOrLoginWithCodeSection_signupWithVerificationCodeMutation_Mutation(\n $verificationCode: String!\n $emailAddress: String\n $phoneNumber: String\n) {\n signupWithVerificationCode(verificationCode: $verificationCode, emailAddress: $emailAddress, phoneNumber: $phoneNumber) {\n status\n errorMessage\n }\n}\n"
|
246 |
})
|
|
|
250 |
|
251 |
response = client.post('https://poe.com/api/gql_POST', data = payload)
|
252 |
if logging: print('verify_code', response.json())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
253 |
|
254 |
def get():
|
255 |
cookies = open(Path(__file__).resolve().parent / 'cookies.txt', 'r').read().splitlines()
|
quora/cookies.txt
CHANGED
@@ -19,3 +19,12 @@ wfUfJIlwQwUss8l-3kDt3w==
|
|
19 |
f6Jw_Nr0PietpNCtOCXJTw==
|
20 |
6Jc3yCs7XhDRNHa4ZML09g==
|
21 |
3vy44sIy-ZlTMofFiFDttw==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
19 |
f6Jw_Nr0PietpNCtOCXJTw==
|
20 |
6Jc3yCs7XhDRNHa4ZML09g==
|
21 |
3vy44sIy-ZlTMofFiFDttw==
|
22 |
+
p9FbMGGiK1rShKgL3YWkDg==
|
23 |
+
pw6LI5Op84lf4HOY7fn91A==
|
24 |
+
QemKm6aothMvqcEgeKFDlQ==
|
25 |
+
cceZzucA-CEHR0Gt6VLYLQ==
|
26 |
+
JRRObMp2RHVn5u4730DPvQ==
|
27 |
+
XNt0wLTjX7Z-EsRR3TJMIQ==
|
28 |
+
csjjirAUKtT5HT1KZUq1kg==
|
29 |
+
8qZdCatCPQZyS7jsO4hkdQ==
|
30 |
+
esnUxcBhvH1DmCJTeld0qw==
|
quora/mail.py
CHANGED
@@ -1,39 +1,66 @@
|
|
1 |
-
import
|
2 |
-
import
|
3 |
-
from
|
4 |
-
|
5 |
-
class Mail:
|
6 |
-
def __init__(self, proxies: str = None, timeout: int = 15, bearer_token: str or None = None) -> None:
|
7 |
-
self.session = Session(client_identifier='chrome110')
|
8 |
-
self.base_url = 'https://web2.temp-mail.org'
|
9 |
-
self.proxies = proxies
|
10 |
-
self.timeout = timeout
|
11 |
-
|
12 |
-
self.session.headers['authorization'] = f'Bearer {bearer_token}' if bearer_token else None
|
13 |
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
data = self.session.post(f'{self.base_url}/mailbox').json()
|
20 |
|
21 |
-
|
22 |
-
|
|
|
|
|
|
|
|
|
|
|
23 |
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
|
31 |
-
def
|
32 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33 |
|
34 |
-
#
|
|
|
35 |
|
36 |
-
# email_client = TempMail()
|
37 |
-
# token, email = email_client.get_mail()
|
38 |
-
# print(email)
|
39 |
-
# print(token)
|
|
|
1 |
+
from requests import Session
|
2 |
+
from time import sleep
|
3 |
+
from re import search, findall
|
4 |
+
from json import loads
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
+
class Emailnator:
|
7 |
+
def __init__(self) -> None:
|
8 |
+
self.client = Session()
|
9 |
+
self.client.get('https://www.emailnator.com/', timeout=6)
|
10 |
+
self.cookies = self.client.cookies.get_dict()
|
|
|
11 |
|
12 |
+
self.client.headers = {
|
13 |
+
'authority' : 'www.emailnator.com',
|
14 |
+
'origin' : 'https://www.emailnator.com',
|
15 |
+
'referer' : 'https://www.emailnator.com/',
|
16 |
+
'user-agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36 Edg/101.0.1722.39',
|
17 |
+
'x-xsrf-token' : self.client.cookies.get("XSRF-TOKEN")[:-3]+"=",
|
18 |
+
}
|
19 |
|
20 |
+
self.email = None
|
21 |
+
|
22 |
+
def get_mail(self):
|
23 |
+
response = self.client.post('https://www.emailnator.com/generate-email',json = {
|
24 |
+
'email': [
|
25 |
+
'domain',
|
26 |
+
'plusGmail',
|
27 |
+
'dotGmail',
|
28 |
+
]
|
29 |
+
})
|
30 |
+
|
31 |
+
self.email = loads(response.text)["email"][0]
|
32 |
+
return self.email
|
33 |
|
34 |
+
def get_message(self):
|
35 |
+
print("waiting for code...")
|
36 |
+
|
37 |
+
while True:
|
38 |
+
sleep(2)
|
39 |
+
mail_token = self.client.post('https://www.emailnator.com/message-list',
|
40 |
+
json = {'email': self.email})
|
41 |
+
|
42 |
+
mail_token = loads(mail_token.text)["messageData"]
|
43 |
+
|
44 |
+
if len(mail_token) == 2:
|
45 |
+
print(mail_token[1]["messageID"])
|
46 |
+
break
|
47 |
+
|
48 |
+
mail_context = self.client.post('https://www.emailnator.com/message-list', json = {
|
49 |
+
'email' : self.email,
|
50 |
+
'messageID': mail_token[1]["messageID"],
|
51 |
+
})
|
52 |
+
|
53 |
+
return mail_context.text
|
54 |
+
|
55 |
+
# mail_client = Emailnator()
|
56 |
+
# mail_adress = mail_client.get_mail()
|
57 |
+
|
58 |
+
# print(mail_adress)
|
59 |
+
|
60 |
+
# mail_content = mail_client.get_message()
|
61 |
+
|
62 |
+
# print(mail_content)
|
63 |
|
64 |
+
# code = findall(r';">(\d{6,7})</div>', mail_content)[0]
|
65 |
+
# print(code)
|
66 |
|
|
|
|
|
|
|
|
quora/poe_account_create_test.py
ADDED
@@ -0,0 +1,104 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from requests import Session
|
2 |
+
from tls_client import Session as TLS
|
3 |
+
from json import dumps
|
4 |
+
from hashlib import md5
|
5 |
+
from time import sleep
|
6 |
+
from re import findall
|
7 |
+
from pypasser import reCaptchaV3
|
8 |
+
from quora import extract_formkey
|
9 |
+
from quora.mail import Emailnator
|
10 |
+
from twocaptcha import TwoCaptcha
|
11 |
+
|
12 |
+
solver = TwoCaptcha('72747bf24a9d89b4dcc1b24875efd358')
|
13 |
+
|
14 |
+
class Account:
|
15 |
+
def create(proxy: None or str = None, logging: bool = False, enable_bot_creation: bool = False):
|
16 |
+
client = TLS(client_identifier='chrome110')
|
17 |
+
client.proxies = {
|
18 |
+
'http': f'http://{proxy}',
|
19 |
+
'https': f'http://{proxy}'} if proxy else None
|
20 |
+
|
21 |
+
mail_client = Emailnator()
|
22 |
+
mail_address = mail_client.get_mail()
|
23 |
+
|
24 |
+
if logging: print('email', mail_address)
|
25 |
+
|
26 |
+
client.headers = {
|
27 |
+
'authority' : 'poe.com',
|
28 |
+
'accept' : '*/*',
|
29 |
+
'accept-language': 'en,fr-FR;q=0.9,fr;q=0.8,es-ES;q=0.7,es;q=0.6,en-US;q=0.5,am;q=0.4,de;q=0.3',
|
30 |
+
'content-type' : 'application/json',
|
31 |
+
'origin' : 'https://poe.com',
|
32 |
+
'poe-formkey' : 'null',
|
33 |
+
'poe-tag-id' : 'null',
|
34 |
+
'poe-tchannel' : 'null',
|
35 |
+
'referer' : 'https://poe.com/login',
|
36 |
+
'sec-ch-ua' : '"Chromium";v="112", "Google Chrome";v="112", "Not:A-Brand";v="99"',
|
37 |
+
'sec-ch-ua-mobile' : '?0',
|
38 |
+
'sec-ch-ua-platform': '"macOS"',
|
39 |
+
'sec-fetch-dest': 'empty',
|
40 |
+
'sec-fetch-mode': 'cors',
|
41 |
+
'sec-fetch-site': 'same-origin',
|
42 |
+
'user-agent' : 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36'
|
43 |
+
}
|
44 |
+
|
45 |
+
client.headers["poe-formkey"] = extract_formkey(client.get('https://poe.com/login').text)
|
46 |
+
client.headers["poe-tchannel"] = client.get('https://poe.com/api/settings').json()['tchannelData']['channel']
|
47 |
+
|
48 |
+
#token = reCaptchaV3('https://www.recaptcha.net/recaptcha/enterprise/anchor?ar=1&k=6LflhEElAAAAAI_ewVwRWI9hsyV4mbZnYAslSvlG&co=aHR0cHM6Ly9wb2UuY29tOjQ0Mw..&hl=en&v=4PnKmGB9wRHh1i04o7YUICeI&size=invisible&cb=bi6ivxoskyal')
|
49 |
+
token = solver.recaptcha(sitekey='6LflhEElAAAAAI_ewVwRWI9hsyV4mbZnYAslSvlG',
|
50 |
+
url = 'https://poe.com/login?redirect_url=%2F',
|
51 |
+
version = 'v3',
|
52 |
+
enterprise = 1,
|
53 |
+
invisible = 1,
|
54 |
+
action = 'login',)['code']
|
55 |
+
|
56 |
+
payload = dumps(separators = (',', ':'), obj = {
|
57 |
+
'queryName': 'MainSignupLoginSection_sendVerificationCodeMutation_Mutation',
|
58 |
+
'variables': {
|
59 |
+
'emailAddress' : mail_address,
|
60 |
+
'phoneNumber' : None,
|
61 |
+
'recaptchaToken': token
|
62 |
+
},
|
63 |
+
'query': 'mutation MainSignupLoginSection_sendVerificationCodeMutation_Mutation(\n $emailAddress: String\n $phoneNumber: String\n $recaptchaToken: String\n) {\n sendVerificationCode(verificationReason: login, emailAddress: $emailAddress, phoneNumber: $phoneNumber, recaptchaToken: $recaptchaToken) {\n status\n errorMessage\n }\n}\n',
|
64 |
+
})
|
65 |
+
|
66 |
+
base_string = payload + client.headers["poe-formkey"] + 'WpuLMiXEKKE98j56k'
|
67 |
+
client.headers["poe-tag-id"] = md5(base_string.encode()).hexdigest()
|
68 |
+
|
69 |
+
print(dumps(client.headers, indent=4))
|
70 |
+
|
71 |
+
response = client.post('https://poe.com/api/gql_POST', data=payload)
|
72 |
+
|
73 |
+
if 'automated_request_detected' in response.text:
|
74 |
+
print('please try using a proxy / wait for fix')
|
75 |
+
|
76 |
+
if 'Bad Request' in response.text:
|
77 |
+
if logging: print('bad request, retrying...' , response.json())
|
78 |
+
quit()
|
79 |
+
|
80 |
+
if logging: print('send_code' ,response.json())
|
81 |
+
|
82 |
+
mail_content = mail_client.get_message()
|
83 |
+
mail_token = findall(r';">(\d{6,7})</div>', mail_content)[0]
|
84 |
+
|
85 |
+
if logging: print('code', mail_token)
|
86 |
+
|
87 |
+
payload = dumps(separators = (',', ':'), obj={
|
88 |
+
"queryName": "SignupOrLoginWithCodeSection_signupWithVerificationCodeMutation_Mutation",
|
89 |
+
"variables": {
|
90 |
+
"verificationCode": str(mail_token),
|
91 |
+
"emailAddress": mail_address,
|
92 |
+
"phoneNumber": None
|
93 |
+
},
|
94 |
+
"query": "mutation SignupOrLoginWithCodeSection_signupWithVerificationCodeMutation_Mutation(\n $verificationCode: String!\n $emailAddress: String\n $phoneNumber: String\n) {\n signupWithVerificationCode(verificationCode: $verificationCode, emailAddress: $emailAddress, phoneNumber: $phoneNumber) {\n status\n errorMessage\n }\n}\n"
|
95 |
+
})
|
96 |
+
|
97 |
+
base_string = payload + client.headers["poe-formkey"] + 'WpuLMiXEKKE98j56k'
|
98 |
+
client.headers["poe-tag-id"] = md5(base_string.encode()).hexdigest()
|
99 |
+
|
100 |
+
response = client.post('https://poe.com/api/gql_POST', data = payload)
|
101 |
+
if logging: print('verify_code', response.json())
|
102 |
+
|
103 |
+
|
104 |
+
Account.create(proxy = 'xtekky:[email protected]:12321', logging = True)
|