From 6e65f429942edaff9112c5964aaa33e2f511b86d Mon Sep 17 00:00:00 2001 From: PBadicean Date: Tue, 26 Sep 2023 13:06:35 +0300 Subject: [PATCH] add params for turnstile method --- README.md | 11 ++++++++--- lib/api_2captcha/client.rb | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 26b86d2..a63f05c 100644 --- a/README.md +++ b/README.md @@ -273,11 +273,16 @@ result = client.lemin({ ``` ### Cloudflare Turnstile -Use this method to solve Cloudflare Turnstile. Returns JSON with the token. +Use this method to solve Cloudflare Turnstile. Returns JSON with the token and User-Agent. ```ruby result = client.turnstile({ - sitekey: '0x1AAAAAAAAkg0s2VIOD34y5', - pageurl: 'http://mysite.com/' + sitekey: "0x0AAAAAAADnPIDROzbs0Aaj", + data: "7fab0000b0e0ff00", + pagedata: "3gAFo2...0ME1UVT0=", + pageurl: "https://2captcha.com/", + action: "managed", + userAgent: "Mozilla/5.0 ... Chrome/116.0.0.0 Safari/537.36", + json: 1 }) ``` diff --git a/lib/api_2captcha/client.rb b/lib/api_2captcha/client.rb index 29b6c4b..393c3e2 100644 --- a/lib/api_2captcha/client.rb +++ b/lib/api_2captcha/client.rb @@ -27,7 +27,7 @@ def initialize(api_key, soft_id = 0, callback = nil) @domain = DEFAULT_DOMAIN end - def solve(method, file_path = nil, return_id: false, **params) + def solve(method, return_id: false, **params) params = params.transform_keys(&:to_s) params["method"] = method params["key"] = @api_key