diff options
| author | lolcat <will@lolcat.ca> | 2026-05-27 21:54:36 -0400 |
|---|---|---|
| committer | lolcat <will@lolcat.ca> | 2026-05-27 21:54:36 -0400 |
| commit | 5f112737b863e5fa629cc7621e4d97cc50ab9e64 (patch) | |
| tree | 358d22331882accdbec301757bfefd9cfe91e110 | |
| parent | 1e3f3d82fdca5ced58db35910afb682d2b4ea995 (diff) | |
detect ddg captcha
| -rw-r--r-- | scraper/ddg.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/scraper/ddg.php b/scraper/ddg.php index c59b423..188ad92 100644 --- a/scraper/ddg.php +++ b/scraper/ddg.php @@ -492,6 +492,17 @@ class ddg{ "form" ); + foreach($forms as $form){ + + if( + isset($form["attributes"]["id"]) && + $form["attributes"]["id"] == "challenge-form" + ) + }{ + + throw new Exception("DuckDuckGo returned an image captcha"); + } + foreach(array_reverse($forms) as $form){ $this->fuckhtml->load($form); |
