Chez |
5th March 2013 10:13 |
09 Private Tracker Patch
Credits to Laffin.
takeupload.php find and delete
PHP Code:
if (!in_array($ann, $TBDEV['announce_urls'], 1))
bark("invalid announce url! must be <b>" . $TBDEV['announce_urls'][0] . "</b>");
find and delete
find
PHP Code:
$infohash = pack("H*", sha1($info["string"]));
above it add
PHP Code:
$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");
find
PHP Code:
move_uploaded_file($tmpname, "{$TBDEV['torrent_dir']}/$id.torrent");
replace with
PHP Code:
$fp = fopen("{$TBDEV['torrent_dir']}/$id.torrent", "w");
if ($fp)
{
@fwrite($fp, benc($dict), strlen(benc($dict)));
fclose($fp);
}
announce.php find
PHP Code:
$resp = "d" . benc_str("interval") . "i" . $TBDEV['announce_interval'] . "e" . benc_str("peers") . "l";
and replace with
PHP Code:
$resp = "d" . benc_str("interval") . "i" . $TBDEV['announce_interval'] . "e" . benc_str("private") . 'i1e' . benc_str("peers") . "l";
|