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

Can this resolve datadome captcha as well? #105

Open
miroshar-success opened this issue Sep 12, 2024 · 1 comment
Open

Can this resolve datadome captcha as well? #105

miroshar-success opened this issue Sep 12, 2024 · 1 comment

Comments

@miroshar-success
Copy link

I am going to bypass datadome captcha using anticaptcha service.
Please let me know if this can solve datadome captcha too.
image

@miroshar-success
Copy link
Author

miroshar-success commented Sep 12, 2024

from anticaptchaofficial.geetestproxyon import *
from seleniumwire import webdriver # Import from seleniumwire to capture requests
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.chrome.options import Options
from webdriver_manager.chrome import ChromeDriverManager
import time

chrome_options = Options()
chrome_options.add_argument('--headless') # Run in headless mode
chrome_options.add_argument('--disable-gpu')
chrome_options.add_argument('--ignore-certificate-errors')
chrome_options.add_argument("--disable-proxy-certificate-handler")
chrome_options.add_argument("--disable-content-security-policy")

service = Service(ChromeDriverManager().install())
driver = webdriver.Chrome(service=service, options=chrome_options)
driver.request_storage = False

driver.get('https://mygift.giftcardmall.com') # Replace with the actual URL

time.sleep(5)

captcha_id = None
challenge = None

for request in driver.requests:
if 'captcha-delivery.com' in request.url:
print('Geetest CAPTCHA request found:', request.url)
# Extract the "cid" (captcha ID) and "hash" (challenge) from the URL query parameters
captcha_id = request.params.get('cid')
challenge = request.params.get('hash')

    if captcha_id and challenge:
        print('Captcha ID (gt):', captcha_id)
        print('Challenge:', challenge)
        break

if captcha_id and challenge:
solver = geetestProxyon()
solver.set_verbose(1)
solver.set_key("api_key")
solver.set_website_url("https://mygift.giftcardmall.com")

solver.set_gt_key(captcha_id)
solver.set_challenge_key(challenge)
solver.set_init_parameters({"riskType": "slide"})

solver.set_proxy_address("server_address")
solver.set_proxy_port(port)
solver.set_proxy_login("proxylogin")
solver.set_proxy_password("proxypassword")

solver.set_user_agent("Mozilla/5.0")

token = solver.solve_and_return_solution()

if token != 0:
    print("Result tokens: ")
    print(token)
else:
    print("Task finished with error: " + solver.error_code)

else:
print("Captcha ID or challenge not found.")

driver.quit()

I get this error.
API error ERROR_INCORRECT_SESSION_DATA: Some of the required values for successive user emulation are missing. . GT key '_54PcBZ6y_aJn5uVMTnbl2vkEgORzSSeLGZy0rPvak_vX6QzNGPDTG8GpSWYW6HMHUJRwxLW7_9zOg1R83uFbGysj_3CYFZqoQhyHGEFRvR5gxiS9fi3P7wUG4J5Ca' is invalid.
Task finished with error: ERROR_INCORRECT_SESSION_DATA

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

1 participant