Can't get Python Requests based Reddit account generator to work.

Hydrowaterboy

Newbie
Joined
Jun 18, 2021
Messages
1
Reaction score
0
Hi all,

I am trying to create a Reddit account creator based on Python requests (to save bandwidth resources).
Below is a brief summary of what my code does. Btw I am using rotating proxies which I lock in for each requests.session()

1. start an requests.session() instance.
2. update the session headers with the following parameters:
s.headers.update({
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.101 Safari/537.36",
"accept": "*/*",
"accept-encoding": "gzip, deflate, br",
"accept-language": "en-US,en;q=0.9",
"content-type": "application/x-www-form-urlencoded",
"origin": "https://www.reddit.com",
"referer": "https://www.reddit.com/register/",
"sec-ch-ua": '" Not;A Brand";v="99", "Google Chrome";v="91", "Chromium";v="91"',
"sec-ch-ua-mobile": "?0",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin"
})

3. GET request on https://www.reddit.com
I do this so that I can pass cookies from the main page to the register page. I am passing the cookies to each next request on reddit.com

4. GET request on https://www.reddit.com/register/
On this page I find the crsf token and recaptcha key.

5. POST request to https://www.reddit.com/check_email
The csrf token and email are posted along with this request.
This request also updates the cookies in the process.

6. Solve recaptcha through paid API. I do not use the cookies from this request for subsequent requests.

7. POST request to https://www.reddit.com/check_username
I pass along the csrf token and username.

8. Final POST request to https://www.reddit.com/register/
I pass along the csrf token, recaptcha response, email, username, password, dest = https://www.reddit.com, email_permission = false and lang = en_US.

The problem is that the final POST request returns a 404. I am not sure what the problem is.
I did notice along with each step POST requests were made to https://events.reddit.com/v2. I am not sure what this does and if it is crucial or not.

I am wondering if any of you guys have more experience in this type of stuff, perhaps specific to reddit as well.

Thanks in advance!
 
Back
Top