diff options
| author | lolcat <will@lolcat.ca> | 2024-09-01 20:35:21 -0400 |
|---|---|---|
| committer | lolcat <will@lolcat.ca> | 2024-09-01 20:35:21 -0400 |
| commit | c9eec8260bbbe14015cf6acf1946dc8218d20b74 (patch) | |
| tree | e3cb723634fc4bf2ac351fb28f4c818446920502 /scraper/ghostery.php | |
| parent | 063397dbd1019b8586b2e12af06a97712d48af28 (diff) | |
added solofield
Diffstat (limited to 'scraper/ghostery.php')
| -rw-r--r-- | scraper/ghostery.php | 44 |
1 files changed, 28 insertions, 16 deletions
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 = [ |
