09 Private Tracker Patch

Started by Mindless, February 03, 2013, 06:57:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.



Sure the credits to Laffin as author.

takeupload.php find and delete

Code (php) Select
if (!in_array($ann, $TBDEV['announce_urls'], 1))
bark("invalid announce url! must be <b>" . $TBDEV['announce_urls'][0] . "</b>");

find and delete

Code (php) Select


Code (php) Select
$infohash = pack("H*", sha1($info["string"]));

above it add

Code (php) Select
$dict['value']['announce']=bdec(benc_str($TBDEV['announce_urls'][0] )); // change announce url to local
$dict['value']['info']['value']['private']=bdec('i1e'); // add private tracker flag
$dict['value']['info']['value']['source']=bdec(benc_str( "{$TBDEV['baseurl']} {$TBDEV['site_name']}")); // add link for bitcomet users
unset($dict['value']['announce-list']); // remove multi-tracker capability
unset($dict['value']['nodes']); // remove cached peers (Bitcomet & Azareus)
$dict=bdec(benc($dict)); // double up on the becoding solves the occassional misgenerated infohash
list($ann, $info) = dict_check($dict, "announce(string):info");


Code (php) Select
move_uploaded_file($tmpname, "{$TBDEV['torrent_dir']}/$id.torrent");

replace with

Code (php) Select
$fp = fopen("{$TBDEV['torrent_dir']}/$id.torrent", "w");
if ($fp)
@fwrite($fp, benc($dict), strlen(benc($dict)));

announce.php find

Code (php) Select
$resp = "d" . benc_str("interval") . "i" . $TBDEV['announce_interval'] . "e" . benc_str("peers") . "l";

and replace with

Code (php) Select
$resp = "d" . benc_str("interval") . "i" . $TBDEV['announce_interval'] . "e" . benc_str("private") . 'i1e' . benc_str("peers") . "l";