Browse Source

added sukebei.nyaa.si results, added a new instance, fixed the imgur redirect URL

hnhx 2 years ago
parent
commit
c6701efd7c
5 changed files with 56 additions and 14 deletions
  1. 2 6
      README.md
  2. 6 1
      engines/bittorrent/merge.php
  3. 35 0
      engines/bittorrent/sukebei.php
  4. 12 6
      instances.json
  5. 1 1
      misc/tools.php

+ 2 - 6
README.md

@@ -5,7 +5,7 @@
   <img src="https://user-images.githubusercontent.com/49120638/207550159-4fa639a5-24e6-42e0-9e58-f04e5d18e391.png" width="400">
 </p>
 
-<p align="center">A privacy respecting free as in freedom meta search engine</p>
+<p align="center">Framework and javascript free privacy respecting meta search engine</p>
 
 <br>
 
@@ -29,6 +29,7 @@
 | [librex.ratakor.com](https://librex.ratakor.com/) | ❌ | ❌ | 🇫🇷 FR |
 | [search.tildevarsh.in](https://search.tildevarsh.in/) | ❌ | ❌ | 🇮🇳  IN |
 | [librex.myroware.eu](https://librex.myroware.eu/) | ❌ | ❌ | 🇩🇪 DE |
+| [search.mascotboi.xyz](https://search.mascotboi.xyz/) | ❌ | ❌ | 🇮🇳  IN |
 <br>
 
 ### Thanks rms
@@ -48,12 +49,7 @@ If you would like to learn more about LibreX check out the [Wiki](https://github
 <br>
 <br>
 
-### Mirror
 
-You can access the source code via this git mirror
-```
-git clone https://git.beparanoid.de/librex
-```
 ### LibreX compared to other metasearch engines
 
 | Name |  Works without JS | Privacy frontend redirect | Torrent results | API | No 3rd party libs used |

+ 6 - 1
engines/bittorrent/merge.php

@@ -10,6 +10,7 @@
         require "engines/bittorrent/yts.php";
         require "engines/bittorrent/torrentgalaxy.php";
         require "engines/bittorrent/1337x.php";
+        require "engines/bittorrent/sukebei.php";
 
         $query = urlencode($query);
 
@@ -19,7 +20,8 @@
             $nyaa_url,
             $yts_url,
             $torrentgalaxy_url,
-            $_1337x_url 
+            $_1337x_url,
+            $sukebei_url
         );
  
         $mh = curl_multi_init();
@@ -62,6 +64,9 @@
                 case 5:
                     $results = array_merge($results, get_1337x_results($response));
                     break;
+                case 6:
+                    $results = array_merge($results, get_sukebei_results($response));
+                    break;
             }
         }
         

+ 35 - 0
engines/bittorrent/sukebei.php

@@ -0,0 +1,35 @@
+<?php
+    $sukebei_url = "https://sukebei.nyaa.si/?q=$query";
+
+    function get_sukebei_results($response)
+    {
+        global $config;
+        $xpath = get_xpath($response);
+        $results = array();
+
+        foreach($xpath->query("//tbody/tr") as $result)
+        {
+            $name = $xpath->evaluate(".//td[@colspan='2']//a[not(contains(@class, 'comments'))]/@title", $result)[0]->textContent;
+            $centered = $xpath->evaluate(".//td[@class='text-center']", $result);
+            $magnet = $xpath->evaluate(".//a[2]/@href", $centered[0])[0]->textContent;
+            $magnet_without_tracker = explode("&tr=", $magnet)[0];
+            $magnet = $magnet_without_tracker . $config->bittorent_trackers;
+            $size =  $centered[1]->textContent;
+            $seeders =  $centered[3]->textContent;
+            $leechers =  $centered[4]->textContent;
+
+            array_push($results, 
+                array (
+                    "name" => htmlspecialchars($name),
+                    "seeders" => (int) $seeders,
+                    "leechers" => (int) $leechers,
+                    "magnet" => htmlspecialchars($magnet),
+                    "size" => htmlspecialchars($size),
+                    "source" => "sukebei.nyaa.si"
+                )
+            );
+        }
+
+        return $results;
+    }
+?>

+ 12 - 6
instances.json

@@ -12,12 +12,12 @@
               "i2p": "http://vernziqfqvweijfaacmwazohgpdo2bt2ib2jlupt2pwwu27bhgxq.b32.i2p/",
               "country": "US"
           },
-	  {
- 	      "clearnet": "https://lx.sesu.cc/",
-	      "tor": "http://lx.swxoebbpeqiiixyhbuh3vbw53pdrmtbiaj2sqveol6kkn5rpapfi4aad.onion/",
-	      "i2p": "http://37bw4xelfgivsih5s4s5cozkxkhgoeqx5bjfjnrnmv5utdtk45sa.b32.i2p/",
-	      "country": "CL"
-	  },
+          {
+              "clearnet": "https://lx.sesu.cc/",
+              "tor": "http://lx.swxoebbpeqiiixyhbuh3vbw53pdrmtbiaj2sqveol6kkn5rpapfi4aad.onion/",
+              "i2p": "http://37bw4xelfgivsih5s4s5cozkxkhgoeqx5bjfjnrnmv5utdtk45sa.b32.i2p/",
+              "country": "CL"
+          },
           {
               "clearnet": "https://librex.mikata.ru/",
               "tor": "http://f7ssz7l3biu4fugwctfpcx4txg5yq4gqhrt473ledsuc3ivtd3omniid.onion/",
@@ -95,6 +95,12 @@
               "tor": null,
               "i2p": null,
               "country": "DE"
+          },
+          {
+              "clearnet": "https://search.mascotboi.xyz",
+              "tor": null,
+              "i2p": null,
+              "country": "IN"
           }
     ]
 }

+ 1 - 1
misc/tools.php

@@ -66,7 +66,7 @@
         $frontends = array(
             "youtube.com" => "invidious",
             "instagram.com" => "bibliogram",
-            "imgur.io" => "rimgo",
+            "imgur.com" => "rimgo",
             "medium.com" => "scribe",
             "github.com" => "gothub",
             "odysee.com" => "librarian",