Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "captchaai/example-captchaai-scraping-stack-100-budget",
"description": ""Build a Full Scraping Stack Under $100/Month Using CaptchaAI" - CaptchaAI example",
"description": "Build a Full Scraping Stack Under $100/Month Using CaptchaAI - CaptchaAI example",
"require": {
"vlucas/phpdotenv": "^5.5"
}
Expand Down
6 changes: 3 additions & 3 deletions articles/how-to-solve-geetest-v3-using-api/bash/solve.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if [[ -z "$API_KEY" || "$API_KEY" == "YOUR_API_KEY" ]]; then
fi
if [[ -z "$GT" || "$GT" == "YOUR_GT_VALUE" ]]; then
echo "[!] ERROR: CAPTCHA_GT is not set."
echo " Find the gt value in the page source or GeeTest initialization call."
echo " Find the gt value in the page source or GeeTest v3 initialization call."
exit 1
fi
if [[ -z "$CHALLENGE" || "$CHALLENGE" == "YOUR_CHALLENGE_VALUE" ]]; then
Expand Down Expand Up @@ -142,7 +142,7 @@ while [[ "$ELAPSED" -lt "$MAX_TIMEOUT" ]]; do
STATUS=$(json_int "$POLL_RESP" "status")

if [[ "$STATUS" -eq 1 ]]; then
# Extract the 3 GeeTest values from the response
# Extract the 3 GeeTest v3 values from the response
# The request field contains a JSON object with geetest_challenge, geetest_validate, geetest_seccode
GEETEST_CHALLENGE=$(echo "$POLL_RESP" | grep -oP '"geetest_challenge"\s*:\s*"\\K[^"]*' || echo "")
GEETEST_VALIDATE=$(echo "$POLL_RESP" | grep -oP '"geetest_validate"\s*:\s*"\\K[^"]*' || echo "")
Expand All @@ -164,7 +164,7 @@ while [[ "$ELAPSED" -lt "$MAX_TIMEOUT" ]]; do
echo "[+] geetest_seccode: $GEETEST_SECCODE"
echo
echo "Next step: submit these three values to the site's"
echo "GeeTest verification endpoint."
echo "GeeTest v3 verification endpoint."
exit 0
fi

Expand Down
6 changes: 3 additions & 3 deletions articles/how-to-solve-geetest-v3-using-api/csharp/Solve.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
if (string.IsNullOrEmpty(gt) || gt == "YOUR_GT_VALUE")
{
Console.WriteLine("[!] ERROR: CAPTCHA_GT is not set.");
Console.WriteLine(" Find the gt value in the page source or GeeTest initialization call.");
Console.WriteLine(" Find the gt value in the page source or GeeTest v3 initialization call.");
Environment.Exit(1);
}
if (string.IsNullOrEmpty(challenge) || challenge == "YOUR_CHALLENGE_VALUE")
Expand Down Expand Up @@ -124,7 +124,7 @@

if (status == 1)
{
// The request field contains a JSON string or object with the 3 GeeTest values
// The request field contains a JSON string or object with the 3 GeeTest v3 values
JsonDocument solutionDoc;
if (requestElement.ValueKind == JsonValueKind.String)
{
Expand All @@ -146,7 +146,7 @@
Console.WriteLine($"[+] geetest_seccode: {geetestSeccode}");
Console.WriteLine();
Console.WriteLine("Next step: submit these three values to the site's");
Console.WriteLine("GeeTest verification endpoint.");
Console.WriteLine("GeeTest v3 verification endpoint.");
return;
}

Expand Down
4 changes: 2 additions & 2 deletions articles/how-to-solve-geetest-v3-using-api/go/solve.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func main() {
}
if gt == "" || gt == "YOUR_GT_VALUE" {
fmt.Println("[!] ERROR: CAPTCHA_GT is not set.")
fmt.Println(" Find the gt value in the page source or GeeTest initialization call.")
fmt.Println(" Find the gt value in the page source or GeeTest v3 initialization call.")
os.Exit(1)
}
if challenge == "" || challenge == "YOUR_CHALLENGE_VALUE" {
Expand Down Expand Up @@ -250,7 +250,7 @@ func main() {
fmt.Printf("[+] geetest_seccode: %s\n", solution.GeetestSeccode)
fmt.Println()
fmt.Println("Next step: submit these three values to the site's")
fmt.Println("GeeTest verification endpoint.")
fmt.Println("GeeTest v3 verification endpoint.")
return
}

Expand Down
6 changes: 3 additions & 3 deletions articles/how-to-solve-geetest-v3-using-api/java/Solve.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static void main(String[] args) throws Exception {
}
if (gt.isEmpty() || gt.equals("YOUR_GT_VALUE")) {
System.out.println("[!] ERROR: CAPTCHA_GT is not set.");
System.out.println(" Find the gt value in the page source or GeeTest initialization call.");
System.out.println(" Find the gt value in the page source or GeeTest v3 initialization call.");
System.exit(1);
}
if (challenge.isEmpty() || challenge.equals("YOUR_CHALLENGE_VALUE")) {
Expand Down Expand Up @@ -107,7 +107,7 @@ public static void main(String[] args) throws Exception {
int status = jsonInt(resultResp, "status");

if (status == 1) {
// The request field contains a JSON object with the 3 GeeTest values
// The request field contains a JSON object with the 3 GeeTest v3 values
// Extract the JSON object from the request field
String requestValue = extractRequestValue(resultResp);
String geetestChallenge = jsonStr(requestValue, "geetest_challenge");
Expand All @@ -119,7 +119,7 @@ public static void main(String[] args) throws Exception {
System.out.println("[+] geetest_seccode: " + geetestSeccode);
System.out.println();
System.out.println("Next step: submit these three values to the site's");
System.out.println("GeeTest verification endpoint.");
System.out.println("GeeTest v3 verification endpoint.");
return;
}

Expand Down
6 changes: 3 additions & 3 deletions articles/how-to-solve-geetest-v3-using-api/kotlin/solve.kt
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ fun main() {
}
if (gt.isEmpty() || gt == "YOUR_GT_VALUE") {
println("[!] ERROR: CAPTCHA_GT is not set.")
println(" Find the gt value in the page source or GeeTest initialization call.")
println(" Find the gt value in the page source or GeeTest v3 initialization call.")
System.exit(1)
}
if (challenge.isEmpty() || challenge == "YOUR_CHALLENGE_VALUE") {
Expand Down Expand Up @@ -208,7 +208,7 @@ fun main() {
val status = jsonInt(resultResp, "status")

if (status == 1) {
// The request field contains a JSON string or object with the 3 GeeTest values
// The request field contains a JSON string or object with the 3 GeeTest v3 values
val solutionJson = extractRequestJson(resultResp)
val geetestChallenge = jsonStr(solutionJson, "geetest_challenge")
val geetestValidate = jsonStr(solutionJson, "geetest_validate")
Expand All @@ -219,7 +219,7 @@ fun main() {
println("[+] geetest_seccode: $geetestSeccode")
println()
println("Next step: submit these three values to the site's")
println("GeeTest verification endpoint.")
println("GeeTest v3 verification endpoint.")
return
}

Expand Down
6 changes: 3 additions & 3 deletions articles/how-to-solve-geetest-v3-using-api/node/solve.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function validateConfig() {
}
if (!CAPTCHA_GT || CAPTCHA_GT === "YOUR_GT_VALUE") {
console.log("[!] ERROR: CAPTCHA_GT is not set.");
console.log(" Find the gt value in the page source or GeeTest initialization call.");
console.log(" Find the gt value in the page source or GeeTest v3 initialization call.");
process.exit(1);
}
if (!CAPTCHA_CHALLENGE || CAPTCHA_CHALLENGE === "YOUR_CHALLENGE_VALUE") {
Expand Down Expand Up @@ -130,7 +130,7 @@ async function pollResult(taskId) {
const data = resp.data;

if (data.status === 1) {
// The request field contains a JSON string with the 3 GeeTest values
// The request field contains a JSON string with the 3 GeeTest v3 values
let solution = data.request;
if (typeof solution === "string") {
solution = JSON.parse(solution);
Expand Down Expand Up @@ -179,7 +179,7 @@ async function main() {
console.log(`[+] geetest_seccode: ${solution.geetest_seccode}`);
console.log();
console.log("Next step: submit these three values to the site's");
console.log("GeeTest verification endpoint.");
console.log("GeeTest v3 verification endpoint.");
}

main();
6 changes: 3 additions & 3 deletions articles/how-to-solve-geetest-v3-using-api/php/solve.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
}
if (empty($gt) || $gt === 'YOUR_GT_VALUE') {
echo "[!] ERROR: CAPTCHA_GT is not set.\n";
echo " Find the gt value in the page source or GeeTest initialization call.\n";
echo " Find the gt value in the page source or GeeTest v3 initialization call.\n";
exit(1);
}
if (empty($challenge) || $challenge === 'YOUR_CHALLENGE_VALUE') {
Expand Down Expand Up @@ -129,7 +129,7 @@
$resultData = json_decode($resultResponse, true);

if (($resultData['status'] ?? 0) === 1) {
// The request field contains a JSON string with the 3 GeeTest values
// The request field contains a JSON string with the 3 GeeTest v3 values
$solution = $resultData['request'];
if (is_string($solution)) {
$solution = json_decode($solution, true);
Expand All @@ -140,7 +140,7 @@
echo "[+] geetest_seccode: " . $solution['geetest_seccode'] . "\n";
echo "\n";
echo "Next step: submit these three values to the site's\n";
echo "GeeTest verification endpoint.\n";
echo "GeeTest v3 verification endpoint.\n";
exit(0);
}

Expand Down
6 changes: 3 additions & 3 deletions articles/how-to-solve-geetest-v3-using-api/python/solve.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def validate_config() -> None:
sys.exit(1)
if not CAPTCHA_GT or CAPTCHA_GT == "YOUR_GT_VALUE":
print("[!] ERROR: CAPTCHA_GT is not set.")
print(" Find the gt value in the page source or GeeTest initialization call.")
print(" Find the gt value in the page source or GeeTest v3 initialization call.")
sys.exit(1)
if not CAPTCHA_CHALLENGE or CAPTCHA_CHALLENGE == "YOUR_CHALLENGE_VALUE":
print("[!] ERROR: CAPTCHA_CHALLENGE is not set.")
Expand Down Expand Up @@ -135,7 +135,7 @@ def poll_result(task_id: str) -> dict:
data = resp.json()

if data.get("status") == 1:
# The request field contains a JSON string with the 3 GeeTest values
# The request field contains a JSON string with the 3 GeeTest v3 values
solution = data["request"]
if isinstance(solution, str):
solution = json.loads(solution)
Expand Down Expand Up @@ -178,7 +178,7 @@ def main() -> None:
print(f"[+] geetest_seccode: {solution['geetest_seccode']}")
print()
print("Next step: submit these three values to the site's")
print("GeeTest verification endpoint.")
print("GeeTest v3 verification endpoint.")


if __name__ == "__main__":
Expand Down
6 changes: 3 additions & 3 deletions articles/how-to-solve-geetest-v3-using-api/ruby/solve.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def get_env(env, key, fallback = "")
end
if gt.empty? || gt == "YOUR_GT_VALUE"
puts "[!] ERROR: CAPTCHA_GT is not set."
puts " Find the gt value in the page source or GeeTest initialization call."
puts " Find the gt value in the page source or GeeTest v3 initialization call."
exit 1
end
if challenge.empty? || challenge == "YOUR_CHALLENGE_VALUE"
Expand Down Expand Up @@ -153,7 +153,7 @@ def http_get(url_str)
end

if result_data["status"] == 1
# The request field contains a JSON string or object with the 3 GeeTest values
# The request field contains a JSON string or object with the 3 GeeTest v3 values
solution = result_data["request"]
solution = JSON.parse(solution) if solution.is_a?(String)
puts "[+] Solved!"
Expand All @@ -162,7 +162,7 @@ def http_get(url_str)
puts "[+] geetest_seccode: #{solution['geetest_seccode']}"
puts
puts "Next step: submit these three values to the site's"
puts "GeeTest verification endpoint."
puts "GeeTest v3 verification endpoint."
exit 0
end

Expand Down
6 changes: 3 additions & 3 deletions articles/how-to-solve-geetest-v3-using-api/rust/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ fn main() {
}
if gt.is_empty() || gt == "YOUR_GT_VALUE" {
println!("[!] ERROR: CAPTCHA_GT is not set.");
println!(" Find the gt value in the page source or GeeTest initialization call.");
println!(" Find the gt value in the page source or GeeTest v3 initialization call.");
std::process::exit(1);
}
if challenge.is_empty() || challenge == "YOUR_CHALLENGE_VALUE" {
Expand Down Expand Up @@ -219,7 +219,7 @@ fn main() {
let status = json_int(&result_resp, "status");

if status == 1 {
// The request field contains a JSON string or object with the 3 GeeTest values
// The request field contains a JSON string or object with the 3 GeeTest v3 values
let solution_json = extract_request_json(&result_resp);
let geetest_challenge = json_str(&solution_json, "geetest_challenge");
let geetest_validate = json_str(&solution_json, "geetest_validate");
Expand All @@ -230,7 +230,7 @@ fn main() {
println!("[+] geetest_seccode: {}", geetest_seccode);
println!();
println!("Next step: submit these three values to the site's");
println!("GeeTest verification endpoint.");
println!("GeeTest v3 verification endpoint.");
return;
}

Expand Down
Loading