C
C
C0COK2021-07-25 16:46:10
Python
C0COK, 2021-07-25 16:46:10

How to correctly register on the site?

Actually, I need to execute a registration request on the site: yoomoney.ru, I studied the sniffer and this is what I managed to find out:
1. Cookies do not affect the request in any way
2. Third-party requests, for example, to api.amplitude.com also do not affect requests
3. execution of requests through the firefox browser sms comes, but through third-party software - no.
I tried to perform a similar request for 2 delphi / python languages, but it still does not work out, why I don’t know. The point is that I get a positive result, they say the code has been sent, and so on. etc., but there is no code, but through the browser - there is.
I take numbers on the site with a temporary issue, help me find out the reason

import requests

def pars(T_, ForS, _T):
    if (T_=='') or (ForS=='') or (_T==''):
        return ''
    try:
        indexT_ = ForS.index(T_)
        ForS1 = ForS[indexT_+len(T_):]
        index_T = ForS1.index(_T)
        res = ForS1[:index_T]
        return res
    except:
        return ''

s = requests.session()
response = s.get('https://yoomoney.ru/reg?_openstat=nezalogin;reg;main',verify=False).text
csrf =  pars('__secretKey__="',response,'"')
sessionID = pars('sessionId":"',response,'"')

HEADER = {
    'x-csrf-token': csrf,
    'Content-Type':'application/json;charset=utf-8',
    'user-agent':'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36'
}
request = {'origin':'Wallet','tmxSessionId': sessionID}
url = 'https://yoomoney.ru/yooid/signup/api/start'
response = s.post(url=url,json=request,headers=HEADER,verify=False).text

registrationId = pars('registrationId":"',response,'"')
request = {"registrationId":registrationId,"countryCode":"RU","phoneNumber":"9623635182"}
url = 'https://yoomoney.ru/yooid/signup/api/phone/set'
response = s.post(url=url,json=request,headers=HEADER,verify=False).text

url = 'https://yoomoney.ru/yooid/signup/api/phone/code/send'
request = {"contextId":registrationId}
response = s.post(url=url,json=request,headers=HEADER,verify=False).text
print(response)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2021-07-25
@dimonchik2013

get Postman om, transfer to Python

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question