示例#1
0
}
if (!$no_log_ip) {
    $res = mysqli_query($GLOBALS["___mysqli_ston"], "SELECT * FROM ips WHERE ip = " . ann_sqlesc($ip) . " AND userid =" . ann_sqlesc($userid)) or ann_sqlerr(__FILE__, __LINE__);
    if (mysqli_num_rows($res) == 0) {
        mysqli_query($GLOBALS["___mysqli_ston"], "INSERT LOW_PRIORITY INTO ips (userid, ip, lastannounce, type) VALUES (" . ann_sqlesc($userid) . ", " . ann_sqlesc($ip) . ", " . TIME_NOW . ",'announce')") or ann_sqlerr(__FILE__, __LINE__);
        $mc1->delete_value('ip_history_' . $userid);
        $mc1->delete_value('u_passkey_' . $passkey);
    } else {
        mysqli_query($GLOBALS["___mysqli_ston"], "UPDATE LOW_PRIORITY ips SET lastannounce = " . TIME_NOW . " WHERE ip = " . ann_sqlesc($ip) . " AND userid =" . ann_sqlesc($userid)) or ann_sqlerr(__FILE__, __LINE__);
        $mc1->delete_value('ip_history_' . $userid);
        $mc1->delete_value('u_passkey_' . $passkey);
    }
}
// End Ip logger
$realip = $_SERVER['REMOTE_ADDR'];
$torrent = get_torrent_from_hash($info_hash, $userid);
if (!$torrent) {
    err("torrent query error - contact site admin");
}
$torrentid = (int) $torrent["id"];
$torrent_modifier = get_slots($torrentid, $userid);
$torrent['freeslot'] = $torrent_modifier['freeslot'];
$torrent['doubleslot'] = $torrent_modifier['doubleslot'];
$happy_multiplier = get_happy($torrentid, $userid);
$fields = 'seeder, peer_id, ip, port, uploaded, downloaded, userid, (' . TIME_NOW . ' - last_action) AS announcetime, last_action AS ts, ' . TIME_NOW . ' AS nowts, prev_action AS prevts';
//== Wantseeds - Retro
$limit = '';
if ($torrent['numpeers'] > $rsize) {
    $limit = "ORDER BY RAND() LIMIT {$rsize}";
}
// if user is a seeder, then only supply leechers.
示例#2
0
if (!@($GLOBALS["___mysqli_ston"] = mysqli_connect($INSTALLER09['mysql_host'], $INSTALLER09['mysql_user'], $INSTALLER09['mysql_pass']))) {
    exit;
}
@(bool) mysqli_query($GLOBALS["___mysqli_ston"], "USE {$INSTALLER09['mysql_db']}") or exit;
$numhash = count($_GET['info_hash']);
$torrents = array();
if ($numhash < 1) {
    die("Scrape Error d5:filesdee");
} elseif ($numhash == 1) {
    $torrent = get_torrent_from_hash($_GET['info_hash']);
    if ($torrent) {
        $torrents[$_GET['info_hash']] = $torrent;
    }
} else {
    foreach ($_GET['info_hash'] as $hash) {
        $torrent = get_torrent_from_hash($hash);
        if ($torrent) {
            $torrents[$hash] = $torrent;
        }
    }
}
$user = get_user_from_torrent_pass($torrent_pass);
if (!$user || !count($torrents)) {
    die('scrape user error');
}
$r = 'd5:filesd';
foreach ($torrents as $info_hash => $torrent) {
    $r .= '20:' . $info_hash . 'd8:completei' . $torrent['seeders'] . 'e10:downloadedi' . $torrent['times_completed'] . 'e10:incompletei' . $torrent['leechers'] . 'ee';
}
$r .= 'ee';
header('Content-Type: text/plain; charset=UTF-8');
示例#3
0
@(bool) mysqli_query($GLOBALS["___mysqli_ston"], "USE {$INSTALLER09['mysql_db']}") or exit;
if (!isset($_GET['info_hash']) or strlen($_GET['info_hash']) != 20) {
    error('Invalid hash');
}
$numhash = count($_GET['info_hash']);
$torrents = array();
if ($numhash < 1) {
    die("Scrape Error d5:filesdee");
} elseif ($numhash == 1) {
    $torrent = get_torrent_from_hash(bin2hex($_GET['info_hash']));
    if ($torrent) {
        $torrents[$_GET['info_hash']] = $torrent;
    }
} else {
    foreach ($_GET['info_hash'] as $hash) {
        $torrent = get_torrent_from_hash(bin2hex($hash));
        if ($torrent) {
            $torrents[$hash] = $torrent;
        }
    }
}
$r = 'd5:filesd';
foreach ($torrents as $info_hash => $torrent) {
    $r .= '20:' . $info_hash . 'd8:completei' . $torrent['seeders'] . 'e10:downloadedi' . $torrent['times_completed'] . 'e10:incompletei' . $torrent['leechers'] . 'ee';
}
$r .= 'ee';
header('Content-Type: text/plain; charset=UTF-8');
header('Pragma: no-cache');
echo $r;
die;
//die($r);