Finally i made a really working scrape for TSSE..
I tested it on TSSE 5.4.1 but it should work on 5.6 also..
Have fun& cheers..
PHP Code:
<?php
//ts scrape fixed by Conjo for TS 5.4/5.6 28/06/2010
ini_set('zlib.output_compression_level', 3);
function fast_db_connect ()
{
$dbfile = './config/DATABASE';
if (!file_exists ($dbfile))
{
exit ('DATABASE Configuration file does not exists');
return null;
}
$data = unserialize (@file_get_contents ($dbfile));
if (!($connect = mysql_connect ($data['mysql_host'], $data['mysql_user'], $data['mysql_pass'])))
{
exit ('Error: Mysql Connection!');
;
}
if (!(mysql_select_db ($data['mysql_db'], $connect)))
{
exit ('Error: Mysql DB Selection!');
;
}
unset ($data);
}
fast_db_connect();
function sqlesc($x) {
return "'".mysql_real_escape_string($x)."'";
}
$info_hash = $_GET['info_hash'];
if(strlen($info_hash) != 20)
{
$info_hash = stripslashes(urldecode($info_hash));
}
if (strlen($info_hash) != 20)
{
exit ('Error: Invalid hash!');
}
else
{
$query = "SELECT info_hash, times_completed, seeders, leechers FROM torrents WHERE info_hash = \"" . mysql_real_escape_string($info_hash).'"';
}
$r = 'd5:filesd';
$res = mysql_query($query);
while ($row = @mysql_fetch_assoc($res)) {
$r .= "20:" . str_pad($row["info_hash"], 20) . "d" .
'8:completei' . $row["seeders"] . "e" .
'10:downloadedi' . $row["times_completed"] . "e" .
'10:incompletei' . $row["leechers"] . "e" .
"e";
}
$r .= "ee";
header("Content-Type: text/plain");
echo($r);
?>