function multitracker($info_hash, $data, &$tor_seeders, &$tor_leechers, &$tor_peers, $left=false)
{
global $bb_cfg;
if($data['tor_announcers'])
{
require_once(CLASS_DIR .'snoopy.php');
if(preg_match('#rutracker.org/forum#is', $data['tor_announcers']))
{
$snoopy = new Snoopy;
$snoopy->host = "rutracker.org";
$snoopy->agent = "Mozilla/6.0.2 (compatible; MSIE 6.0; Windows NT 5.1)";
$snoopy->referer = "http://rutracker.org/";
$snoopy->rawheaders["Pragma"] = "no-cache";
$submit_url = "http://login.rutracker.org/forum/login.php";
$snoopy->_submit_method = "POST";
$submit_vars = array (
'login_username' => $bb_cfg['multitracker']['login_rut'],
'login_password' => $bb_cfg['multitracker']['pass_rut'],
'login' => true,
);
$snoopy->submit($submit_url, $submit_vars);
$snoopy->_httpmethod = "GET";
$tor_seeders = $tor_leechers = '';
$tracker = array();
foreach (unserialize($data['tor_announcers']) as $url)
{
if(preg_match('#rutracker.org/forum#is', $url)) $tracker[] = $url;
}
foreach ($tracker as $url)
{
$snoopy->fetch($url);
if(!$snoopy->timed_out)
{
$content = $snoopy->results;
preg_match_all('#<div class="mrg_4 pad_4">.*?<b>(.*?)</b>.*?<b>(.*?)</b>#is', $content, $tor, PREG_SET_ORDER);
@$tor_seeders += (int) $tor[0][1];
@$tor_leechers += (int) $tor[0][2];
}
}
}
else
{
require_once(CLASS_DIR .'udptscraper.php');
require_once(CLASS_DIR .'httptscraper.php');
$udp = new udptscraper();
$http = new httptscraper();
$tracker = array();
foreach (unserialize($data['tor_announcers']) as $url)
{
$ann = (preg_match("/\?/", $url)) ? '&' : '?';
$tracker[] = str_replace($bb_cfg['multitracker']['search'], $bb_cfg['multitracker']['replace'], $url) . $ann;
}
foreach ($tracker as $url)
{
if(preg_match('#udp://#is', $url))
{
$dat = $udp->scrape($url, $info_hash);
}
else
{
$dat = $http->scrape($url, $info_hash);
}
$dat = $dat[$info_hash];
$tor_seeders = $dat['seeders'];
$tor_leechers = $dat['leechers'];
}
}
}
}