Python, Java ?? C++ ?? ????? ???? reCAPTCHA ?? ?? ????

Rajinder Singh
Deep Learning Researcher
25-Oct-2024

?? ????? ???? ??? reCAPTCHA ?? ??? ??? ???? ???? ????, ?? ????? ??? ?????? ????? ????? ?? ??, ?? ????? ?? ????? ?? ??? ???? ????? ??, ????? ????? ??, ?? ??? ??????? ?????????? ?? ??? ?? ???? ???? ?? ???? ??? ?? ?? ??? ???, ??? ???? ??? ????????? ???????????? ??????: ?????, ???? ?? ??++ ?? ????? ???? reCAPTCHA ?? ?? ???? ?? ?????? ?? ?????????? ??????? ???????? ???? reCAPTCHA ????????? ?? ??????? ?? ??? ???? ????? ?? ????? ???? ??, ?? ???? ???????? ?? ?????????? ?? ???? ?? ??????? ?????? ???? ??? ?? ??? ??????? ??? ???? ????? ?? ???-??? CAPTCHA ?? reCAPTCHA ???? ???, ??? ????? ?????? ???????
CAPTCHA ???? ???
??? ???? ???????? ??????? ?? ???? ????: CAPTCHA, ?? "???????? ?? ???????? ?? ??? ???? ?? ??? ???? ??? ?? ???????? ????????? ???????? ???????", ?? ???? ???????????? ?? ????? ?? ??? ???? ???? ?? ?? ??????? ????? ??? ?? ????????? ?? ???????? ?????, ????? ?? ???? ?? ???? ??? ??? ???? ??, ???????????? ?? ??? ????? ?? ???? ?? ???????? ???? ?? ?? ???????? ?? ??? ???? ???? ??? ????? ?????? ?? ??? ???? ???? ???? ?? ????? ??????? ?? ???????, ??????? ??????? ???? ?????? ?? ??? ???? ?? ???? ????? ?? ?? ???? ?? ???? ???
reCAPTCHA ???? ???
reCAPTCHA Google ?????? ?????? ?? ???? ?? ?? ????? ?? ???????? ?? ????????? ?? ??????? ??? ??? ???? ??, ???? ???????????? ?? ????? ?? ??? ???? ??? ?? ??? ?? ??? ??????? ????????? ??? ?????? ??? ??, ???????? ??????? ???????? ?????? ???? ???
-
reCAPTCHA v2: ?? ???? ?? ??? ?? ???? ?????????? ???????? ("??? ????? ???? ???") ?? ????? ???? ?? ?????? ?? ??? ???? ???? ????? ?? ???? ???? ?? ???? ?????????? ?? ?????? ?? ????? ??? ?? ????? ?????? ?? ???? ?? ?? ?????? ????????? ?? ???? ???
-
reCAPTCHA v3: ?? ??????? ???????????? ?? ????? ??? ???? ????????? ??? ?????? ??? ?? ???? ??? ?? ?????????? ??????? ?? ???? ?? ????? ????? (0.0 ?? 1.0) ????? ???? ??? ?? ????? ???? ?????????? ???? ???? ?????? ?? ??? ?? ???? ???, ???? ??????? ??????? ??????? ????? ?? ?????? ?? ???? ???
-
reCAPTCHA Enterprise: ???????????-?????? ??????? ?? ??? ??????? ???? ???, ?? ??????? ???? ????????? ?? ??? ????? ??????? ???????? ?????? ???? ??? ?? ????-????? ???? ?????? ?? ??? ???????? ????? ????????, ???? ??????? ???? ?? ?????-?????? ????????? ?????? ???? ??, ?????? ??????? ??????? ?????????? ?? ???? ???? ?? ??? ???? ??????? ???? ???
????? ?? ???????? ??????? ?? ???????? ?????? ??????? ?????? ???? ?? ???? ??? ???????????? ?? ??? ????? ?? ?? ????, ????? ?? ????? ?? ????? ???????? ?? ?????? ???? ???
- reCAPTCHA v2 ????
reCAPTCHA v2 ???? ?????- reCAPTCHA v3 ????
reCAPTCHA v3 ???? ?????- reCAPTCHA Enterprise ????
reCAPTCHA Enterprise ?? ???? ??? ?? ?????
?????, ???? ?? ??++ ??? reCAPTCHA ?? ?? ????
???????? ???? reCAPTCHA ????????? ?? ??????? ?? ????? ??? ???????? ???? ?????? ???? ??:
-
????? ???? ????? ?? ???? ??????????? ?? ??? ???? ???? ?? ?? ??? ??????? ?? ???? ?????????? ?? ?????? ?????? ???? ???? ???????? ?? ???????? ???? ??????????? ?? ????? ????, ?? ????? ?? ???????? ??????? ?? ???????? ?? ???? ??? ?? ???? ??????? ?? ??? CAPTCHA ?? ?????? ?? ???? ????
-
???? ???????????-?????? ??????????? ?? ?????-??????????? ?????????? ?? ??? ???? ????? ??? ???????? ?????????? ???? ???? ????????????? ???????? ?? ????? ???????? ?????? ??? ??? reCAPTCHA ???????? ?? ?????? ???? ????
-
??++ ???????? ??? ?????? ???? ??, ?? ??? ?? ?????????? ?? ??? ????? ????? ?? ????? ??? ??? ?? ?? ??????? ?? ???????? ???? ??? ??????? ??????? ?? ??? ?? ????????? ????? ???? ???? ??, ??? reCAPTCHA ????????? ?? ????-???????? ???? ????????? ??? ?? ???? ?? ??? ???? ??????? ?? ??? ?????? ???? ?? ???? ???
CapSolver ?? ?????
???? ?? ?? ??? ???????, ?? ??????? ?? ?????? ???? ???? ????????? ?? ???????? ?? ???? reCAPTCHA ????????? ?? ?? ???? ??????? ?? ???? ??? ???? ?? CapSolver ??? ??? ?? ?? ????? ???? ?? ?? ???? ?????? ?? ??? reCAPTCHA-?????? ????????? ?? ???????? ???? ??, reCAPTCHA v2, reCAPTCHA v3, ?? ???? ??? ???? ?? CAPTCHA ???????? ?? ??????? ??? ???? ?????, ???? ?? ??++ ???????? ??? CapSolver ?? ?????? ????, ?? ???? ????????? ?? ?????? ??? ?? ?? ???????????? ????? ?? ?????? ???? ???, CAPTCHA ?? ?? ???? ?? ?????? ?? ?? ??????? ???? ??? ???? ???? ????
????, ?? ???????? ???? ?? ??? ????? ??? ?? ?????? ?? ?????? ?? ?? ???? ???????? ??? CapSolver ?? ???? ????? ?? ?????? ?? ???? ???...
???? ???
????? ?????? ???????? ?? ??? ???? ???? ??? ????? ????; CapSolver: WEBS. ??? ????? ???? ?? ???, ???? ???????? ??????? ?? ??? ???????? 5% ???? ??????, ??????
????? ?? ????? ???? reCAPTCHA ?? ???? ?? ????
??????????????
??? 1. ???? ????? ??????? ????
V2 ?? V3 ????? ?? ???, ?? ???????? ?????? ??? ??? ?????? /recaptcha/api2/reload?k=6LcR_okUAAAAAPYrPe-HK_0RULO1aZM15ENyM-Mf
?? ??? ?? ???? ???, ???? k=
?? ????? ??? ?? ????? ???? ???????? ??
??? 2. V2 ?? V3 ?? ??? ???? ????
V2 ?? V3 ??? ???-??? ???????? ??????? ???? V2 ?? ??????? ?? ??? ???? ?? ??? ??? ????? ?? ???????? ???? ??, ???? V3 ?????????? ????? ??; ???????, V3 ?? ??????? ?? ????? ?? ?????? ?????? ???? ?? ???????? ???? ??? ???? ??????? ?? ?? ????? ??? ?? ???? ??, ??????????? ????? ?? ??? ????, ?? ???? ????? ??? ?????? ??? ??????

