diff --git a/README.md b/README.md
index 3287969..906e929 100644
--- a/README.md
+++ b/README.md
@@ -14,23 +14,23 @@
| Clearnet | TOR | I2P | Country |
|-|-|-|-|
| [librex.beparanoid.de](https://librex.beparanoid.de/) | [β
](http://librex.2356uhnbpv5nk3bni5bv6jg2cd6lgj664kwx3lhyelstpttpyv4kk2qd.onion/) | β | ππΊ HU (OFFICIAL INSTANCE) |
-| [librex.extravi.dev](https://librex.extravi.dev/) | [β
](http://ncblhz7q4sfbf755bdbhebfzxcpypz7ewafgi4agatecojz7pln4i3id.onion/) | [β
](http://rra33hiaf6nmby7jfpqe2gqmng3jnzkvbu2n7jgce7vbhoyuhzya.b32.i2p/) | π©πͺ DE |
| [lx.vern.cc](https://lx.vern.cc/) | [β
](http://lx.vernccvbvyi5qhfzyqengccj7lkove6bjot2xhh5kajhwvidqafczrad.onion/) | [β
](http://vernziqfqvweijfaacmwazohgpdo2bt2ib2jlupt2pwwu27bhgxq.b32.i2p/) | πΊπΈ US |
-| [linxer.org/search](https://linxer.org/search/) | β | β | π·π΄ RO |
| [search.davidovski.xyz](https://search.davidovski.xyz/) | β | β | π¬π§ UK |
| [search.funami.tech](https://search.funami.tech/) | β | β | π°π· KR |
-| [librex.catalyst.sx](https://librex.catalyst.sx/) | β | β | πΊπΈ US |
| [search.madreyk.xyz](https://search.madreyk.xyz/) | β | β | π©πͺ DE |
| [search.pabloferreiro.es](https://search.pabloferreiro.es/) | β | β | π©πͺ DE |
| [buscar.weblibre.org](https://buscar.weblibre.org/) | β | β | π¨π± CL |
| [search.ahwx.org](https://search.ahwx.org/) | β | β | π³π± NL |
| [pufe.org](https://pufe.org/) | β | β | :new_zealand: NZ |
+| [librex.kitscomputer.tk](https://librex.kitscomputer.tk/) | β | β | πΊπΈ US |
+| [librex.smlan.dev](https://librex.smlan.dev/) | β | β | ππΊ HU |
+| [linxer.org](https://linxer.org/search/) | β | β | π³οΈ DYN (FORK) |
### About LibreX
-LibreX gives you results from Google, Brave, Qwant and popular torrent sites without spying on you.
+LibreX gives you results from Google, Brave, Qwant, Ahmia and popular torrent sites without spying on you.
If you would like to learn more about LibreX check out the [Wiki](https://github.com/hnhx/librex/wiki).
diff --git a/api.php b/api.php
index 374800f..e6666bf 100644
--- a/api.php
+++ b/api.php
@@ -46,6 +46,15 @@
$results = get_merged_torrent_results($query_encoded);
}
break;
+ case 4:
+ if ($config->disable_hidden_service_search)
+ $results = array("error" => "disabled");
+ else
+ {
+ require "engines/ahmia/hidden_service.php";
+ $results = get_hidden_service_results($query_encoded);
+ }
+ break;
default:
require "engines/google/text.php";
$results = get_text_results($query_encoded, $page);
@@ -53,5 +62,5 @@
}
header("Content-Type: application/json");
- echo json_encode($results, JSON_PRETTY_PRINT);
+ echo json_encode($results);
?>
diff --git a/config.php.example b/config.php.example
index 75e9717..dca7f39 100644
--- a/config.php.example
+++ b/config.php.example
@@ -10,6 +10,8 @@
"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",
+ "disable_hidden_service_search" => false,
+
/*
Preset privacy friendly frontends for users, these can be overwritten by users in settings
e.g.: "invidious" => "https://yewtu.be",
@@ -39,7 +41,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/106.0.0.0 Safari/537.36",
+ CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/107.0.0.0 Safari/537.36",
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_PROTOCOLS => CURLPROTO_HTTPS | CURLPROTO_HTTP,
diff --git a/engines/ahmia/hidden_service.php b/engines/ahmia/hidden_service.php
new file mode 100644
index 0000000..eb267e1
--- /dev/null
+++ b/engines/ahmia/hidden_service.php
@@ -0,0 +1,53 @@
+query("//ol[@class='searchResults']//li[@class='result']") as $result)
+ {
+ $url = "http://" . $xpath->evaluate(".//cite", $result)[0]->textContent;
+ $title = remove_special($xpath->evaluate(".//h4", $result)[0]->textContent);
+ $description = $xpath->evaluate(".//p", $result)[0]->textContent;
+
+ array_push($results,
+ array (
+ "title" => htmlspecialchars($title),
+ "url" => htmlspecialchars($url),
+ "base_url" => htmlspecialchars(get_base_url($url)),
+ "description" => htmlspecialchars($description)
+ )
+ );
+ }
+
+ return $results;
+ }
+
+ function print_hidden_service_results($results)
+ {
+ echo "
The host disabled this feature! :C
"; + else + { + require "engines/ahmia/hidden_service.php"; + $results = get_hidden_service_results($query_encoded); + print_elapsed_time($start_time); + print_hidden_service_results($results); + } break; default: diff --git a/static/images/hidden_service_result.png b/static/images/hidden_service_result.png new file mode 100644 index 0000000..a579cbb Binary files /dev/null and b/static/images/hidden_service_result.png differ