Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
[ADDON] Disable DHT
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / v2.08 / v2 Only Mods Complete

Unknown User
2008-06-02 00:46:48
torrents-upload.php, find:



$ret = mysql_query("INSERT INTO torrents






add before:







if ($external == "no") {

   require_once("backend/BDecode.php");

   require_once("backend/BEncode.php");

   $dict = BDecode(file_get_contents("$torrent_dir/$fname"));

   $dict["info"]["private"] = 1;

   $fs = fopen("$torrent_dir/$fname", "w");

   fwrite($fs, BEncode($dict));

   fclose($fs);

   $TorrentInfo = array();

   $TorrentInfo = ParseTorrent("$torrent_dir/$fname");

   $infohash = $TorrentInfo[1];

}

Unknown User
2008-07-06 22:27:37
nice, how about all the torrents already on the site? is there a way to patch those
Unknown User
2008-08-28 08:48:52
QUOTE (Lenaud01 @ Jul 6 2008, 11:27 PM)

nice, how about all the torrents already on the site? is there a way to patch those

This should be able to do it:



<?

set_time_limit(0);

require("backend/functions.php");

dbconn(false);

require_once("backend/BDecode.php");

require_once("backend/BEncode.php");

require_once("backend/parse.php");

$torrent_dir = $site_config['torrent_dir'];

$res = mysql_query("SELECT id FROM torrents WHERE external = 'no'");

while ($row=mysql_fetch_assoc($res)) {

   $id = $row["id"];    $dict = BDecode(file_get_contents("$torrent_dir/$id.torrent"));

   $dict["info"]["private"] = 1;

   $fs = fopen("$torrent_dir/$id.torrent", "w");

   fwrite($fs, BEncode($dict));

   fclose($fs);

   $TorrentInfo = array();

   $TorrentInfo = ParseTorrent("$torrent_dir/$id.torrent");

   $infohash = $TorrentInfo[1];

   mysql_query("UPDATE torrents SET info_hash='$infohash' WHERE id=$id");

}

?>

Unknown User
2008-09-03 16:48:59
working perfect thanks  :)  TS is a life saver
Unknown User
2009-02-01 16:21:47
I applied your patch, but now the peers don't want to connect anymore.
Unknown User
2009-02-08 21:46:07
you need re-download all torrent, working perfect!
Unknown User
2009-02-16 06:21:56
excuses me for my bad english,

is it necessary to install this on the version 2.05 ?

Why is it important to desable DHT ?

thank for your answers
Unknown User
2009-02-16 11:31:57
"Lisan, post: 53866":
excuses me for my bad english,
is it necessary to install this on the version 2.05 ?

Why is it important to desable DHT ?

thank for your answers

it depends on what kind of tracker you run. if you have a tracker where you upload external torrents then leaving dht on your site is better for your members. if you have a private tracker where you only upload torrents with your announce then you need to do this mod or your stats will be incorrect and also it adds security for your members. if you want to know what dht is then either look on Wikipedia or take a look on the Utorrent site. i think there are even a few post on this forum that explain a little bit more about dht.
Unknown User
2009-05-31 15:57:48
QUOTE (TorrentialStorm @ Aug 28 2008, 09:48 AM)

This should be able to do it:



<?

set_time_limit(0);

require("backend/functions.php");

dbconn(false);

require_once("backend/benc.php");

require_once("backend/parse.php");

$torrent_dir = $site_config['torrent_dir'];

$res = mysql_query("SELECT id FROM torrents WHERE external = 'no'");

while ($row=mysql_fetch_assoc($res)) {

   $id = $row["id"];

   $dict = bdec_file("$torrent_dir/$id.torrent", filesize("$torrent_dir/$id.torrent"));

   $dict["value"]["info"]["value"]["private"]["type"] = "integer";

   $dict["value"]["info"]["value"]["private"]["value"] = 1;

   $fs = fopen("$torrent_dir/$id.torrent", "w");

   fwrite($fs, benc($dict));

   fclose($fs);

   $TorrentInfo = array();

   $TorrentInfo = ParseTorrent("$torrent_dir/$id.torrent");

   $infohash = $TorrentInfo[1];

   mysql_query("UPDATE torrents SET info_hash='$infohash' WHERE id=$id");

}

?>




Thx a lot TS [img]style_emoticons/default/smile.gif[/img]

