Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SUGGESTION] Use requests. #9

Open
Mouad-scriptz opened this issue Sep 7, 2023 · 15 comments
Open

[SUGGESTION] Use requests. #9

Mouad-scriptz opened this issue Sep 7, 2023 · 15 comments

Comments

@Mouad-scriptz
Copy link

use requests

@cubicbyte
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

I would say just give it a try.

@Mouad-scriptz Mouad-scriptz changed the title use requests [SUGGESTION] Use requests. Sep 7, 2023
@Mouad-scriptz
Copy link
Author

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

@cubicbyte
Copy link
Owner

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
Copy link
Author

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

@ZakariaMQ
Copy link

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

@cubicbyte
Copy link
Owner

@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
Copy link

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

@Mouad-scriptz
Copy link
Author

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
Copy link

I tried both httpx and requests but same results

@IqBroly
Copy link

IqBroly commented Oct 12, 2023

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

@IqBroly
Copy link

IqBroly commented Oct 12, 2023

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
Copy link

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
Copy link

Ousret commented Dec 15, 2023

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants