From 1f394883bfe64a24903334cd4f65076f4b892c21 Mon Sep 17 00:00:00 2001 From: lolcat Date: Sun, 6 Sep 2026 23:51:51 -0400 Subject: [PATCH] added debugging feature, fix graph misreporting request ranges in header --- api/v2/graph.php | 49 ++++++++++++++++++++++++++++++------------------ data/config.php | 31 +++++++++++++++--------------- lib/frontend.php | 7 +++++++ 3 files changed, 53 insertions(+), 34 deletions(-) diff --git a/api/v2/graph.php b/api/v2/graph.php index 13ec8b7..a561dbe 100644 --- a/api/v2/graph.php +++ b/api/v2/graph.php @@ -1,5 +1,6 @@ 25){ echo $graph->render([ "title" => "Number of requests within the last 72 hours (non-cummulative)", - "subtitle" => date("jS M y @ g:ia", time()) . " || 24h=" . number_format($real_reqs_24h) . ", 72h=" . number_format($real_reqs_72h) . " || " . config::SERVER_NAME, + "subtitle" => date("jS M y @ g:ia", time()) . " || 8h=" . number_format($real_reqs_8h) . " - 24h=" . number_format($real_reqs_24h) . " - 72h=" . number_format($real_reqs_72h) . " || " . config::SERVER_NAME, "x_label" => "<= Hours passed =>", "y_label" => "<= Request count/hour =>", "grad_x" => $c, diff --git a/data/config.php b/data/config.php index 04059f8..925f5df 100644 --- a/data/config.php +++ b/data/config.php @@ -23,6 +23,9 @@ class config{ // Enable the API? const API_ENABLED = true; + // Display errors. This should ONLY be enabled for debugging and constitutes a security risk. + const DISPLAY_ERRORS = false; + // // 4play settings // @@ -106,30 +109,26 @@ class config{ // eachother your serber should appear everywhere. const INSTANCES = [ "https://4get.ca", - "https://4get.zzls.xyz", - "https://4getus.zzls.xyz", + "https://search.fischbytes.de", + "https://4get.nadeko.net", "https://4get.silly.computer", - "https://4get.konakona.moe", - "https://4get.lvkaszus.pl", - "https://4g.ggtyler.dev", - "https://4get.perennialte.ch", "https://4get.sijh.net", "https://4get.hbubli.cc", - "https://4get.plunked.party", - "https://4get.etenie.pl", "https://4get.lunar.icu", "https://4get.dcs0.hu", - "https://4get.kizuki.lol", - "https://4get.psily.garden", - "https://search.milivojevic.in.rs", - "https://4get.snine.nl", - "https://4get.datura.network", "https://4get.neco.lol", - "https://4get.lol", - "https://4get.ch", "https://4get.edmateo.site", "https://4get.sudovanilla.org", - "https://search.mint.lgbt" + "https://search.mint.lgbt", + "https://4get.aishiteiru.moe", + "https://4.nboeck.de", + "https://search.yonderly.org", + "https://4get.lurx.net", + "https://4get.canine.tools", + "https://4get.sny.sh", + "https://4g.opnxng.com", + "https://s.307200.xyz", + "https://4get.privadency.com/" ]; // Default user agent to use for scraper requests. Sometimes ignored to get specific webpages diff --git a/lib/frontend.php b/lib/frontend.php index 286ae54..e940a37 100644 --- a/lib/frontend.php +++ b/lib/frontend.php @@ -595,6 +595,13 @@ class frontend{ public function getscraperfilters($page){ + // hack: enable error reporting if configured + if(config::DISPLAY_ERRORS === true){ + + ini_set('display_errors', 1); + ini_set('display_startup_errors', 1); + } + $get_scraper = isset($_COOKIE["scraper_$page"]) ? $_COOKIE["scraper_$page"] : null; if(