fix invalid sublinks on google scraper

This commit is contained in:
2025-10-21 00:35:20 -04:00
parent ce75cbda81
commit 46e6ed12e3

View File

@@ -953,23 +953,33 @@ class google{
]) ])
); );
if(count($probe) !== 0){ $url =
$this->unshiturl(
$a["attributes"]["href"]
);
if(
preg_match(
'/^http/',
$url
)
){
$sublinks[] = [ if(count($probe) !== 0){
"title" =>
$this->titledots( $sublinks[] = [
$this->fuckhtml "title" =>
->getTextContent( $this->titledots(
$probe[0] $this->fuckhtml
) ->getTextContent(
), $probe[0]
"description" => null, )
"date" => null, ),
"url" => "description" => null,
$this->unshiturl( "date" => null,
$a["attributes"]["href"] "url" => $url
) ];
]; }
} }
} }