aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorlolcat <will@lolcat.ca>2025-08-30 19:21:19 -0400
committerlolcat <will@lolcat.ca>2025-08-30 19:21:19 -0400
commit8a0a8359a877a4b3747dd876c1c7d7ac3345cb45 (patch)
tree537cdefaeeeb5fea4f66cfdacfb32841d0a17226
parentdcf59018092421d5e036df11ee72796a12079693 (diff)
handle captcha on coc coc
-rw-r--r--scraper/coccoc.php8
1 files changed, 8 insertions, 0 deletions
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");
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage