Browse Source

added more frontends, removed some dead instances, fixed an issue regarding thepiratebay

hnhx 2 years ago
parent
commit
d6635f537c

+ 0 - 3
README.md

@@ -23,9 +23,6 @@
 | [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) |
-
 <br>
 
 ### About LibreX

+ 1 - 1
api.php

@@ -8,7 +8,7 @@
         <br/>
         <p>\"q\" is the keyword</p>
         <p>\"p\" is the result page (the first page is 0)</p>
-        <p>\"t\" is the search type (0=text, 1=image, 2=video, 3=torrent)</p>
+        <p>\"t\" is the search type (0=text, 1=image, 2=video, 3=torrent, 4=tor)</p>
         <br/>
         <p>The results are going to be in JSON format.</p>
         <p>The API supports both POST and GET requests.</p>";

+ 3 - 1
config.php.example

@@ -22,6 +22,8 @@
         "libreddit" => "", // reddit
         "proxitok" => "", // tiktok
         "wikiless" => "", // wikipedia
+        "quetre" => "", // quora
+        "libremdb" => "", // imdb
 
         /*
             To send requests trough a proxy uncomment CURLOPT_PROXY and CURLOPT_PROXYTYPE:
@@ -41,7 +43,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/107.0.0.0 Safari/537.36",
+            CURLOPT_USERAGENT => "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36",
             CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
             CURLOPT_CUSTOMREQUEST => "GET",
             CURLOPT_PROTOCOLS => CURLPROTO_HTTPS | CURLPROTO_HTTP,

+ 1 - 1
engines/ahmia/hidden_service.php

@@ -17,7 +17,7 @@
 
             array_push($results,
                 array (
-                    "title" => htmlspecialchars($title),
+                    "title" => $title ? htmlspecialchars($title) : "No description provided",
                     "url" =>  htmlspecialchars($url),
                     "base_url" => htmlspecialchars(get_base_url($url)),
                     "description" => htmlspecialchars($description)

+ 5 - 1
engines/bittorrent/thepiratebay.php

@@ -8,9 +8,13 @@
         $results = array();
         $json_response = json_decode($response, true);
 
-        foreach ($json_response as $response)
+        if (empty($json_response))
         {
+            return $results;
+        }
 
+        foreach ($json_response as $response)
+        {
             $size = human_filesize($response["size"]);
             $hash = $response["info_hash"]; 
             $name = $response["name"];

+ 1 - 1
engines/google/text.php

@@ -12,7 +12,7 @@
         curl_setopt_array($google_ch, $config->curl_settings);
         curl_multi_add_handle($mh, $google_ch);
 
-        $special_search = check_for_special_search($query);
+        $special_search = $page ? 0 : check_for_special_search($query);
         $special_ch = null;
         $url = null;
         if ($special_search != 0)

+ 0 - 12
instances.json

@@ -47,18 +47,6 @@
               "tor": null,
               "i2p": null,
               "country": "US"
-          },
-          {
-              "clearnet": "https://librex.smlan.dev/",
-              "tor": null,
-              "i2p": null,
-              "country": "HU"
-          },
-          {
-             "clearnet": "https://linxer.org/search/",
-             "tor": null,
-             "i2p": null,
-             "country": "DYN"
           }
     ]
 }

+ 1 - 1
misc/header.php

@@ -5,7 +5,7 @@
         <meta charset="UTF-8"/>
         <meta name="description" content="A privacy respecting meta search engine."/>
         <meta name="referrer" content="no-referrer"/>
-        <link rel="stylesheet" type="text/css" href="static/css/styles.css"/>
+        <link rel="stylesheet" type="text/css" href="static/css/styles_min.css"/>
         <link title="LibreX search" type="application/opensearchdescription+xml" href="/opensearch.xml?method=POST" rel="search"/>
         <link rel="stylesheet" type="text/css" href="<?php
                 echo "static/css/";

+ 3 - 1
misc/tools.php

@@ -47,7 +47,9 @@
             "twitter.com" => "nitter",
             "reddit.com" => "libreddit",
             "tiktok.com" => "proxitok",
-            "wikipedia.org" => "wikiless"
+            "wikipedia.org" => "wikiless",
+            "quora.com" => "quetre",
+            "imdb.com" => "libremdb"
         );
 
         foreach($frontends as $original => $frontend)

+ 1 - 1
search.php

@@ -42,7 +42,7 @@
                 <button name="t" value="1"><img src="static/images/image_result.png" alt="image result" />Images</button>
                 <button name="t" value="2"><img src="static/images/video_result.png" alt="video result" />Videos</button>
                 <button name="t" value="3"><img src="static/images/torrent_result.png" alt="torrent result" />Torrents</button>
-                <button name="t" value="4"><img src="static/images/hidden_service_result.png" alt="hidden service result" />Hidden services</button>
+                <button name="t" value="4"><img src="static/images/tor_result.png" alt="tor result" />Tor</button>
             </div>
         <hr>
         </form>

+ 14 - 0
settings.php

@@ -119,6 +119,20 @@
                             <?php echo isset($_COOKIE["wikiless"]) ? htmlspecialchars($_COOKIE["wikiless"])  : "\"$config->wikiless\""; ?>
                         >
                       </div>
+
+                      <div>
+                        <a for="quetre" href="https://github.com/zyachel/quetre" target="_blank">Quetre</a>
+                        <input type="text" name="quetre" placeholder="Replace Quora" value=
+                            <?php echo isset($_COOKIE["quetre"]) ? htmlspecialchars($_COOKIE["quetre"])  : "\"$config->quetre\""; ?>
+                        >
+                      </div>
+
+                      <div>
+                        <a for="libremdb" href="https://github.com/zyachel/libremdb" target="_blank">Libremdb</a>
+                        <input type="text" name="libremdb" placeholder="Replace IMDb" value=
+                            <?php echo isset($_COOKIE["libremdb"]) ? htmlspecialchars($_COOKIE["libremdb"])  : "\"$config->libremdb\""; ?>
+                        >
+                      </div>
                 </div>
                 <div>
                     <label>Disable frontends</label>

File diff suppressed because it is too large
+ 1 - 0
static/css/styles_min.css


+ 0 - 0
static/images/hidden_service_result.png → static/images/tor_result.png


Some files were not shown because too many files changed in this diff