??? 3. CapSolver ???? ?? ??? ????
reCAPTCHA ????????? ?? ??? ????
- ???????? ?????? ??? ???, ?? ??? ???? ??? ?? V2 ?? ???,
/recaptcha/api2/reload
?????? ?? ???, ????? ???? ??????? ???? ?? ??? ????? ??/recaptcha/api2/userverify
?????? ?? ???????? ???? ??; - V3 ?? ???,
/recaptcha/api2/reload
?????? ???? ????? ???? ??????? ?? ???? ??
CapSolver API ??? ?? ????? ??????
- ????? reCAPTCHA V2
python
# pip install requests
import requests
import time
# TODO: set your config
api_key = "YOUR_API_KEY" # your api key of capsolver
site_key = "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-" # site key of your target site
site_url = "https://www.google.com/recaptcha/api2/demo" # page url of your target site
# site_key = "6LelzS8UAAAAAGSL60ADV5rcEtK0x0lRsHmrtm62"
# site_url = "https://mybaragar.com/index.cfm?event=page.SchoolLocatorPublic&DistrictCode=BC45"
def capsolver():
payload = {
"clientKey": api_key,
"task": {
"type": 'ReCaptchaV2TaskProxyLess',
"websiteKey": site_key,
"websiteURL": site_url
}
}
res = requests.post("https://api.capsolver.com/createTask", json=payload)
resp = res.json()
task_id = resp.get("taskId")
if not task_id:
print("Failed to create task:", res.text)
return
print(f"Got taskId: {task_id} / Getting result...")
while True:
time.sleep(3) # delay
payload = {"clientKey": api_key, "taskId": task_id}
res = requests.post("https://api.capsolver.com/getTaskResult", json=payload)
resp = res.json()
status = resp.get("status")
if status == "ready":
return resp.get("solution", {}).get('gRecaptchaResponse')
if status == "failed" or resp.get("errorId"):
print("Solve failed! response:", res.text)
return
token = capsolver()
print(token)
- ????? reCAPTCHA V3
python
# pip install requests
import requests
import time
# TODO: set your config
api_key = "YOUR_API_KEY" # your api key of capsolver
site_key = "6LcR_okUAAAAAPYrPe-HK_0RULO1aZM15ENyM-Mf" # site key of your target site
site_url = "https://antcpt.com/score_detector/" # page url of your target site
def capsolver():
payload = {
"clientKey": api_key,
"task": {
"type": 'ReCaptchaV3TaskProxyLess',
"websiteKey": site_key,
"websiteURL": site_url,
"pageAction": "homepage",
}
}
res = requests.post("https://api.capsolver.com/createTask", json=payload)
resp = res.json()
task_id = resp.get("taskId")
if not task_id:
print("Failed to create task:", res.text)
return
print(f"Got taskId: {task_id} / Getting result...")
while True:
time.sleep(1) # delay
payload = {"clientKey": api_key, "taskId": task_id}
res = requests.post("https://api.capsolver.com/getTaskResult", json=payload)
resp = res.json()
status = resp.get("status")
if status == "ready":
return resp.get("solution", {}).get('gRecaptchaResponse')
if status == "failed" or resp.get("errorId"):
print("Solve failed! response:", res.text)
return
# verify score
def score_detector(token):
headers = {
"accept": "application/json, text/javascript, */*; q=0.01",
"accept-language": "fr-CH,fr;q=0.9",
"content-type": "application/json",
"origin": "https://antcpt.com",
"priority": "u=1, i",
"referer": "https://antcpt.com/score_detector/",
"sec-ch-ua": "\"Not/A)Brand\";v=\"8\", \"Chromium\";v=\"126\", \"Google Chrome\";v=\"126\"",
"sec-ch-ua-mobile": "?0",
"sec-ch-ua-platform": "\"macOS\"",
"sec-fetch-dest": "empty",
"sec-fetch-mode": "cors",
"sec-fetch-site": "same-origin",
"user-agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
"x-requested-with": "XMLHttpRequest"
}
url = "https://antcpt.com/score_detector/verify.php"
data = {
"g-recaptcha-response": token
}
data = json.dumps(data, separators=(',', ':'))
response = requests.post(url, headers=headers, data=data)
print(response.json())
print(response)
token = capsolver()
print(token)
...
...
{
'success': True,
'challenge_ts': '2024-07-19T10:50:56Z',
'hostname': 'antcpt.com',
'score': 0.7,
'action': 'homepage'
}
???? ?? ????? ???? reCAPTCHA ?? ???? ?? ????
??????????????
???? ???? ?? ?? ??? ??? ?????, ??? ?????????????? ??? ?? ???? ?? ?????????? ?? ??????????? ???? ???? ?? ??? ??? ??? ???? ?????:
- Node.js ?? npm: ?? Node.js, ?? ????????????? ??????, ??? ?? npm (??? ????? ??????) ?? ????? ???? ???????? ?? ?????????? ?? ???????? ???? ?? ??? ??????? ??? ???? ??? Node.js ??????? ???? ??, ?? ?? ??? ???????? Node.js ??????? ?? ??????? ?? ???? ????
- CapSolver API ?????: ??????? ??? ?? reCAPTCHA ????????? ?? ?? ???? ?? ???, ???? CapSolver ???? ???? ?? ????? ?? ???????? ????, ?? ????????????? ??? ?? CAPTCHA ????????? ?? ?? ???? ??? ????? ??? ????????? ???? ?? ?? ???? ?? ???? ?? ???? ?????? ??? ?????? ???? ?? ??? CapSolver ?? ?? API ????? ??????? ?????
?? ??? ?? ?? ?? ?????????????? ?? ???? ?? ???? ???, ?? ?? ???? ??????? ??????? ???? ?? ??? ????? ??? ?? ????????????? ?? CapSolver ?? ??? reCAPTCHA ????????? ?? ?? ???? ???? ?? ???? ????
??? 1: ???? ????? ??????? ????
- ???????? ?? ?????? ??? ???, ?????? ?? ??? ????
/recaptcha/api2/reload?k=6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-
, ????k=
?? ??? ?? ??? ?? ???? ????? ?? ????? ???? ???????? ??? ?? ?? CapSolver ????????? ?? ?????? ?? recapctha ?? ?? ???? ?? ??? ??? ???????? ?? ???? ??? - URL ?? ????? ?? ??? ?? ?? reCAPTCHA V2 ?? ?????? ???? ???
??? 2: ?????? ????????? ??????? ????
bash
pip install requests
??? 3: ?????? ???
python
import requests
import time
from DrissionPage import ChromiumPage
# Create an instance of ChromiumPage
page = ChromiumPage()
# Access the example page that triggers reCAPTCHA
page.get("https://www.google.com/recaptcha/api2/demo")
# TODO: Set your configuration
api_key = "your api key of capsolver" # Your CapSolver API key
site_key = "6Le-wvkSAAAAAPBMRTvw0Q4Muexq9bi0DJwx_mJ-" # Site key of your target site
site_url = "https://www.google.com/recaptcha/api2/demo" # Page URL of your target site
def capsolver():
payload = {
"clientKey": api_key,
"task": {
"type": 'ReCaptchaV2TaskProxyLess',
"websiteKey": site_key,
"websiteURL": site_url
}
}
# Send a request to CapSolver to create a task
res = requests.post("https://api.capsolver.com/createTask", json=payload)
resp = res.json()
task_id = resp.get("taskId")
if not task_id:
print("Failed to create task:", res.text)
return
print(f"Got taskId: {task_id} / Getting result...")
while True:
time.sleep(3) # Delay
payload = {"clientKey": api_key, "taskId": task_id}
# Query task results
res = requests.post("https://api.capsolver.com/getTaskResult", json=payload)
resp = res.json()
status = resp.get("status")
if status == "ready":
return resp.get("solution", {}).get('gRecaptchaResponse')
if status == "failed" or resp.get("errorId"):
print("Solve failed! response:", res.text)
return
def check():
# Get the reCAPTCHA solution
token = capsolver()
# Set the reCAPTCHA response value
page.run_js(f'document.getElementById("g-recaptcha-response").value="{token}"')
# Call the success callback function
page.run_js(f'onSuccess("{token}")')
# Submit the form
page.ele('x://input[@id="recaptcha-demo-submit"]').click()
if __name__ == '__main__':
check()
C++ ?? ????? ???? reCAPTCHA ?? ???? ?? ????
??????????????
???? ???? ?? ????, ????????? ???? ?? ???? ??? ?????????? ????????? ??????? ???:
- cpr: ?? C++ HTTP ??????????
- jsoncpp: JSON ???????? ?? ??? ?? C++ ??????????
?? ???? vcpkg ?? ????? ???? ??????? ?? ???? ???:
bash
vcpkg install cpr jsoncpp
??? 1: ???? ???????? ??? ?? ????
?? ?? C++ ????????? ????? ?? cpr
?? jsoncpp
?? ??? ?????? ???????? ????? ?????
cpp
#include <iostream>
#include <cpr/cpr.h>
#include <json/json.h>
??? 2: ????? ????? ?? ????? ?????? ??????? ???? ?? ??? ????? ???????? ????
?? ?? ????? ????? ???????? ??????: createTask
?? getTaskResult
.
- createTask: ?? ??????? ?? reCAPTCHA ????? ????? ???
- getTaskResult: ?? ??????? ???? ?? ????? ?? ?????? ??????? ???? ???
???? ???? ??? ???? ??? ??:
cpp
#include <iostream>
#include <cpr/cpr.h>
#include <json/json.h>
std::string createTask(const std::string& apiKey, const std::string& websiteURL, const std::string& websiteKey) {
Json::Value requestBody;
requestBody["clientKey"] = apiKey;
requestBody["task"]["type"] = "ReCaptchaV2Task";
requestBody["task"]["websiteURL"] = websiteURL;
requestBody["task"]["websiteKey"] = websiteKey;
Json::StreamWriterBuilder writer;
std::string requestBodyStr = Json::writeString(writer, requestBody);
cpr::Response response = cpr::Post(
cpr::Url{"https://api.capsolver.com/createTask"},
cpr::Body{requestBodyStr},
cpr::Header{{"Content-Type", "application/json"}}
);
Json::CharReaderBuilder reader;
Json::Value responseBody;
std::string errs;
std::istringstream s(response.text);
std::string taskId;
if (Json::parseFromStream(reader, s, &responseBody, &errs)) {
if (responseBody["errorId"].asInt() == 0) {
taskId = responseBody["taskId"].asString();
} else {
std::cerr << "Error: " << responseBody["errorCode"].asString() << std::endl;
}
} else {
std::cerr << "Failed to parse response: " << errs << std::endl;
}
return taskId;
}
std::string getTaskResult(const std::string& apiKey, const std::string& taskId) {
Json::Value requestBody;
requestBody["clientKey"] = apiKey;
requestBody["taskId"] = taskId;
Json::StreamWriterBuilder writer;
std::string requestBodyStr = Json::writeString(writer, requestBody);
while (true) {
cpr::Response response = cpr::Post(
cpr::Url{"https://api.capsolver.com/getTaskResult"},
cpr::Body{requestBodyStr},
cpr::Header{{"Content-Type", "application/json"}}
);
Json::CharReaderBuilder reader;
Json::Value responseBody;
std::string errs;
std::istringstream s(response.text);
if (Json::parseFromStream(reader, s, &responseBody, &errs)) {
if (responseBody["status"].asString() == "ready") {
return responseBody["solution"]["gRecaptchaResponse"].asString();
} else if (responseBody["status"].asString() == "processing") {
std::cout << "Task is still processing, waiting for 5 seconds..." << std::endl;
std::this_thread::sleep_for(std::chrono::seconds(5));
} else {
std::cerr << "Error: " << responseBody["errorCode"].asString() << std::endl;
break;
}
} else {
std::cerr << "Failed to parse response: " << errs << std::endl;
break;
}
}
return "";
}
int main() {
std::string apiKey = "YOUR_API_KEY";
std::string websiteURL = "https://example.com";
std::string websiteKey = "SITE_KEY";
std::string taskId = createTask(apiKey, websiteURL, websiteKey);
if (!taskId.empty()) {
std::cout << "Task created successfully. Task ID: " << taskId << std::endl;
std::string recaptchaResponse = getTaskResult(apiKey, taskId);
std::cout << "reCAPTCHA Response: " << recaptchaResponse << std::endl;
} else {
std::cerr << "Failed to create task." << std::endl;
}
return 0;
}
????? ?????
???? ?? ??? ?????? ???? ???, ??? ??????? ?? ??? ?? ???? ??? ?? CapSolver ?? ???? ?????????? ??? ?????? ???? ?? reCAPTCHA ????????? ?? ??????? ???? ???? ?? ??? ??? ???? ?? V2 ?? ?? V3, ????????? ??? ?? ?? ???? ???? ???? ??? ????? ??? ??? ?? ???? ????????? ?? ????? ?? ??? ???, ?? ??? ???? CapSolver ?? ??????? ?? ??????? ??????? ???? ???¡ª?? ???? ??? ?? ???-????? ??? ???
??????? ????????: ?? ????? ?? ?????? ?? ?? ??????? ???? ????????? ?????????? ?? ??? ??? CapSolver ??? ???? ??????? ?? ???????? ?? ???? ???? ?? ??? ????????? ??? CapSolver ??????? ?? ????? ????, ???????? ?? ???????? ???? ???? ?????????? ?? ??? ???? ???? ?????? ?? ?? ???? ???? ?? ?????? ????? ?????? ?????? ?????????? ????? ?? ????? ????? ?? ???-??? ????????? ???? ???????? ?? ????? ?????? ????????? ?? ?? ???? ??? 100% ??????? ????????? ???? ???? ?? ???? ?????? ?? ????????? ????? ?? ??????????? ???? ???? ???? ??????? ?? ???, ????? ????? ???? ?? ?????? ?? ???????? ???? ?? ?????
????

