LibreY

- privacy respecting meta search engine
git clone git://git.acid.vegas/LibreY.git
Log | Files | Refs | Archive | README | LICENSE

commit e11a20cedf17d052bafae40735dad213ea11c945
parent ee3ac90b392e25325d787f79c8dca67445453527
Author: hnhx <49120638+hnhx@users.noreply.github.com>
Date: Sat, 24 Jun 2023 08:51:30 +0000

Merge pull request #235 from amogusussy/fix-rutor Fix rutor's size and seed/leech number.

Diffstat:
Mengines/bittorrent/rutor.php | 8++++----

1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/engines/bittorrent/rutor.php b/engines/bittorrent/rutor.php
@@ -10,20 +10,20 @@
 
         foreach($xpath->query("//table/tr[@class='gai' or @class='tum']") as $result)
         {
-
             $name = $xpath->evaluate(".//td/a", $result)[2]->textContent;
             $magnet =  $xpath->evaluate(".//td/a/@href", $result)[1]->textContent;
             $magnet_without_tracker = explode("&tr=", $magnet)[0];
             $magnet = $magnet_without_tracker . $config->bittorent_trackers;
-            $size = $xpath->evaluate(".//td", $result)[3]->textContent;
+            $td = $xpath->evaluate(".//td", $result);
+            $size = $td[count($td) == 5 ? 3 : 2]->textContent;
             $seeders = $xpath->evaluate(".//span", $result)[0]->textContent;
             $leechers = $xpath->evaluate(".//span", $result)[1]->textContent;
 
             array_push($results, 
                 array (
                     "name" => htmlspecialchars($name),
-                    "seeders" => (int) remove_special($seeders),
-                    "leechers" => (int) remove_special($leechers),
+                    "seeders" => (int) filter_var($seeders, FILTER_SANITIZE_NUMBER_INT),
+                    "leechers" => (int) filter_var($leechers, FILTER_SANITIZE_NUMBER_INT),
                     "magnet" => htmlspecialchars($magnet),
                     "size" => htmlspecialchars($size),
                     "source" => "rutor.info"