I'm trying to login to twitter using just requests but I don't think I'm building the correct login response. I pass in the guest token but am I missing anything else? Am I using the correct URL? What am I doing wrong? And also how would I tell if I successfully login this way - with my current iteration I get a 200 status code but I'm 100% sure it's not from me successfully logging in.
import requests
headers = {
'accept': '*/*',
'authorization': public_bearer,
'content-type': 'application/json',
'referer': 'https://twitter.com/',
'user-agent': user_agent,
'x-guest-token': guest_token
}
data = {
'username': username,
'password': password
}
r = requests.post('https://twitter.com/login', headers=headers, data=data)
print(r.status_code)
print(r.headers)
edit: the question is more along the lines of how the request flow is supposed to be built