???? ?? reCAPTCHA Enterprise ??????? ?? ?? ????, v2, v2 ??????, v3, v3 ?????????? 0.9 ?????
?????? ???? ???? ?? reCaptcha ??????? ?? CapSolver ?? ???: ?? ???? reCaptcha ?? ??????? ??? ?? ?? ???? ?? ??? ???-??-??? ?????????? ?????? ???? ??, ?? ??? ???? ?????? ????????? ???? ???

Rajinder Singh
11-Oct-2025

??????? ??2 ?????? ???? ?? ????
?? ????? reCaptcha v2 ?????? ?? ?? ???? ?? ???? ??? ?? ???????? ???? ??? ?? ?????? ??????? ?? Capsolver ?? ??? ???? ?? ???? ???????? ?? ?????? ???? ?? ?? ???-??-??? ???? ?????? ???? ??? ????? ?? ????? ?? ?????? ???? ??? ???? ????? ??? ??, ????? ???? ??????? ?? reCaptcha v2 ?????? ?? ???? ???? ?? ?? ???? ?? ????????? ??? ?? ???? ?? ???? ??? ?? ?? ???????? ?? ??????? ???? ??, ?? ????????? ???? ?? ?? ???? ?? ??? ???? ???? ????????? ?? ???? ??? ??????? ???? ???

