From 9d10b580999089a236ae1b853728ae4d4e223ec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= Date: Sun, 12 Jan 2025 00:47:54 +0100 Subject: sear.php fix noimgclass --- prog/sear.php/index.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'prog/sear.php/index.php') diff --git a/prog/sear.php/index.php b/prog/sear.php/index.php index 8e48d95..dcfee72 100644 --- a/prog/sear.php/index.php +++ b/prog/sear.php/index.php @@ -47,8 +47,14 @@ function query_google ($s, $image = false, $noredirect = false, $bindstring = fa if (str_contains($txtdoc, "In the meantime, solving the above CAPTCHA will let you continue")) return ["status" => false, "code" => "captcha", "url" => $url]; $resultsforclass = find_class($txtdoc, "{color:#1967d2}"); + // file_put_contents("/tmp/debug.html", $txtdoc); if ($image) { - $imageclass = find_class($txtdoc, "{font-family:Roboto,Helvetica,Arial,sans-serif}"); + $imageclass = FALSE; + foreach (["{font-family:Arial,sans-serif}", "{font-family:sans-serif}", "{font-family:Roboto,Helvetica,Arial,sans-serif}"] as $css) { + $imageclass = find_class($txtdoc, $css); + if ($imageclass) + break; + } if (!$imageclass) return ["status" => false, "code" => "noimgclass", "url" => $url]; } else { @@ -341,7 +347,7 @@ if ($response["status"] != true) { die(template("napaka", "iskalno zaledje omejuje iskanja", "iskalno zaledje se je odzvalo s CAPTCHO, češ, da ta instanca prehitro pošilja zahteve. obenem se je enako zgodilo tudi vsem rezervnim strežnikom. iščete lahko ročno preko spletne strani zaledne storitve: kliknite sem.", $q)); } http_response_code(500); - die(template("napaka", "napaka pri poizvedbi", "poizvedba na iskalno zaledje je vrnila napako " . $response["code"] . ".", $q)); + die(template("napaka", "napaka pri poizvedbi", "poizvedba na iskalno zaledje je vrnila napako " . $response["code"] . ".", $q, $add_form, $image, $add_footer)); } handle_response($q, $response, $limit, $plaintext, $horseshoe, $add_url, $add_form, $image, $add_footer); ?> -- cgit v1.2.3