Jump to content

µTorrent and TorrentBits-based trackers


zebulon

Recommended Posts

function getclient($httpagent, $peer_id)

{

if (preg_match("/^Azureus ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", $httpagent, $matches))

return "Azureus/$matches[1]";

elseif (preg_match("/BitTorrent\/S-([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches))

return "Shadow's/$matches[1]";

elseif (preg_match("/BitTorrent\/ABC-([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches))

return "ABC/$matches[1]";

elseif (preg_match("/ABC-([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches))

return "ABC/$matches[1]";

elseif (preg_match("/Rufus/([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches))

return "Rufus/$matches[1]";

elseif (preg_match("/BitTorrent\/U-([0-9]+\.[0-9]+\.[0-9]+)/", $httpagent, $matches))

return "UPnP/$matches[1]";

elseif (preg_match("/^BitTorrent\/T-(.+)$/", $httpagent, $matches))

return "BitTornado/$matches[1]";

elseif (preg_match("/^BitTornado\/T-(.+)$/", $httpagent, $matches))

return "BitTornado/$matches[1]";

elseif (preg_match("/^BitTorrent\/brst(.+)/", $httpagent, $matches))

return "Burst/$matches[1]";

elseif (preg_match("/^RAZA (.+)$/", $httpagent, $matches))

return "Shareaza/$matches[1]";

elseif (substr($httpagent, 0, 8) == "MLdonkey")

return "MLDonkey/" . substr($httpagent, 9);

//Try to figure it out by peer id

elseif (substr($peer_id, 0, 1) == "T")

return "BitTornado/" . substr($peer_id, 1, 1) . "." . substr($peer_id, 2, 1) . "." . substr($peer_id, 3, 1);

elseif (substr($peer_id, 0, 4) == "exbc" && substr($peer_id, 6, 4) == "LORD")

return "BitLord/" . ord(substr($peer_id, 4, 1)) . "." . ord(substr($peer_id, 5, 1));

elseif (substr($peer_id, 1, 2) == "BC")

return "BitComet/" . (0 + substr($peer_id, 3, 2)) . "." . (0 + substr($peer_id, 5, 2));

elseif (substr($peer_id, 1, 2) == "UT")

return "µTorrent/" . (0 + substr($peer_id, 3, 1)) . "." . (0 + substr($peer_id, 4, 1)) . "." . (0 + substr($peer_id, 5, 1));

elseif (substr($peer_id, 0, 4) == "exbc")

return "BitComet/" . ord(substr($peer_id, 4, 1)) . "." . ord(substr($peer_id, 5, 1));

elseif (substr($peer_id, 1, 3) == "UTB")

return "BitComet/" . ord(substr($peer_id, 4, 1)) . "." . ord(substr($peer_id, 5, 1));

elseif (substr($peer_id, 0, 5) == "Mbrst")

return "Burst/" . substr($peer_id, 5, 1) . "." . substr($peer_id, 7, 1) . "." . substr($peer_id, 9, 1);

elseif (substr($peer_id, 2, 2) == "BS")

return "BitSpirit/" . ord(substr($peer_id, 1, 1)) . "." . ord(substr($peer_id, 0, 1));

elseif (preg_match("/^M([0-9])-([0-9])-([0-9])/", $peer_id, $matches))

return "Mainline/{$matches[1]}.{$matches[2]}.{$matches[3]}";

elseif (substr($peer_id, 1, 2) == "G3")

return "G3 Torrent";

elseif (substr($peer_id, 1, 2) == "AR")

return "Arctic Torrent";

elseif (substr($peer_id, 1, 2) == "KT")

return "KTorrent";

elseif (substr($peer_id, 1, 3) == "BOW")

return "Bits on Wheels";

elseif (substr($peer_id, 0, 3) == "XBT")

return "XBT/".substr($peer_id, 3, 1).".".substr($peer_id, 4, 1).".".substr($peer_id, 5, 1);

//Regular Old Bittorrent

elseif (substr($peer_id, 1, 2) == "AZ" && !preg_match("/^Azureus ([0-9]+\.[0-9]+\.[0-9]+\.[0-9]+)/", $httpagent))

return "FAKE AZUREUS";

elseif (preg_match("/libtorrent/i", $httpagent, $matches))

return "LibTorrent";

elseif (substr($httpagent, 0, 13) == "Python-urllib")

return "BitTorrent/" . substr($httpagent, 14);

elseif (preg_match("/^BitTorrent\/([0-9]+(\.[0-9]+)*)/", $httpagent, $matches))

return "BitTorrent/$matches[1]";

elseif (preg_match("/^BitTorrent\/([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches))

return "BitTorrent/$matches[1]";

elseif (preg_match("/^Python-urllib\/.+?, BitTorrent\/([0-9]+\.[0-9]+(\.[0-9]+)*)/", $httpagent, $matches))

return "BitTorrent/$matches[1]";

else

return "---";

}

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...