ソースを参照

1.0.1 Hot fix for torent crawlers

More consistent date creation with mktime demanding int for it's values.
Arnan de Gans 1 年間 前
コミット
cd8a27eac1
3 ファイル変更8 行追加3 行削除
  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;
 			$seeders = $xpath->evaluate(".//td[@class='coll-2 seeds']", $result)[0]->textContent;
 			$leechers = $xpath->evaluate(".//td[@class='coll-3 leeches']", $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 = 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);
 			$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_unformatted = explode(" ", $xpath->evaluate(".//td[contains(@class, 'coll-4 size')]", $result)[0]->textContent);
 			$size = $size_unformatted[0] . " " . preg_replace("/[0-9]+/", "", $size_unformatted[1]);
 			$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;
             $size =  $meta[1]->textContent;
             $date_added =  $meta[2]->textContent;
             $date_added =  $meta[2]->textContent;
             $date_added = explode("-", substr(sanitize($date_added), 0, 10));
             $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;
             $magnet = $xpath->evaluate(".//a[2]/@href", $meta[0])[0]->textContent;
 
 
             array_push($results, array (
             array_push($results, array (

+ 6 - 1
readme.md

@@ -47,12 +47,17 @@ Have fun finding things!
 ## Disclaimer
 ## 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.
 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.
 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.
 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
 ## 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/).
 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
 ## 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
 1.0 - December 5, 2023
 - Initial release
 - Initial release