Compare commits

...

29 Commits

Author SHA1 Message Date
Fijxu bd19b6cbcf Merge remote-tracking branch 'librey/main' into librey 2023-08-21 13:27:14 -04:00
Ahwx 85ef67c798
chore(instances.json): france -> netherlands for search.ahwx.org 2023-08-21 15:08:03 +02:00
Ahwx 28aed7d61e
chore(readme.md): france -> netherlands for search.ahwx.org 2023-08-21 15:07:04 +02:00
Ahwx dbbec941da
Merge pull request #17 from codedipper/add-instances2
add/remove instances
2023-08-21 15:05:49 +02:00
Revvy 6d657deb2f update retro-hax <3 2023-08-21 08:23:02 -04:00
Revvy 476fcdcd43 add/remove instances 2023-08-20 07:40:17 -04:00
Ahwx 82ac92a98b
fix: gateway timeout on calling fallback instances (merge pull request #16 from davidovski/fix_fallback)
Fix Gateway Timeout on fallback
2023-08-20 12:21:38 +02:00
davidovski 9ae13f41ad add fallback to duckduckgo engine 2023-08-20 01:52:29 +01:00
davidovski 9980f3a9e7 use prefered engine on api 2023-08-20 00:34:22 +01:00
Ahwx e2527200c9
chore(config.php.example): update user agent 2023-08-19 23:05:21 +02:00
Ahwx 5f8bc14d73
fix(config.php.example): hotfix for instance_fallback 2023-08-19 22:07:56 +02:00
Ahwx a6782f81df
chore: update instances (merge pull request #14 from codedipper/add-instances)
update instances
2023-08-19 21:59:15 +02:00
davidovski ae9d706a4b extend number of tries for fallback 2023-08-19 20:16:43 +01:00
davidovski 8e8c718237 fix error when displaying no text results 2023-08-19 19:51:34 +01:00
davidovski d556296c5a add no fallback option to requests 2023-08-19 19:23:54 +01:00
Revvy a8661c3de6 update instances 2023-08-19 10:56:56 -04:00
Ahwx 9296cb4600
fix: passing quotation marks to google searches (merge pull request #13 from davidovski/quote_searches)
Fix passing quotation marks to google searches
2023-08-19 11:49:35 +02:00
davidovski 423de89bd8 Fix passing quotation marks to google searches 2023-08-19 01:54:48 +01:00
Ahwx 903ec51483
feat: changing instances and fix typo (merge pull request #12 from codedipper/main)
add/remove instances, fix typo
2023-08-18 22:38:04 +02:00
Revvy f5579c1110 changed domain 2023-08-18 10:52:37 -04:00
Revvy 677db09535 fix order god i'm stupid 2023-08-18 08:47:18 -04:00
Revvy 2111fda8b8 zzls and bloatcat <3 2023-08-18 08:43:44 -04:00
Revvy 99a1fcb9c8 space 2023-08-18 08:29:47 -04:00
Revvy 1de1ad330c change flag 2023-08-18 08:29:27 -04:00
Revvy fa50117b9f change readme 2023-08-18 08:27:58 -04:00
Revvy ab1141f647 change order 2023-08-17 21:47:44 -04:00
Revvy b19d95d5f5 add protocol 2023-08-17 21:30:45 -04:00
Revvy bab77bd50c hnhx/librex#256 hnhx/librex#253 2023-08-17 21:29:45 -04:00
Revvy 127ab3d543 add/remove instances, fix typo 2023-08-17 20:59:26 -04:00
9 changed files with 78 additions and 87 deletions

View File

@ -17,11 +17,14 @@
> If you host using CloudFlare, this will be mentioned in the instances list.
You can access the full list of LibreX and LibreY instances on one of the following updated LibreY instances:
| Clearnet | TOR | I2P | Country |
|-|-|-|-|
| [search.ahwx.org](https://search.ahwx.org/) | [](http://hyy7rcvknwb22v4nnoar635wntiwr4uwzhiuyimemyl4fz6k7tahj5id.onion) | ❌ | 🇫🇷 FR (temp) |
| [search.ahwx.org](https://search.ahwx.org/) | [](http://hyy7rcvknwb22v4nnoar635wntiwr4uwzhiuyimemyl4fz6k7tahj5id.onion) | ❌ | 🇳🇱 NL |
| [librex.me](https://librex.me/) | [](http://librex.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion/) | [](http://revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p/) | 🇨🇦 CA |
| [librex.revvy.de](https://librex.revvy.de/) | [](http://librex.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion/) | [](http://revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p/) | 🇨🇦 CA |
| [search.davidovski.xyz](https://search.davidovski.xyz/) | ❌ | ❌ | 🇬🇧 GB |
<br>

View File

@ -26,7 +26,10 @@
switch ($type)
{
case 0:
require "engines/google/text.php";
$engine=$config->preferred_engines['text'];
if (is_null($engine))
$engine = "google";
require "engines/$engine/text.php";
$results = get_text_results($query, $page);
break;
case 1:

View File

@ -21,7 +21,7 @@
"disable_hidden_service_search" => false,
// Fallback to another librex instance if google search fails
"instance_fallback" => true,
"instance_fallback" => false, // This might generate a 504 Gateway Timeout error, we are looking into this.
/*
Preset privacy friendly frontends for users, these can be overwritten by users in the settings
@ -144,7 +144,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/109.0.0.0 Safari/537.36", // For a normal Windows 10 PC running Firefox x64
CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:116.0) Gecko/20100101 Firefox/116.0", // For a normal Windows 10 PC running Firefox x64
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_WHATEVER,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_PROTOCOLS => CURLPROTO_HTTPS | CURLPROTO_HTTP,

View File

@ -72,6 +72,13 @@
curl_multi_exec($mh, $running);
} while ($running);
if (curl_getinfo($google_ch)['http_code'] != '200')
{
require "engines/librex/text.php";
return get_librex_results($query, $page);
}
if ($special_search != 0)
{

View File

@ -4,7 +4,7 @@
global $config;
$mh = curl_multi_init();
$query_encoded = urlencode($query);
$query_encoded = str_replace("%22", "\"", urlencode($query));
$results = array();
$domain = $config->google_domain;
@ -13,6 +13,7 @@
$number_of_results = isset($_COOKIE["google_number_of_results"]) ? trim(htmlspecialchars($_COOKIE["google_number_of_results"])) : $config->google_number_of_results;
$url = "https://www.google.$domain/search?q=$query_encoded&nfpr=1&start=$page";
error_log($url);
if (3 > strlen($site_language) && 0 < strlen($site_language))
$url .= "&hl=$site_language";
@ -168,6 +169,9 @@
function print_text_results($results)
{
if (empty($results))
return;
$special = $results[0];
if (array_key_exists("did_you_mean", $special))

View File

@ -4,6 +4,9 @@
{
global $config;
if (isset($_REQUEST["nfb"]) && $_REQUEST["nfb"] == "1")
return array();
if (!$config->instance_fallback)
return array();
@ -24,16 +27,12 @@
do {
$tries++;
// after "too many" requests, give up
if ($tries > 5)
return array();
$instance = array_pop($instances);
if (parse_url($instance)["host"] == parse_url($_SERVER['HTTP_HOST'])["host"])
continue;
$url = $instance . "api.php?q=$query_encoded&p=$page&t=0";
$url = $instance . "api.php?q=$query_encoded&p=$page&t=0&nfb=1";
$librex_ch = curl_init($url);
curl_setopt_array($librex_ch, $config->curl_settings);
@ -44,7 +43,10 @@
$code = curl_getinfo($librex_ch)["http_code"];
$results = json_decode($response, true);
} while ( $results == null || count($results) <= 1);
} while ( !empty($instances) && ($results == null || count($results) <= 1));
if (empty($instances))
return array();
return array_values($results);
}

View File

@ -1,26 +1,33 @@
{
"instances": [
{
"clearnet": "https://search.ahwx.org",
"clearnet": "https://search.ahwx.org/",
"tor": "http://hyy7rcvknwb22v4nnoar635wntiwr4uwzhiuyimemyl4fz6k7tahj5id.onion",
"i2p": null,
"country": "FR",
"country": "NL",
"librey": true
},
{
"clearnet": "https://librex.me",
"tor": "librex.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion",
"i2p": "revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p",
"clearnet": "https://librex.me/",
"tor": "http://librex.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion",
"i2p": "http://revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p",
"country": "CA",
"librey": true
},
{
"clearnet": "https://librex.revvy.de",
"tor": "librex.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion",
"i2p": "revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p",
"clearnet": "https://librex.revvy.de/",
"tor": "http://librex.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion",
"i2p": "http://revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p",
"country": "CA",
"librey": true
},
{
"clearnet": "https://librex.zzls.xyz/",
"tor": "http://librex.zzlsghu6mvvwyy75mvga6gaf4znbp3erk5xwfzedb4gg6qqh2j6rlvid.onion/",
"i2p": "http://zzlsaymhcfla7vibo3a223bybeecu3bd5z6rmw2u4y76maqeu76q.b32.i2p/",
"country": "CL",
"librey": true
},
{
"clearnet": "https://search.davidovski.xyz/",
"tor": null,
@ -29,25 +36,32 @@
"librey": true
},
{
"clearnet": "https://librex.zzls.xyz/",
"tor": "http://librex.zzlsghu6mvvwyy75mvga6gaf4znbp3erk5xwfzedb4gg6qqh2j6rlvid.onion/",
"i2p": "http://zzlsaymhcfla7vibo3a223bybeecu3bd5z6rmw2u4y76maqeu76q.b32.i2p/",
"country": "CL",
"librey": false
"clearnet": "https://librey.spaceint.fr/",
"tor": null,
"i2p": null,
"country": "FR",
"librey": true
},
{
"clearnet": "https://librex.me/",
"tor": "http://librex.revvybrr6pvbx4n3j4475h4ghw4elqr4t5xo2vtd3gfpu2nrsnhh57id.onion/",
"i2p": "http://revekebotog64xrrammtsmjwtwlg3vqyzwdurzt2pu6botg4bejq.b32.i2p/",
"country": "CA",
"librey": false
},
{
"clearnet": "https://s.dyox.in/",
"tor": "http://ddhigxwjz7elcl2erm7qzzukda4qmovoy4cepcueahggpwrpu24mi6qd.onion/",
"i2p": "http://s.dyoxin.i2p/",
"clearnet": "https://librey.bloatcat.tk/",
"tor": null,
"i2p": null,
"country": "IS",
"librey": false
"librey": true
},
{
"clearnet": "https://search.funami.tech/",
"tor": null,
"i2p": null,
"country": "KR",
"librey": true
},
{
"clearnet": "https://librex.retro-hax.net/",
"tor": null,
"i2p": null,
"country": "DE",
"librey": true
},
{
"clearnet": "https://lx.vern.cc/",
@ -57,24 +71,17 @@
"librey": false
},
{
"clearnet": "https://search.ahwx.org/",
"tor": "http://cosrpybbddzdfjquer3zfmb2h5avtacnctnbu4gucwocdb42s63gcqqd.onion/",
"i2p": null,
"country": "NL",
"clearnet": "https://lx.owo.si/",
"tor": "http://lx.pk47sgwhncn5cgidm7bofngmh7lc7ukjdpk5bjwfemmyp27ovl25ikyd.onion/",
"i2p": "http://d4vi3tvfui2rfzsxr33tin4a6542heulf4mhkokdpbhbcejlg3la.b32.i2p/",
"country": "DE",
"librey": false
},
{
"clearnet": "https://search.spaceint.fr/",
"tor": "http://6d4nqt2rndvmhogpwrbqfvj2ur6e6nm2r6dzi7ny4wj6ai3j5hnvbhyd.onion/",
"i2p": null,
"country": "FR",
"librey": false
},
{
"clearnet": "https://search.madreyk.xyz/",
"tor": null,
"i2p": null,
"country": "DE",
"country": "FR",
"librey": false
},
{
@ -84,13 +91,6 @@
"country": "DE",
"librey": false
},
{
"clearnet": "https://librex.pufe.org/",
"tor": null,
"i2p": null,
"country": "NZ",
"librey": false
},
{
"clearnet": "https://librex.ratakor.com/",
"tor": null,
@ -112,27 +112,6 @@
"country": "DE",
"librey": false
},
{
"clearnet": "https://librex.bloatcat.tk/",
"tor": null,
"i2p": null,
"country": "IS",
"librey": false
},
{
"clearnet": "https://librex.retro-hax.net/",
"tor": null,
"i2p": null,
"country": "DE",
"librey": false
},
{
"clearnet": "https://search.funami.tech/",
"tor": null,
"i2p": null,
"country": "KR",
"librey": false
},
{
"clearnet": "https://search.zeroish.xyz/",
"tor": null,
@ -147,13 +126,6 @@
"country": "PL",
"librey": false
},
{
"clearnet": "https://librex.yogeshlamichhane.com.np/",
"tor": null,
"i2p": null,
"country": "US",
"librey": false
},
{
"clearnet": "https://lx.benike.monster/",
"tor": null,
@ -169,10 +141,10 @@
"librey": false
},
{
"clearnet": "https://search.decentrala.org/",
"clearnet": "https://librex.pardesicat.xyz/",
"tor": null,
"i2p": null,
"country": "US",
"country": "KR",
"librey": false
}
]

View File

@ -51,7 +51,7 @@
list_instances($librey_instances);
?>
<p>The following instnaces are running the older <a href="https://github.com/hnhx/librex">LibreX</a>:</p>
<p>The following instances are running the older <a href="https://github.com/hnhx/librex">LibreX</a>:</p>
<?php
list_instances($librex_instances);
?>

View File

@ -7,7 +7,7 @@
<title>
<?php
$query = htmlspecialchars(trim($_REQUEST["q"]));
$query = trim($_REQUEST["q"]);
echo $query;
?> - LibreY</title>
</head>
@ -24,7 +24,7 @@
die();
}
echo "value=\"$query\"";
echo "value=\"" . htmlspecialchars($query) . "\"";
?>
>
<br>