fix filter bugs on google scraper
This commit is contained in:
1 parent
42d0252e2f
commit
d91834f86f
1 file changed
+14
-9
+14
-9
@@ -835,15 +835,15 @@ class google{
|
|||||||
// language
|
// language
|
||||||
if($get["lang"] != "any"){
|
if($get["lang"] != "any"){
|
||||||
|
|
||||||
$params["lr"] = "lang_" . $lang;
|
$params["lr"] = "lang_" . $get["lang"];
|
||||||
}
|
}
|
||||||
|
|
||||||
// generate tbs
|
// generate tbs
|
||||||
$tbs = [];
|
$tbs = [];
|
||||||
|
|
||||||
// get date
|
// get date
|
||||||
$get["older"] = $get["older"] === false ? null : date("m/d/Y", $older);
|
$get["older"] = $get["older"] === false ? null : date("m/d/Y", $get["older"]);
|
||||||
$get["newer"] = $get["newer"] === false ? null : date("m/d/Y", $newer);
|
$get["newer"] = $get["newer"] === false ? null : date("m/d/Y", $get["newer"]);
|
||||||
|
|
||||||
if(
|
if(
|
||||||
$get["older"] !== null ||
|
$get["older"] !== null ||
|
||||||
@@ -1487,15 +1487,15 @@ class google{
|
|||||||
// generate parameters
|
// generate parameters
|
||||||
if($get["npt"]){
|
if($get["npt"]){
|
||||||
|
|
||||||
[$params, $proxy] =
|
[$params_json, $proxy] =
|
||||||
$this->backend->get(
|
$this->backend->get(
|
||||||
$get["npt"],
|
$get["npt"],
|
||||||
"images"
|
"images"
|
||||||
);
|
);
|
||||||
|
|
||||||
$params = json_decode($params, true);
|
$params_json = json_decode($params_json, true);
|
||||||
$container = $params["c"];
|
$container = &$params_json["c"];
|
||||||
unset($params["c"]);
|
$params = &$params_json["p"];
|
||||||
}else{
|
}else{
|
||||||
|
|
||||||
$search = $get["s"];
|
$search = $get["s"];
|
||||||
@@ -1514,6 +1514,7 @@ class google{
|
|||||||
$type = $get["type"];
|
$type = $get["type"];
|
||||||
$format = $get["format"];
|
$format = $get["format"];
|
||||||
$rights = $get["rights"];
|
$rights = $get["rights"];
|
||||||
|
$container = null;
|
||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
"q" => $search,
|
"q" => $search,
|
||||||
@@ -1607,7 +1608,8 @@ class google{
|
|||||||
$data = $this->get(
|
$data = $this->get(
|
||||||
$proxy,
|
$proxy,
|
||||||
"https://www.google.com/search",
|
"https://www.google.com/search",
|
||||||
$params
|
$params,
|
||||||
|
$container
|
||||||
);
|
);
|
||||||
|
|
||||||
$html = &$data["data"];
|
$html = &$data["data"];
|
||||||
@@ -1710,7 +1712,10 @@ class google{
|
|||||||
$out["npt"] =
|
$out["npt"] =
|
||||||
$this->backend
|
$this->backend
|
||||||
->store(
|
->store(
|
||||||
json_encode($params),
|
json_encode([
|
||||||
|
"p" => $params,
|
||||||
|
"c" => $container
|
||||||
|
]),
|
||||||
"image",
|
"image",
|
||||||
$proxy
|
$proxy
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user