From 76fcbfed91431a1dc49a116f9a1ea7a94bbd110c Mon Sep 17 00:00:00 2001 From: Roman Kelesidis Date: Mon, 6 Jan 2025 17:48:16 +0700 Subject: [PATCH] Update Torrent.php --- src/Legacy/Torrent.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Legacy/Torrent.php b/src/Legacy/Torrent.php index d9f77558e..9af5e74a3 100644 --- a/src/Legacy/Torrent.php +++ b/src/Legacy/Torrent.php @@ -9,6 +9,7 @@ namespace TorrentPier\Legacy; +use TorrentPier\MultiTracker; use TorrentPier\TorrServerAPI; use Arokettu\Bencode\Bencode; @@ -395,6 +396,15 @@ class Torrent } } + // Getting multi-peers + if ($bb_cfg['tracker']['multitracker']['enabled']) { + $torrent = \Arokettu\Torrent\TorrentFile::loadFromString($file_contents); + $announcers = $torrent->getAnnounceList()->toArray(); + $multiTracker = new MultiTracker([ + bin2hex($info_hash ?? $info_hash_v2) + ], $announcers[0]); + } + if ($row = DB()->fetch_row("SELECT topic_id FROM " . BB_BT_TORRENTS . " $info_hash_where LIMIT 1")) { $msg = sprintf($lang['BT_REG_FAIL_SAME_HASH'], TOPIC_URL . $row['topic_id']); bb_die($msg);