fix dmca links not showing up on google

This commit is contained in:
2026-09-01 18:28:37 -04:00
parent 76c4b62d1a
commit d598a560ae
3 changed files with 144 additions and 11 deletions
+28 -7
View File
@@ -721,7 +721,7 @@ class google{
$params["tbs"] = rtrim($params["tbs"], ",");
}
/*
$data = $this->get(
$proxy,
"https://www.google.com/search",
@@ -730,10 +730,11 @@ class google{
);
$html = &$data["data"];
$container = &$data["container"];
$container = &$data["container"];*/
//file_put_contents("scraper/google-jp.html", $html);
//$html = file_get_contents("scraper/google-softcaptcha.html");
$html = file_get_contents("scraper/dmca.html");
$container = "";
}
$out = [
@@ -914,14 +915,34 @@ class google{
$a["attributes"]["href"]
);
$link_text =
strtolower(
$this->fuckhtml
->getTextContent($a)
);
if(
preg_match(
'/^https?:\/\/lumendatabase\.org/',
$link
str_contains(
$link_text,
"complaint"
)
){
$notices[] = $link;
// 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;
}
}
}