you can scrape udp trackers on tt script u need udptscraper.php,tscraper.php&mega-scraper.php
You can find it here
https://github.com/johannes85/PHP-Torrent-Scraper
Place the udptscraper in backend folder and place tscraper in your root directory
Code for Mega-scrape.php
PHP Code:
<?php
#============================#
# TorrentTrader v2.08 #
# http://torrenttrader.org #
#----------------------------#
# Modified by BigMax #
#============================#
require_once("backend/functions.php");
require_once("backend/BDecode.php");
require_once("backend/parse.php");
require_once("backend/udptscraper.php");
dbconn(false);
set_time_limit(0);
$interval = 60; // Rescrape torrents every 2 days
$ts = gmtime() - $interval;
$res = mysql_query("SELECT id, name, info_hash FROM torrents WHERE external = 'yes' AND last_action <= FROM_UNIXTIME($ts) ORDER BY last_action DESC LIMIT 1");
$count = get_row_count("torrents", "WHERE external = 'yes' AND last_action <= FROM_UNIXTIME($ts)");
while ($row = mysql_fetch_array($res))
{
$TorrentInfo = ParseTorrent("$site_config[torrent_dir]/$row[id].torrent");
$ann = $TorrentInfo[0];
$annlist = array();
if ($TorrentInfo[6])
{
foreach ($TorrentInfo[6] as $ann)
{
$annlist[] = $ann[0];
}
}
else
$annlist = array($ann);
$seeders = $leechers = $downloaded = null;
echo "<br><font color=blue><b>Torrent ID: $row[id]</b></font> - <b>$row[name]</b><br><font color=blue><b>Info Hash: $row[info_hash]</b></font><br>";
foreach ($annlist as $ann)
{
$tracker = explode("/", $ann);
$path = array_pop($tracker);
$oldpath = $path;
$path = str_replace("announce", "scrape", $path);
$tracker = implode("/", $tracker)."/".$path;
if ($oldpath == $path)
{
echo "<br><b>$ann</b>: Scrape not supported.<br>";
continue;
}
// TPB's tracker is dead. Use openbittorrent instead
if ($openbittorrent_done)
continue;
if (preg_match("/thepiratebay.org/i", $tracker) || preg_match("/prq.to/", $tracker))
{
$tracker = "udp://tracker.publicbt.com:80/scrape";
$openbittorrent_done = 1;
}
if(preg_match('%udp://([^:/]*)(?::([0-9]*))?(?:/)?%si', $tracker))
{
$udp=true;
try
{
$timeout = 10;
$udp= new udptscraper($timeout);
$stats=$udp->scrape($tracker,$row["info_hash"]);
foreach ($stats as $id=>$scrape)
{
$seeders += $scrape['seeders'];
$leechers += $scrape['leechers'];
$downloaded += $scrape['completed'];
}
}
catch(ScraperException $e)
{
//echo('<br>Error: ' . $e->getMessage() . "\n");
//echo('Connection error: ' . ($e->isConnectionError() ? 'yes' : 'no') . "\n");
}
}
else
{
$stats = torrent_scrape_url($tracker, $row["info_hash"]);
}
if ($stats['seeds'] != -1)
{
$seeders += $stats['seeds'];
$leechers += $stats['peers'];
$downloaded += $stats['downloaded'];
echo "<table class='table table-bordered'><thead><tr>
<th>TRACKER NAME</th>
<th>Seeders:</th> <br>
<th>Leechers:</th> <br>
<th>Downloaded:</th><br>
</tr></thead><tbody><tr>
<td><b>$ann</b><br></td>
<td>".($udp?$scrape['seeders']:$stats["seeds"])."</td><td>".($udp?$scrape['leechers']:$stats["peers"])."</td><td> ".($udp?$scrape['completed']:$stats["downloaded"])."</td></tr></tbody></table>";
mysql_query("UPDATE announce SET online='yes',
seeders=".($udp?$scrape['seeders']:$stats["seeds"]).",
leechers=".($udp?$scrape['leechers']:$stats["peers"]).", times_completed= ".($udp?$scrape['completed']:$stats["downloaded"])."
WHERE url='$ann' AND torrent='$row[id]' ");
}
else
{
echo "<br><b>$ann</b>: <font color=red>Tracker timed out.</font><br>";
mysql_query("UPDATE announce SET online='no' WHERE url='$ann' AND torrent='$row[id]' ");
}
}
if ($seeders !== null)
{
echo "<br><b>Totals:</b><br>";
echo "Seeders: $seeders<br>";
echo"Leechers: $leechers<br>";
echo "Completed: $downloaded<br><br>";
mysql_query("UPDATE torrents SET leechers = '".$leechers."', seeders = '".$seeders."', times_completed = '".$downloaded."', last_action = '".get_date_time()."', visible = 'yes' WHERE id = '".$row['id']."'");
}
else
{
echo "<br><b><font color=red>All trackers are timed out.</font></b><br>";
mysql_query("UPDATE torrents SET last_action = '".get_date_time()."' WHERE id = '".$row['id']."'");
}
}
?>
<script language="JavaScript">
//configure refresh interval (in seconds)
<?php if ($count)
echo "var countDownInterval = 10;";
else
echo "var countDownInterval = 25;"; // No torrents to scrape, refresh in 15 minutes
?>
//configure width of displayed text, in px (applicable only in NS4)
var c_reloadwidth=200
</script>
<ilayer id="c_reload" width=&{c_reloadwidth}; ><layer id="c_reload2" width=&{c_reloadwidth}; left=0 top=0></layer></ilayer>
<script>
var countDownTime=countDownInterval+1;
function countDown(){
countDownTime--;
if (countDownTime <=0){
countDownTime=countDownInterval;
clearTimeout(counter)
window.location.reload()
return
}
if (document.all) //if IE 4+
document.all.countDownText.innerText = countDownTime+" ";
else if (document.getElementById) //else if NS6+
document.getElementById("countDownText").innerHTML=countDownTime+" "
else if (document.layers){ //CHANGE TEXT BELOW TO YOUR OWN
document.c_reload.document.c_reload2.document.write('Next <a href="java script:window.location.reload()">refresh</a> in <b id="countDownText">'+countDownTime+' </b> seconds')
document.c_reload.document.c_reload2.document.close()
}
counter=setTimeout("countDown()", 1000);
}
function startit(){
if (document.all||document.getElementById) //CHANGE TEXT BELOW TO YOUR OWN
document.write('Next <a href="javascript:window.location.reload()">refresh</a> in <b id="countDownText">'+countDownTime+' </b> seconds')
countDown()
}
if (document.all||document.getElementById)
startit()
else
window.onload=startit
</script>
<br><br>