diff --git a/config.php b/config.php index eb8cec0..6566c7c 100755 --- a/config.php +++ b/config.php @@ -10,6 +10,16 @@ "disable_bittorent_search" => false, "bittorent_trackers" => "&tr=http%3A%2F%2Fnyaa.tracker.wf%3A7777%2Fannounce&tr=udp%3A%2F%2Fopen.stealth.si%3A80%2Fannounce&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337%2Fannounce&tr=udp%3A%2F%2Fexodus.desync.com%3A6969%2Fannounce&tr=udp%3A%2F%2Ftracker.torrent.eu.org%3A451%2Fannounce", + /* + Preset privacy friendly frontends for users, these can be overwritten by users in settings + e.g.: "invidious" => "https://yewtu.be", + */ + "invidious" => "", + "bibliogram" => "", + "nitter" => "", + "libreddit" => "", + "wikiless" => "", + /* To send requests trough a proxy uncomment CURLOPT_PROXY and CURLOPT_PROXYTYPE: @@ -28,7 +38,7 @@ // CURLOPT_PROXYTYPE => CURLPROXY_HTTP, CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => "", - CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.82 Safari/537.36", + CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36", CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4, CURLOPT_CUSTOMREQUEST => "GET", CURLOPT_SSL_VERIFYHOST => false, diff --git a/engines/google/text.php b/engines/google/text.php index e9b009a..772bd64 100644 --- a/engines/google/text.php +++ b/engines/google/text.php @@ -110,7 +110,7 @@ $url = $url->textContent; - $url = privacy_friendly_alternative($url); + $url = check_for_privacy_frontend($url); $title = $xpath->evaluate(".//h3", $result)[0]; $description = $xpath->evaluate(".//div[contains(@class, 'VwiC3b')]", $result)[0]; @@ -142,7 +142,7 @@ echo "
"; if (array_key_exists("image", $special["special_response"])) - echo ""; + echo ""; echo $response; echo "$source"; echo "
"; diff --git a/engines/google/video.php b/engines/google/video.php index 5526fc4..a9a2b6c 100644 --- a/engines/google/video.php +++ b/engines/google/video.php @@ -22,7 +22,7 @@ $url = $url->textContent; - $url = privacy_friendly_alternative($url); + $url = check_for_privacy_frontend($url); $title = $xpath->evaluate(".//h3", $result)[0]; diff --git a/engines/special/wikipedia.php b/engines/special/wikipedia.php index 714868d..f1df6ed 100644 --- a/engines/special/wikipedia.php +++ b/engines/special/wikipedia.php @@ -11,7 +11,7 @@ { $description = substr($first_page["extract"], 0, 250) . "..."; - $source = "https://en.wikipedia.org/wiki/$query"; + $source = check_for_privacy_frontend("https://wikipedia.org/wiki/$query"); $response = array( "special_response" => array( "response" => $description, @@ -20,7 +20,12 @@ ); if (array_key_exists("thumbnail", $first_page)) - $response["special_response"]["image"] = $first_page["thumbnail"]["source"]; + { + $img_url = $first_page["thumbnail"]["source"]; + $img_src = request($img_url); + $base64_src = base64_encode($img_src); + $response["special_response"]["image"] = $base64_src; + } return $response; } diff --git a/misc/footer.php b/misc/footer.php index 7e67261..9797a9f 100644 --- a/misc/footer.php +++ b/misc/footer.php @@ -1,10 +1,9 @@