fix ddg returning weird reresults when no match is found (1e52982cb9)

fix ddg answer image 404 (27b8509ac0) (f33f02e816)
This commit is contained in:
FbIN Support 2025-08-07 17:04:09 +05:30
commit f6054b1683

View file

@ -525,6 +525,15 @@ class ddg{
if(isset($item["c"])){
if(
!isset($item["s"]) &&
isset($item["t"]) &&
$item["t"] == "DEEP_ERROR_NO_RESULTS"
){
return $out;
}
$table = [];
// get youtube video information
@ -1049,8 +1058,8 @@ class ddg{
"description" => $description,
"url" => $json["AbstractURL"],
"thumb" =>
(isset($json["Image"]) && $json["Image"]) !== null ?
"https://duckduckgo.com" . $json["Image"] : null,
(!isset($json["Image"]) || $json["Image"] == "" || $json["Image"] === null) ?
null : "https://duckduckgo.com" . $json["Image"],
"table" => $table,
"sublink" => $sublinks
];