Check clients using python Curl

Asked

Viewed 41 times

1

I have a list in . txt in the email|password format of my clients and want to check the integrity of some registrations. I wanted to create a variable that would take line by line from txt and change the email and password on the Curl payload. For example, it reads . txt and test the entries one by one, line by line, automatically. example:

file.txt

[email protected]|123
[email protected]|456
[email protected]|789

No payload Curl will look like this (an example):

payload = "username=variavel1&password=variavel2&clientVersion=2.4.9-undefined"

The variable1 would be the email, already the variable 2 the password of the client, in the case of the first client would be more or less like this:

payload = "[email protected]&password=123&clientVersion=2.4.9-undefined"

1 answer

0


with open('file.txt', 'r') as fd:
    for linha in fd.readlines():
        user, pwd = linha.strip().split('|')
        payload = "username={}&password={}&clientVersion=2.4.9-undefined".format(user, pwd)
        print(payload)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.