But when i paste this patch for all torrent, i have an error :

'Parser Error: Error Opening torrent, unabled to get contents'

Any ideas ?
Unknown User
2009-06-04 08:30:32
up ?
Unknown User
2009-06-29 03:39:06
that means the torrent directory thers something wrong with it
Unknown User
2009-07-18 13:06:13
i need to re-able a DHT for all my old torrent..

i can? what is the code to apply?

thanx
Unknown User
2009-09-14 04:58:16
@TorrentialStorm,

Thanks for great and clean code.

But it stop only in upload page and not in announce.php

Please tell me, how to prevent cheaters that use multiple trackers to increase ammount uploaded in every tracker listed in torrent previously uploaded with single tracker?

Scenario:

- config.php

-- $site_config['ALLOWEXTERNAL'] = false;

Issue:

- Users can add trackers url later, by editing torrent file without lost hash with [url="http://torrenteditor.com"]http://torrenteditor.com[/url] or something else.

- Every announce update will count total uploaded and downloaded ammount sent by client, and update it in every tracker listed on announce-list

- Possibility of exchange all peers from all trackers listed in announce-list, increasing total ammount of data to all peers in their trackers, and increasing more false uploaded ammount for every peer of every tracker listed.

- This is similar cheat of false announcements of ratiomaker, ratiomaster, or something like it.

So, my view point is correct or not?

If it's true, I have some suggestions to be included on torrents-upload.php, download.php and announce.php

Thanks in advance.
Unknown User
2009-09-14 08:11:29
i knowyou directed this to TorrentialStorm, but i can tell you that by adding another tracker url it does not affect the stats on your site. the only think people would complain about is that they are uploading more than what is reflected on the site when the dht is turned on in their client or when they add another url to the list. your tracker will not get upload and download stats from the other urls. if a person really wanted to they could download a torrent file from your site connect to a few people and then remove the passkey at the end of the announce and none of the download would show on your site then they could put the passkey back and only upload after they have downloaded and there is nothing you can do to stop it also they would not have to use a torrent editor to edit the announce urls in the torrent file because most clients let you edit it.

"NeiPCs, post: 59983":
@TorrentialStorm,
Thanks for great and clean code.

But it stop only in upload page and not in announce.php

Please tell me, how to prevent cheaters that use multiple trackers to increase ammount uploaded in every tracker listed in torrent previously uploaded with single tracker?

Scenario:

- config.php

-- $site_config['ALLOWEXTERNAL'] = false;

Issue:

- Users can add trackers url later, by editing torrent file without lost hash with [url="http://torrenteditor.com"]http://torrenteditor.com[/url] or something else.

- Every announce update will count total uploaded and downloaded ammount sent by client, and update it in every tracker listed on announce-list

- Possibility of exchange all peers from all trackers listed in announce-list, increasing total ammount of data to all peers in their trackers, and increasing more false uploaded ammount for every peer of every tracker listed.

- This is similar cheat of false announcements of ratiomaker, ratiomaster, or something like it.

So, my view point is correct or not?

If it's true, I have some suggestions to be included on torrents-upload.php, download.php and announce.php

Thanks in advance.
Unknown User
2009-11-17 20:51:10
QUOTE (TorrentialStorm @ Aug 28 2008, 09:48 AM)

This should be able to do it:



<?

set_time_limit(0);

require("backend/functions.php");

dbconn(false);

require_once("backend/benc.php");

require_once("backend/parse.php");

$torrent_dir = $site_config['torrent_dir'];

$res = mysql_query("SELECT id FROM torrents WHERE external = 'no'");

while ($row=mysql_fetch_assoc($res)) {

   $id = $row["id"];

   $dict = bdec_file("$torrent_dir/$id.torrent", filesize("$torrent_dir/$id.torrent"));

   $dict["value"]["info"]["value"]["private"]["type"] = "integer";

   $dict["value"]["info"]["value"]["private"]["value"] = 1;

   $fs = fopen("$torrent_dir/$id.torrent", "w");

   fwrite($fs, benc($dict));

   fclose($fs);

   $TorrentInfo = array();

   $TorrentInfo = ParseTorrent("$torrent_dir/$id.torrent");

   $infohash = $TorrentInfo[1];

   mysql_query("UPDATE torrents SET info_hash='$infohash' WHERE id=$id");

}

?>




Where to put this ??
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 3
  • Members: 0
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728