From 502f6d12e49afa25e82bd9d1c8418e3956af36bf Mon Sep 17 00:00:00 2001 From: lolcat Date: Thu, 3 Jul 2025 19:43:58 -0400 Subject: [PATCH] marginalia crash fix --- lib/anubis.php | 2 +- scraper/marginalia.php | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/anubis.php b/lib/anubis.php index ab075ff..2bd6d90 100644 --- a/lib/anubis.php +++ b/lib/anubis.php @@ -24,7 +24,7 @@ class anubis{ "script" ); - if(count($script) === 0){ + if($script === false){ throw new Exception("Failed to scrape anubis challenge data"); } diff --git a/scraper/marginalia.php b/scraper/marginalia.php index e62a485..8fcd9fc 100644 --- a/scraper/marginalia.php +++ b/scraper/marginalia.php @@ -317,14 +317,19 @@ class marginalia{ // // Bypass anubis check // + /* if(($anubis_key = apcu_fetch("marginalia_cookie")) === false){ try{ $html = $this->get( $proxy, - "https://old-search.marginalia.nu/" + "https://old-search.marginalia.nu/search", + [ + "query" => $search + ] ); + }catch(Exception $error){ throw new Exception("Failed to get anubis challenge"); @@ -361,7 +366,7 @@ class marginalia{ } apcu_store("marginalia_cookie", $anubis_key); - } + }*/ if($get["npt"]){ @@ -377,7 +382,7 @@ class marginalia{ $proxy, "https://old-search.marginalia.nu/search?" . $params, [], - $anubis_key + //$anubis_key ); }catch(Exception $error){ @@ -408,7 +413,7 @@ class marginalia{ $proxy, "https://old-search.marginalia.nu/search", $params, - $anubis_key + //$anubis_key ); }catch(Exception $error){