Rajinder Singh
11-Oct-2025

reCaptcha v2 ???? ?? ????
?? ??? ??? ?? ???? ??????? ?? reCaptcha ???? ?? ?? CapSolver ?? ????? ???? reCaptcha v2 ?? ????? ?? ???? ?? ?????

Rajinder Singh
23-Sep-2025

reCaptcha v3 ?? ???? ?? ???? ?? ???? ???? (>0.7¨C0.9) ????? ??????? ????
Capsolver ?? ??? reCaptcha v3 ?? ??????? ??? ?? ?? ???? ?????? ?? ???? ????? ?? ???? ?????? ?? ?? ???? ?? ?? ??? ????? ???? ??, ????? ???? ????? ?? ?????? ??? ???????? ????????? ???? ??

Rajinder Singh
23-Sep-2025

2025 ??? ??? ?????????? ???? ??? ???? ????? reCAPTCHA v2 ?? v3 ?????? ???? ???
2025 ???, ????-??? ?????? ?? ????? ???????? ?? ???, ??? ???? ????????? ?? ??? ????????? reCAPTCHA ?????? ?????? ?????????? ?? ??? ???

Rajinder Singh
17-Jan-2025

2025 ??? AI ????? ?? ??? reCAPTCHA ?? ?? ????
AI ?????? reCAPTCHA ?? ?? ????, CapSolver ?? ???????? ?? 2025 ??? CAPTCHA ??????? ?? ?????? ???? ???????? ?? ???? ??? ??? ??, ???? ??? ??????

Rajinder Singh
11-Nov-2024