From c9eec8260bbbe14015cf6acf1946dc8218d20b74 Mon Sep 17 00:00:00 2001 From: lolcat Date: Sun, 1 Sep 2024 20:35:21 -0400 Subject: added solofield --- scraper/ghostery.php | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) (limited to 'scraper/ghostery.php') diff --git a/scraper/ghostery.php b/scraper/ghostery.php index 9492f4b..394756e 100644 --- a/scraper/ghostery.php +++ b/scraper/ghostery.php @@ -130,26 +130,38 @@ class ghostery{ $query = http_build_query($query); - $html = - $this->get( - $proxy, - "https://ghosterysearch.com/search?" . $query, - [], - $country - ); + try{ + + $html = + $this->get( + $proxy, + "https://ghosterysearch.com/search?" . $query, + [], + $country + ); + }catch(Exception $error){ + + throw new Exception("Failed to fetch search page"); + } }else{ $proxy = $this->backend->get_ip(); - $html = - $this->get( - $proxy, - "https://ghosterysearch.com/search", - [ - "q" => $get["s"] - ], - $get["country"] - ); + try{ + + $html = + $this->get( + $proxy, + "https://ghosterysearch.com/search", + [ + "q" => $get["s"] + ], + $get["country"] + ); + }catch(Exception $error){ + + throw new Exception("Failed to fetch search page"); + } } $out = [ -- cgit v1.2.3