From 017c4ba1b0d674e6f5aefe7e65bf0dfcb730232e Mon Sep 17 00:00:00 2001 From: lolcat Date: Tue, 8 Sep 2026 18:28:43 -0400 Subject: [PATCH] nice try google --- resolve/google.php | 2 +- scraper/google.php | 56 ++++++++++++++++++++-------------------------- 2 files changed, 25 insertions(+), 33 deletions(-) diff --git a/resolve/google.php b/resolve/google.php index f497dbf..2259418 100644 --- a/resolve/google.php +++ b/resolve/google.php @@ -94,7 +94,7 @@ class google{ if( preg_match( - '/^https?/', + '/^(https?:|)\/\//', $link ) ){ diff --git a/scraper/google.php b/scraper/google.php index fa57cd6..16ed7cd 100644 --- a/scraper/google.php +++ b/scraper/google.php @@ -930,20 +930,7 @@ class google{ ){ // sometimes the link is an encrypted redirect, handle redirection securely - if( - preg_match( - '/^\/goto\?url=(.*)/', - $link, - $payload - ) - ){ - - $notices[] = "/resolver?scraper=google&target=" . $payload[1]; - }else{ - - // normal link - $notices[] = $link; - } + $notices[] = $this->unshit_url($payload[1]); } } @@ -1290,31 +1277,19 @@ class google{ $sublink["attributes"]["href"] ); - if( - preg_match( - '/^\/goto\?url=(.*)/', - $sublink_url, - $piece_of_shit - ) - ){ - - // encrypted piece of shit url - $sublink_url = "/resolver?scraper=google&target=" . $piece_of_shit[1]; - } - $sublinks[] = [ "title" => $this->fuckhtml ->getTextContent($sublink), "date" => null, - "url" => $sublink_url + "url" => $this->unshit_url($sublink_url) ]; } $out["web"][] = [ "title" => $title, "description" => $description, - "url" => $url, + "url" => $this->unshit_url($url), "date" => $date, "type" => "web", "thumb" => $thumb, @@ -1533,9 +1508,11 @@ class google{ ), "source" => $source, "url" => - $this->fuckhtml - ->getTextContent( - $div["attributes"]["data-lpage"] + $this->unshit_url( + $this->fuckhtml + ->getTextContent( + $div["attributes"]["data-lpage"] + ) ) ]; } @@ -1962,7 +1939,7 @@ class google{ "duration" => $duration, "views" => null, "thumb" => $thumb, - "url" => $url + "url" => $this->unshit_url($url) ]; } @@ -2916,4 +2893,19 @@ class google{ return false; // no need to bypass } + + private function unshit_url($url){ + + if( + preg_match( + '/^\/goto\?url=([^&]+)/', + $url, + $piece_of_shit + ) + ){ + + // encrypted piece of shit url + return "/resolver?scraper=google&target=" . rawurlencode($piece_of_shit[1]); + } + } }