cubicbyte / reddit-account-generator

Automatically generate reddit accounts
MIT License
62 stars 13 forks source link

[SUGGESTION] Use requests. #9

Open Mouad-scriptz opened 1 year ago

Mouad-scriptz commented 1 year ago

use requests

cubicbyte commented 1 year ago

I'm a little confused about your issue

If you propose to use pure requests instead of selenium, it is impossible because of reddit protection.

Mouad-scriptz commented 1 year ago

I know this might sound like a lot, but Reddit's security measures are quite weak. They only check headers, and if you're using Chrome with TLS, they also inspect cookies and a hidden csrf_token on the page's html (/register). The most challenging part is solving the reCAPTCHA. nothing other then that

Mouad-scriptz commented 1 year ago

I would say just give it a try.

Mouad-scriptz commented 1 year ago

Also im not hating or anything your project is good but using requests would make it much faster and efficient.

cubicbyte commented 1 year ago

The most challenging part is solving the reCAPTCHA. nothing other then that

That's exactly what I'm talking about

First of all, in order to invoke captcha at all, you can't just make a request to some URL. That query is generated by a ton of JS loaded by google, which needs to be interpreted, not parsed.

Second, the same applies to the captcha page itself. At least I haven't found any opensource solution for solving captchas this way.

So even if it is possible to do it, I won't be able to do it, I've already tried in other projects

Mouad-scriptz commented 1 year ago

You could just solve the recaptcha alone and get the captcha key that would be faster

ZakariaMQ commented 1 year ago

I have made accounts creator completely using HTTPx lib but the accounts get suspended quickly

cubicbyte commented 1 year ago

@ZakariaMQ How did you do it? Let me guess, just by skipping the captcha solving step? Because if so, it's still unclear how to implement registration only on http requests

ZakariaMQ commented 1 year ago

yeah, I did it without skipping the captcha. It got solved using the 2Captcha service I used the post request to sign up and verify email all using httpx but the accounts got banned in a matter of hours

now I just need to figure out why accounts get suspended even if all headers are correct and so on

Mouad-scriptz commented 1 year ago

yeah, I did it without skipping the captcha. It got solved using the 2Captcha service I used the post request to sign up and verify email all using httpx but the accounts got banned in a matter of hours

  • I did this on the new Reddit

now I just need to figure out why accounts get suspended even if all headers are correct and so on

httpx is detected

ZakariaMQ commented 1 year ago

I tried both httpx and requests but same results

IqBroly commented 1 year ago

I have created this account generator using only python requests, I needed to use captcha solving servuce

IqBroly commented 1 year ago

code

   def solve_recaptcha(site_key, page_url):
        # Submit the reCAPTCHA task to 2Captcha
        response = requests.post(
            'http://2captcha.com/in.php',
            data={
                'key': API_KEY,
                'method': 'userrecaptcha',
                'googlekey': site_key,
                'pageurl': page_url,
                'json': 1
            }
        )

# Parse the API response
response_data = response.json()
if response_data['status'] == 1:
    task_id = response_data['request']

    # Poll for the solution
    while True:
        solution_response = requests.get(
            'http://2captcha.com/res.php',
            params={
                'key': API_KEY,
                'action': 'get',
                'id': task_id,
                'json': 1
            }
        )

        solution_data = solution_response.json()
        if solution_data['status'] == 1:
            return solution_data['request']
        elif solution_data['status'] == 0:
            if solution_data['request'] == 'CAPCHA_NOT_READY':
                # Wait for a few seconds before polling again
                time.sleep(3)
            else:
                raise Exception('Error solving reCAPTCHA: ' + solution_data['request'])

else:
    raise Exception('Error submitting reCAPTCHA task: ' + response_data['request'])
ZakariaMQ commented 1 year ago

this is just a captcha solver which I made in 20 lines of code the important thing is to make accounts live and not get banned after a few hours

Ousret commented 11 months ago

How about trying Niquests instead? It leverages a true HTTP/2 and HTTP/3 connection with multiplexing. If speed matters.