From f2fe2a5ba637f91072cc8e998c8609b21ab9bd00 Mon Sep 17 00:00:00 2001 From: lolcat Date: Tue, 1 Dec 2026 06:02:16 -0500 Subject: [PATCH] duckduckgo fix --- scraper/ddg.php | 41 ++++++++++++++++++++++++++++++++++++++--- 1 file changed, 38 insertions(+), 3 deletions(-) diff --git a/scraper/ddg.php b/scraper/ddg.php index a287e9a..2088b73 100644 --- a/scraper/ddg.php +++ b/scraper/ddg.php @@ -372,13 +372,14 @@ class ddg{ }else{ // temporary fix - return $this->web_html($get); + //return $this->web_html($get); // we have $get["s"] if( strpos($get["s"], "email") !== false || // contains word "email" ?? lol strpos($get["s"], "\"") !== false || // contains quotes - strpos($get["s"], ":") !== false // contains potential site: operator or whatever the fuck + strpos($get["s"], ":") !== false || // contains potential site: operator or whatever the fuck + strpos($get["s"], "@") !== false // contains @ ){ return $this->web_html($get); @@ -1117,12 +1118,46 @@ class ddg{ if(isset($item["n"])){ // get NPT + /* $out["npt"] = $this->backend->store( "1," . $item["n"], "web", $proxy - ); + );*/ + + $items = parse_url($item["n"]); + + if(isset($items["query"])){ + + parse_str($items["query"], $items); + + $payload = [ + "q" => $items["q"], + "s" => "10", + "nextParams" => "", + "v" => "l", + "o" => "json", + "dc" => "11", + "api" => "d.js", + "vqd" => $items["vqd"], + "kl" => $get_filters["kl"], + "q" => $items["q"] + ]; + + if(isset($get_filters["df"])){ + + $payload["df"] = $get_filters["df"]; + } + + $out["npt"] = + $this->backend->store( + "0," . json_encode($payload), + "web", + $proxy + ); + } + continue; } }