nice try google
This commit is contained in:
+1
-1
@@ -94,7 +94,7 @@ class google{
|
|||||||
|
|
||||||
if(
|
if(
|
||||||
preg_match(
|
preg_match(
|
||||||
'/^https?/',
|
'/^(https?:|)\/\//',
|
||||||
$link
|
$link
|
||||||
)
|
)
|
||||||
){
|
){
|
||||||
|
|||||||
+21
-29
@@ -930,20 +930,7 @@ class google{
|
|||||||
){
|
){
|
||||||
|
|
||||||
// sometimes the link is an encrypted redirect, handle redirection securely
|
// sometimes the link is an encrypted redirect, handle redirection securely
|
||||||
if(
|
$notices[] = $this->unshit_url($payload[1]);
|
||||||
preg_match(
|
|
||||||
'/^\/goto\?url=(.*)/',
|
|
||||||
$link,
|
|
||||||
$payload
|
|
||||||
)
|
|
||||||
){
|
|
||||||
|
|
||||||
$notices[] = "/resolver?scraper=google&target=" . $payload[1];
|
|
||||||
}else{
|
|
||||||
|
|
||||||
// normal link
|
|
||||||
$notices[] = $link;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1290,31 +1277,19 @@ class google{
|
|||||||
$sublink["attributes"]["href"]
|
$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[] = [
|
$sublinks[] = [
|
||||||
"title" =>
|
"title" =>
|
||||||
$this->fuckhtml
|
$this->fuckhtml
|
||||||
->getTextContent($sublink),
|
->getTextContent($sublink),
|
||||||
"date" => null,
|
"date" => null,
|
||||||
"url" => $sublink_url
|
"url" => $this->unshit_url($sublink_url)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
$out["web"][] = [
|
$out["web"][] = [
|
||||||
"title" => $title,
|
"title" => $title,
|
||||||
"description" => $description,
|
"description" => $description,
|
||||||
"url" => $url,
|
"url" => $this->unshit_url($url),
|
||||||
"date" => $date,
|
"date" => $date,
|
||||||
"type" => "web",
|
"type" => "web",
|
||||||
"thumb" => $thumb,
|
"thumb" => $thumb,
|
||||||
@@ -1533,10 +1508,12 @@ class google{
|
|||||||
),
|
),
|
||||||
"source" => $source,
|
"source" => $source,
|
||||||
"url" =>
|
"url" =>
|
||||||
|
$this->unshit_url(
|
||||||
$this->fuckhtml
|
$this->fuckhtml
|
||||||
->getTextContent(
|
->getTextContent(
|
||||||
$div["attributes"]["data-lpage"]
|
$div["attributes"]["data-lpage"]
|
||||||
)
|
)
|
||||||
|
)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1962,7 +1939,7 @@ class google{
|
|||||||
"duration" => $duration,
|
"duration" => $duration,
|
||||||
"views" => null,
|
"views" => null,
|
||||||
"thumb" => $thumb,
|
"thumb" => $thumb,
|
||||||
"url" => $url
|
"url" => $this->unshit_url($url)
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2916,4 +2893,19 @@ class google{
|
|||||||
|
|
||||||
return false; // no need to bypass
|
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]);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user