diff options
| author | lolcat <will@lolcat.ca> | 2026-03-29 15:37:05 -0400 |
|---|---|---|
| committer | lolcat <will@lolcat.ca> | 2026-03-29 15:37:05 -0400 |
| commit | fdd44dd373f6e42ca0889c44c605706af322fb06 (patch) | |
| tree | 3d066a52db6e8f9a23f0fdd0cce9dced8603cd5b /scraper | |
| parent | 2386dd707e4198f5e267944c19d14e7d05f78480 (diff) | |
detect qwant captcha
Diffstat (limited to 'scraper')
| -rw-r--r-- | scraper/qwant.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scraper/qwant.php b/scraper/qwant.php index ecbd4ec..c242de7 100644 --- a/scraper/qwant.php +++ b/scraper/qwant.php @@ -905,6 +905,17 @@ class qwant{ 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){ |
