detect qwant captcha

This commit is contained in:
2026-03-29 15:37:05 -04:00
parent 2386dd707e
commit fdd44dd373

View File

@@ -905,6 +905,17 @@ class qwant{
throw new Exception("Qwant returned an API error"); throw new Exception("Qwant returned an API error");
} }
if(
isset($json["url"]) &&
preg_match(
'/captcha/i',
$json["url"]
)
){
throw new Exception("Qwant returned a captcha redirect");
}
} }
private function limitstrlen($text){ private function limitstrlen($text){