From 8a0a8359a877a4b3747dd876c1c7d7ac3345cb45 Mon Sep 17 00:00:00 2001 From: lolcat Date: Sat, 30 Aug 2025 19:21:19 -0400 Subject: [PATCH] handle captcha on coc coc --- scraper/coccoc.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/scraper/coccoc.php b/scraper/coccoc.php index fd09556..05e1948 100644 --- a/scraper/coccoc.php +++ b/scraper/coccoc.php @@ -165,6 +165,14 @@ class coccoc{ throw new Exception("Failed to decode JSON"); } + if( + isset($html["captcha"]) && + (int)$html["captcha"] === 1 + ){ + + throw new Exception("Coc Coc returned a Captcha"); + } + if(!isset($html["search"]["search_results"])){ throw new Exception("Coc Coc did not return a search_results object");