Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev > Mods & Themes
Reply
  #31  
Old 25th November 2013, 15:24
Birkoff's Avatar
Birkoff Birkoff is offline
Senior Member
 
Join Date: Aug 2010
P2P
Posts: 24
Default Cleanup.php ??
Where is the external scrape for cleanup.php? This is my mode DHT and is not completed!
Reply With Quote
  #32  
Old 25th November 2013, 17:10
MJUER MJUER is offline
Senior Member
 
Join Date: Aug 2012
P2P
Posts: 23
Thumbs up DHT upload mod-Cleanup
PHP Code:
////////////////////////////////////////////// Scrape external Torrents /////////////////////////////////////////////

class tsniff {
var 
$version '1.0a';
var 
$class_name 'TSniff';

var 
$url;
var 
$infohash;
var 
$seeders;
var 
$leechers;
var 
$completed;
var 
$name;
var 
$err=0;
var 
$error;

function 
doscrape()
{
$this->err=0;
$this->error=null;
if(empty(
$this->url)) {
$this->err=1;
$this->error 'Empty url';
return(
$this->err=1);
}
$ch curl_init();

curl_setopt ($chCURLOPT_URL$this->url);
curl_setopt ($chCURLOPT_HEADER0);
curl_setopt ($chCURLOPT_AUTOREFERER0);
curl_setopt ($chCURLOPT_TIMEOUT4);
curl_setopt ($chCURLOPT_FOLLOWLOCATION1);
curl_setopt ($chCURLOPT_MAXREDIRS5);
curl_setopt ($chCURLOPT_RETURNTRANSFER1);
curl_setopt ($chCURLOPT_ENCODING'gzip');
curl_setopt ($chCURLOPT_USERAGENT'BitTornado/T-0.3.14a (TSniff 1.0.0 - Torrent Stats)');

$dict=$x=curl_exec ($ch);
if (
curl_errno($ch)) {
$this->errorcurl_error($ch);
$this->err=2;
} else {
curl_close($ch);
$dict=bdec($dict);
if(empty(
$dict))
{
$this->err=3;
$this->error="Invalid scrape results. $x";
echo 
$x;
} elseif(
$dict['type']!='dictionary') {
$this->err=4;
$this->error="Not a Dictionary";
} else {
$dict=$dict['value']['files'];
if(!empty(
$dict))
{
$dict=$dict['value'];
$ih=array_keys($dict);
$dict=$dict[$ih[0]];
$this->infohash=bin2hex(stripslashes($ih[0]));
$dict=$dict['value'];
$this->seeders=$dict['complete']['value'];
$this->leechers=$dict['incomplete']['value'];
$this->completed=$dict['downloaded']['value'];
$this->name=$dict['name']['value'];
} else {
$this->err=5;
$this->error="Invalid scrape info .'$x'";
}
}
}
if(
$this->err)
$this->seeds=$this->leechers=$this->completed=$this->name=$this->infohash=null;
return(
$this->err);
}
function 
tsniff($url)
{
$this->url=$url;
return(
$this->doscrape());
}
}

mysql_query("UPDATE torrents SET seeders = '1' WHERE seeders = '0' AND extern ='yes'")  or sqlerr(__FILE____LINE__);
mysql_query("UPDATE torrents SET visible = 'yes' WHERE extern ='yes'")  or sqlerr(__FILE____LINE__);
mysql_query("UPDATE torrents SET free = 'no' WHERE extern ='yes'")  or sqlerr(__FILE____LINE__);
mysql_query("UPDATE torrents SET x2 = 'no' WHERE extern ='yes'")  or sqlerr(__FILE____LINE__);

//-------------------------------------------------- Set free by size ---------------------------------------------------//
mysql_query("UPDATE torrents SET free = 'yes' WHERE extern ='yes' AND size >'4294967296'")  or sqlerr(__FILE____LINE__);
mysql_query("UPDATE torrents SET x2 = 'yes' WHERE extern ='yes' AND size >'21474836480'")  or sqlerr(__FILE____LINE__);

//------------------------------------------------------ Set XXX --------------------------------------------------------//
mysql_query("UPDATE torrents SET free = 'no' WHERE extern ='yes' AND category ='14'")  or sqlerr(__FILE____LINE__);

//---------------------------------------------- Set free by categories -------------------------------------------------//
mysql_query("UPDATE torrents SET free = 'yes' WHERE extern ='yes' AND category ='18'")  or sqlerr(__FILE____LINE__);
mysql_query("UPDATE torrents SET free = 'yes' WHERE extern ='yes' AND category ='19'")  or sqlerr(__FILE____LINE__);
mysql_query("UPDATE torrents SET free = 'yes' WHERE extern ='yes' AND category ='33'")  or sqlerr(__FILE____LINE__);

/////////////////////////////////////////////// END Scrape external Torrents ////////////////////////////////////////////// 
Reply With Quote
Reply

Tags
dht , mod , upload

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 15:48. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.