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

Posible captcha response? #25

Open
mrbluebrett opened this issue Oct 16, 2024 · 2 comments
Open

Posible captcha response? #25

mrbluebrett opened this issue Oct 16, 2024 · 2 comments

Comments

@mrbluebrett
Copy link

Encontré este codigo para resolver el recaptcha de google:

https://github.com/Hartman5/recaptchaV3-Bypass/blob/main/index.js

Podria servir no? Intentare a ver si se adaptarlo a python, pero si le quieres echar un ojo aqui tienes...

@aritztg
Copy link

aritztg commented Oct 16, 2024

Con un poco de copilot y algún retoque, esto podría ser un punto de partida:

import re
import requests

anchor_url = 'PUT ANCHOR URL HERE'
url_base = 'https://www.google.com/recaptcha/'
re_pattern = re.compile(r'([api2|enterprise]+)/anchor\?(.*)')
matches = re_pattern.search(anchor_url)
url_base += matches.group(0) + '/'
params = matches.group(1)

response = requests.get(
    url_base + 'anchor',
    headers={'content-type': 'application/x-www-form-urlencoded'},
    params={'params': params}.  # Check this!
)

if response.status_code == 200:
    re_token = re.compile(r'"recaptcha-token" value="(.*?)"')
    token = re_token.search(response.text).group(1)
    params2 = ""
    for pair in params.split('&'):
        params2 += pair.split('=')

    post_data = params2['v'] + token + params2['k'] + params2['co']
    re_key = re.compile(r'value="(.*?)"')
    key = re_key.search(post_data).group(1)
    print(key)
else:
    print(f"Error: {response.status_code}")

@mrestivill
Copy link

Últimamente la web no pide capcha con lo que se podría revisar si el código antiguo funciona de nuevo (el original)

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

3 participants