Sfoglia il codice sorgente

fix ddg returning weird reresults when no match is found

lolcat 1 anno fa
parent
commit
1e52982cb9
1 ha cambiato i file con 9 aggiunte e 0 eliminazioni
  1. 9 0
      scraper/ddg.php

+ 9 - 0
scraper/ddg.php

@@ -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