Answer the question
In order to leave comments, you need to log in
What is the best way to make a request?
In general, I wrote an account creator for VK, but there was such a problem, I get the code from the sender "VKcom", but I'm trying to do it from the recipient MailRu, for this registration must go through " https://connect.vk.com/auth?app_id=7539952&uuid =z4... "
I went through the HTTP Analyzer and saw the following request:
" https://api.vk.com/method/auth.validatePhone?v=5.1... "
With the following parameters:
I threw the following code:
def auth(self):
self.http.cookies.clear()
s = requests.session()
s.get("https://connect.vk.com/auth?app_id=7539952&uuid=z4Ux2VA69maUr9D5bbkOm&origin=https%3A%2F%2Faccount.mail.ru&v=0.0.2")
values = {
'device_id': random.random(),
'lang': 'en',
'phone': self.login,
'auth_token': 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzaWQiOiIwMjg4ZjFkNTA0ZjFlYWQyZDZkNWQ0MzZiODk1ZDdkZiIsImhhc2giOiI3NTJmZDg5NmY3OGIyMmRjIiwiZXhwIjoxNjEzMTMwMjI1fQ.sFjFB0IBWrXK5u3tmTxh1BeUsUTOEffYP0bSQgKoBPM',
'sid': '',
'access_token': ''
}
response = s.post('https://api.vk.com/method/auth.validatePhone?v=5.123&app_id=7539952&uuid=z4Ux2VA69maUr9D5bbkOm&origin=https%3A%2F%2Faccount.mail.ru', data=values)
print(values)
return print(response.text)
Answer the question
In order to leave comments, you need to log in
First, put ALL parameters into the values dictionary
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question