Update Torrent.php

This commit is contained in:
Roman Kelesidis 2025-01-06 17:48:16 +07:00
commit 76fcbfed91

View file

@ -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);