diff --git a/data/config.php b/data/config.php index c5cf9fc..ba39cf8 100644 --- a/data/config.php +++ b/data/config.php @@ -168,6 +168,7 @@ class config{ const PROXY_YAHOO_JAPAN = false; const PROXY_BRAVE = false; const PROXY_GOOGLE = false; + const PROXY_GOOGLE_ALT = false; // alt proxies for url resolution const PROXY_GOOGLE_API = false; const PROXY_GOOGLE_CSE = false; const PROXY_STARTPAGE = false; diff --git a/lib/backend.php b/lib/backend.php index 8a523bb..bd9dea2 100644 --- a/lib/backend.php +++ b/lib/backend.php @@ -12,9 +12,9 @@ class backend{ /* Proxy stuff */ - public function get_ip($proxy_index_raw = null){ + public function get_ip($proxy_index_raw = null, $use_alt_list = false){ - $pool = constant("config::PROXY_" . strtoupper($this->scraper)); + $pool = constant("config::PROXY_" . strtoupper($this->scraper) . ($use_alt_list ? "_ALT" : "")); if($pool === false){ // we don't want a proxy, fuck off! diff --git a/scraper/google.php b/scraper/google.php index a8602b7..9e666e6 100644 --- a/scraper/google.php +++ b/scraper/google.php @@ -658,7 +658,7 @@ class google{ curl_setopt($curlproc, CURLOPT_CONNECTTIMEOUT, 30); curl_setopt($curlproc, CURLOPT_TIMEOUT, 30); - //$this->backend->assign_proxy($curlproc, $proxy); + $this->backend->assign_proxy($curlproc, $this->backend->get_ip(null, true)); curl_multi_add_handle($this->proc, $curlproc); $this->handles[] = [