2 Komitmen b4c5f52cd3 ... 59b2ef8f0f

Pembuat SHA1 Pesan Tanggal
  lolcat 59b2ef8f0f ehh idk if you can get multiple lets just handle it that way for now 4 hari lalu
  lolcat 0a40d39a52 detect legal complaints 4 hari lalu
1 mengubah file dengan 35 tambahan dan 8 penghapusan
  1. 35 8
      scraper/google.php

+ 35 - 8
scraper/google.php

@@ -875,7 +875,7 @@ class google{
 			$container = &$data["container"];
 			
 			//file_put_contents("scraper/google-jp.html", $html);
-			//$html = file_get_contents("scraper/sublink.html");
+			//$html = file_get_contents("scraper/google.html");
 			//$container = "";
 		}
 		
@@ -1048,6 +1048,8 @@ class google{
 				$this->fuckhtml
 				->getElementsByTagName("a");
 			
+			$illegal = false;
+			
 			foreach($as as $a){
 				
 				if(!isset($a["attributes"]["href"])){ continue; }
@@ -1068,9 +1070,23 @@ class google{
 					str_contains(
 						$link_text,
 						"complaint"
+					) ||
+					str_contains(
+						$link_text,
+						"request"
 					)
 				){
 					
+					if(
+						str_contains(
+							$link_text,
+							"read more about the request"
+						)
+					){
+						
+						$illegal = true;
+					}
+					
 					// sometimes the link is an encrypted redirect, handle redirection securely
 					$notices[] = $this->redirect_add_url($link);
 				}
@@ -1083,13 +1099,24 @@ class google{
 				
 				$i = 0;
 				$c = count($notices);
-								
-				$notices_dom = [
-					[
-						"type" => "text",
-						"value" => "Google removed results from this page, but you can get them anyways by consulting these takedown notices: "
-					]
-				];
+				
+				if($illegal === false){
+					
+					$notices_dom = [
+						[
+							"type" => "text",
+							"value" => "Google removed results from this page, but you can get them anyways by consulting these takedown notices: "
+						]
+					];
+				}else{
+					
+					$notices_dom = [
+						[
+							"type" => "text",
+							"value" => "Google removed results from this page because they were illegal. You can view the takedown requests here: "
+						]
+					];
+				}
 				
 				foreach($notices as $n){