log not register torrent info_hash

This commit is contained in:
xiaomlove
2021-06-06 01:30:59 +08:00
parent 97d3de5e59
commit 25db588c95
2 changed files with 15 additions and 3 deletions
+7 -2
View File
@@ -52,8 +52,13 @@ class Test extends Command
public function handle() public function handle()
{ {
// $r = \Illuminate\Support\Facades\Schema::getColumnListing('torrents'); // $r = \Illuminate\Support\Facades\Schema::getColumnListing('torrents');
$r = urldecode('%b5%8f%7c%a9%85%ed%e2%bb%09%fd1%ab%8d%11%e5%11%bb%18%deD'); // $r = urldecode('%b5%8f%7c%a9%85%ed%e2%bb%09%fd1%ab%8d%11%e5%11%bb%18%deD');
$r = bin2hex($r); // $r = bin2hex($r);
$str = 'passkey=bef88d0cbe4ccbc1569b8404d09c4c5a&info_hash=%cd%8d%5b%09%08%d7%1d%01_o8%c0%e1Wd%ff%95%84J%e1&peer_id=-TR3000-zxcl8rs3my5o&port=51416&uploaded=0&downloaded=0&left=0&numwant=80&key=2d2ebd37&compact=1&supportcrypto=1&ipv6=240e%3A3b1%3A6400%3Ac20%3A211%3A32ff%3Afebb%3A9fb1';
$firstNeedle = "info_hash=";
$start = strpos($str, $firstNeedle) + strlen($firstNeedle);
$end = strpos($str, "&", $start);
$r = substr($str, $start, $end - $start);
dd($r); dd($r);
} }
+8 -1
View File
@@ -112,7 +112,14 @@ if (!$torrent = $Cache->get_value('torrent_hash_'.$info_hash.'_content')){
$Cache->cache_value('torrent_hash_'.$info_hash.'_content', $torrent, 350); $Cache->cache_value('torrent_hash_'.$info_hash.'_content', $torrent, 350);
} }
if (!$torrent) { if (!$torrent) {
do_log("[TORRENT NOT EXISTS] $checkTorrentSql, params: " . $_SERVER['QUERY_STRING']); $firstNeedle = "info_hash=";
$queryString = $_SERVER['QUERY_STRING'];
$start = strpos($queryString, $firstNeedle) + strlen($firstNeedle);
$end = strpos($queryString, "&", $start);
$infoHashUrlEncode = substr($queryString, $start, $end - $start);
do_log("[TORRENT NOT EXISTS] $checkTorrentSql, params: $queryString");
do_log("[TORRENT NOT EXISTS] infoHashUrlEncode: $infoHashUrlEncode");
err("torrent not registered with this tracker"); err("torrent not registered with this tracker");
} }
elseif ($torrent['banned'] == 'yes' && $az['class'] < $seebanned_class) err("torrent banned"); elseif ($torrent['banned'] == 'yes' && $az['class'] < $seebanned_class) err("torrent banned");