Bläddra i källkod

1.0.1 Hot fix for torent crawlers

More consistent date creation with mktime demanding int for it's values.
Arnan de Gans 1 år sedan
förälder
incheckning
cd8a27eac1
3 ändrade filer med 8 tillägg och 3 borttagningar
  1. 1 1
      engines/torrent/1337x.php
  2. 1 1
      engines/torrent/nyaa.php
  3. 6 1
      readme.md

+ 1 - 1
engines/torrent/1337x.php

@@ -116,7 +116,7 @@ class LeetxRequest extends EngineRequest {
 			$seeders = $xpath->evaluate(".//td[@class='coll-2 seeds']", $result)[0]->textContent;
 			$leechers = $xpath->evaluate(".//td[@class='coll-3 leeches']", $result)[0]->textContent;
 			$date_added = explode(" ", sanitize($xpath->evaluate(".//td[@class='coll-date']", $result)[0]->textContent));
-			$date_added = mktime(0, 0, 0, date("m", strtotime($date_added[0])), preg_replace('/[^\d.]+/', '', $date_added[1]), intval('20'.preg_replace('/[^\d.]+/', '', $date_added[2])));
+			$date_added = mktime(0, 0, 0, intval(date("m", strtotime($date_added[0]))), intval(preg_replace('/[^\d.]+/', '', $date_added[1])), intval('20'.preg_replace('/[^\d.]+/', '', $date_added[2])));
 			$url = "https://1337x.to".sanitize($xpath->evaluate(".//td[@class='coll-1 name']/a/@href", $result)[1]->textContent);
 			$size_unformatted = explode(" ", $xpath->evaluate(".//td[contains(@class, 'coll-4 size')]", $result)[0]->textContent);
 			$size = $size_unformatted[0] . " " . preg_replace("/[0-9]+/", "", $size_unformatted[1]);

+ 1 - 1
engines/torrent/nyaa.php

@@ -32,7 +32,7 @@ class NyaaRequest extends EngineRequest {
             $size =  $meta[1]->textContent;
             $date_added =  $meta[2]->textContent;
             $date_added = explode("-", substr(sanitize($date_added), 0, 10));
-			$date_added = mktime(0, 0, 0, $date_added[1], $date_added[2], $date_added[0]);
+			$date_added = mktime(0, 0, 0, intval($date_added[1]), intval($date_added[2]), intval($date_added[0]));
             $magnet = $xpath->evaluate(".//a[2]/@href", $meta[0])[0]->textContent;
 
             array_push($results, array (

+ 6 - 1
readme.md

@@ -47,12 +47,17 @@ Have fun finding things!
 ## Disclaimer
 Goosle started as a fork of LibreY, and ended up as a rewrite and something different completely. While the code structure remains largely the same, most functions have been rewritten or altered to work as I need it to.
 Search results take design cues from DuckDuckGo and the torrent search has been modified to show more useful information where possible.
-
 Goosle does not index, store or distribute torrent files. If you like, or found a use for, what you downloaded, you should probably buy a legal copy of it.
 
+THe name Goosle is my last name with an L added in. Translate it from Dutch. Not in any way a derivation of Google and DuckDuckGo combined :wink:.
+
 ## Support
 Goosle comes with limited support. You can post your questions on Github or on my support forum on [ajdg.solutions](https://ajdg.solutions/support/).
 
 ## Changelog
+1.0.1 - December 5, 2023
+- [fix] mktime() getting intermittent strings in 1337x crawler.
+- [fix] mktime() getting intermittent strings in nyaa crawler.
+
 1.0 - December 5, 2023
 - Initial release