reddit-account-generator icon indicating copy to clipboard operation
reddit-account-generator copied to clipboard

[SUGGESTION] Use requests.

Open Mouad-scriptz opened this issue 2 years ago • 15 comments

use requests

Mouad-scriptz avatar Sep 07 '23 17:09 Mouad-scriptz

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.

cubicbyte avatar Sep 07 '23 17:09 cubicbyte

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 avatar Sep 07 '23 19:09 Mouad-scriptz

I would say just give it a try.

Mouad-scriptz avatar Sep 07 '23 19:09 Mouad-scriptz

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

Mouad-scriptz avatar Sep 07 '23 19:09 Mouad-scriptz

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

cubicbyte avatar Sep 08 '23 06:09 cubicbyte

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

Mouad-scriptz avatar Sep 19 '23 13:09 Mouad-scriptz

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

ZakariaMQ avatar Oct 03 '23 09:10 ZakariaMQ

@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

cubicbyte avatar Oct 03 '23 15:10 cubicbyte

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

ZakariaMQ avatar Oct 03 '23 17:10 ZakariaMQ

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

Mouad-scriptz avatar Oct 05 '23 09:10 Mouad-scriptz

I tried both httpx and requests but same results

ZakariaMQ avatar Oct 05 '23 09:10 ZakariaMQ

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

IqBroly avatar Oct 12 '23 06:10 IqBroly

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'])

IqBroly avatar Oct 12 '23 06:10 IqBroly

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

ZakariaMQ avatar Oct 12 '23 10:10 ZakariaMQ

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

Ousret avatar Dec 15 '23 10:12 Ousret