K
K
K1NDER2021-02-12 18:01:55
Python
K1NDER, 2021-02-12 18:01:55

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:
602697eb687af391128482.png

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)

But the code still comes from VKcom, maybe I'm missing something?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
P
Puma Thailand, 2021-02-13
@opium

And what difference do you take from VK

S
sergeyfilippov4, 2021-02-13
@sergeyfilippov4

First, put ALL parameters into the values ​​dictionary

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question