lolcat 1 неделя назад
Родитель
Сommit
9f0437d949
3 измененных файлов с 4 добавлено и 3 удалено
  1. 1 0
      data/config.php
  2. 2 2
      lib/backend.php
  3. 1 1
      scraper/google.php

+ 1 - 0
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;

+ 2 - 2
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!

+ 1 - 1
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[] = [