使用此脚本时,我的跟踪器只更新种子&我的种子的第一个跟踪器。
print("<tr><td class='desc'><b>" .T_("Torrent Stats"). ": </b></td><td valign='top' class='lista'>");
$seeders1 = $leechers1 = $downloaded1 = null;
$tres = SQL_Query_exec("SELECT url FROM announce WHERE torrent=$id");
while ($trow = mysql_fetch_assoc($tres)) {
$ann = $trow["url"];
$tracker = explode("/", $ann);
$path = array_pop($tracker);
$oldpath = $path;
$path = preg_replace("/^announce/", "scrape", $path);
$tracker = implode("/", $tracker)."/".$path;
if ($oldpath == $path) {
continue; // Scrape not supported, ignored
}
// TPB's tracker is dead. Use openbittorrent instead
if (preg_match("/thepiratebay.org/i", $tracker) || preg_match("/prq.to/", $tracker)) {
$tracker = "http://tracker.openbittorrent.com/scrape";
}
$stats = torrent_scrape_url($tracker, $row["info_hash"]);
if ($stats['seeds'] != -1) {
$seeders1 += $stats['seeds'];
$leechers1 += $stats['peers'];
$downloaded1 += $stats['downloaded'];
SQL_Query_exec("UPDATE `announce` SET `online` = 'yes', `seeders` = $stats[seeds], `leechers` = $stats[peers], `times_completed` = $stats[downloaded] WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");
} else {
SQL_Query_exec("UPDATE `announce` SET `online` = 'no' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");
}
}
如果我没能解决这个问题,请纠正。在第一个代码中,我认为问题在这里
$tres = SQL_Query_exec("SELECT url FROM announce WHERE torrent=$id");
$tres = SQL_Query_exec("SELECT url FROM announce WHERE torrent=$id");
$tres = SQL_Query_exec("SELECT url FROM announce WHERE torrent=".$id.";");
如果$id是一个php变量
问题是您正在向udp跟踪器发送http- scrape
。
UDP-tracker使用完全不同的协议:http://www.bittorrent.org/beps/bep_0015.html