Login
Username: Password:
Remember me

[Sign Up] / [Recover Password]

Theme / Language

Popular
New Torrents
new name
Size: 18.40 MB
Most active
new name
S: 74 L: 3
New Posters
User Posts

Go to Profile

In fact I've just checked my site it's working as should stupid question but did you hit submit after the scrape?
"blackpearl, post: 66986, member: 20291":

[ATTACH type="full" alt="5118"]5118[/ATTACH][ATTACH type="full" alt="5119"]5119[/ATTACH] Scraping Done but not showing on hompage/index/table

I'll take a look when I get in I'm currently at work but they should show up are you getting any sql errors?
ok think this is the one will update single announce and all backup trackers  please post all findings and again
DO NOT ADD MODS IN PROGRESS TO LIVE SITES


         //===| UDP Scraper

$tress = SQL_Query_exec("SELECT * FROM `announce` WHERE `torrent` = $id");
if (mysqli_num_rows($tress) > 1){
$resu = SQL_Query_exec("SELECT url FROM announce WHERE torrent=$id");
}
else
{
$resu = SQL_Query_exec("SELECT id, info_hash FROM torrents WHERE external = 'yes' AND id = $id");
}
while ($rowu = mysqli_fetch_array($resu)){
if (mysqli_num_rows($tress) > 1){
$ann = $rowu["url"];
}else{
$TorrentInfo = ParseTorrent("$site_config[torrent_dir]/$rowu[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;
foreach ($annlist as $ann)                
{
$tracker = explode("/", $ann);
$path = array_pop($tracker);
$oldpath = $path;
$path = preg_replace("/^announce/", "scrape", $path);
$tracker = implode("/", $tracker)."/".$path;
if ($oldpath == $path){
continue;
}
}
if ($openbittorrent_done){
continue;
}
if (preg_match("/thepiratebay.org/i", $tracker) || preg_match("/tracker.tfile/", $tracker)){
$tracker = "udp://tracker.openbittorrent.com:80/scrape";
$openbittorrent_done = 1;
}
if(preg_match('/udp:\/\//', $tracker)){
$udp=true;
try
{
$timeout = 5;
$udp= new udptscraper($timeout);
$stats=$udp->scrape($tracker,$row["info_hash"]);
//print_r($stats); exit();
foreach ($stats as $idu=>$scrape)
{
$seeders1 += $scrape['seeders'];
$leechers1 += $scrape['leechers'];
$downloaded1 += $scrape['completed'];
}
}
catch(ScraperException $e)
{
$e->isConnectionError();
}
}
else
{
$stats = torrent_scrape_url($tracker, $row["info_hash"]);
}

if ($stats['seeds'] != -1)
{
$seeders += $stats['seeds'];
$leechers += $stats['peers'];
$downloaded += $stats['downloaded'];
SQL_Query_exec("UPDATE `announce` SET `online` = 'yes', `seeders` = '" .$scrape[seeders]."', `leechers` = '" .$scrape[leechers]."', `times_completed` = '".$scrape[completed]."' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");
} else {
SQL_Query_exec("UPDATE `announce` SET `online` = 'no' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");
}
}
if ($seeders !== NULL)
{
SQL_Query_exec("UPDATE torrents SET leechers = '".$leechers1."', seeders = '".$seeders1."', times_completed = '".$downloaded1."', last_action = '".get_date_time()."', visible = 'yes' WHERE id = '".$row['id']."'");
}
else
{
SQL_Query_exec("UPDATE torrents SET last_action = '".get_date_time()."' WHERE id ='".$row['id']."'");
}
//===| End UDP Scraper
if ($seeders !== NULL)
{
print ("<div style='margin-bottom:5px; margin-left:20px'><b>".T_("LIVE_STATS")."</b>: </div>");
print ("<div style='margin-left:20px'>".T_("SEEDERS").": <font color='limegreen'>".$seeders1."</font></div>");
print ("<div style='margin-left:20px'>".T_("LEECHERS").": <font color='#FF2000'>".$leechers1."</font></div>");
print ("<div style='margin-left:20px'>".T_("COMPLETED").": <font color='#0080FF'>".$downloaded1."</font></div>");
[USER=20311]@shadows[/USER]  ok i tinkered some more it was bugging me try this one

         //===| UDP Scraper

$resu = SQL_Query_exec("SELECT url FROM announce WHERE torrent=$id");
while ($rowu = mysqli_fetch_array($resu)){
$ann = $rowu["url"];
$tracker = explode("/", $ann);
$path = array_pop($tracker);
$oldpath = $path;
$path = preg_replace("/^announce/", "scrape", $path);
$tracker = implode("/", $tracker)."/".$path;
if ($oldpath == $path){
continue;
}
if ($openbittorrent_done){
continue;
}
if (preg_match("/thepiratebay.org/i", $tracker) || preg_match("/tracker.tfile/", $tracker)){
$tracker = "udp://tracker.openbittorrent.com:80/scrape";
$openbittorrent_done = 1;
}
if(preg_match('/udp:\/\//', $tracker)){
$udp=true;
try
{
$timeout = 5;
$udp= new udptscraper($timeout);
$stats=$udp->scrape($tracker,$row["info_hash"]);
//print_r($stats); exit();
foreach ($stats as $idu=>$scrape)
{
$seeders += $scrape['seeders'];
$leechers += $scrape['leechers'];
$downloaded += $scrape['completed'];
}
}
catch(ScraperException $e)
{
$e->isConnectionError();
}
}
else
{
$stats = torrent_scrape_url($tracker, $row["info_hash"]);
}

if ($stats['seeds'] != -1)
{
$seeders += $stats['seeds'];
$leechers += $stats['peers'];
$downloaded += $stats['downloaded'];

 SQL_Query_exec("UPDATE `announce` SET `online` = 'yes', `seeders` = '" .$scrape[seeders]."', `leechers` = '" .$scrape[leechers]."', `times_completed` = '".$scrape[completed]."' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");
       } else {
         SQL_Query_exec("UPDATE `announce` SET `online` = 'no' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");

       }
     }

if ($seeders !== null)
{
SQL_Query_exec("UPDATE torrents SET leechers = '".$leechers."', seeders = '".$seeders."', times_completed = '".$downloaded."', last_action = '".get_date_time()."', visible = 'yes' WHERE id = '".$row['id']."'");
}
else
{
SQL_Query_exec("UPDATE torrents SET last_action = '".get_date_time()."' WHERE id ='".$row['id']."'");
}

//===| End UDP Scraper

           
           if ($seeders !== null)
           {
               print ("<div style='margin-bottom:5px; margin-left:20px'><b>".T_("LIVE_STATS")."</b>: </div>");
               print ("<div style='margin-left:20px'>".T_("SEEDERS").": <font color='limegreen'>".$seeders."</font></div>");
               print ("<div style='margin-left:20px'>".T_("LEECHERS").": <font color='#FF2000'>".$leechers."</font></div>");
               print ("<div style='margin-left:20px'>".T_("COMPLETED").": <font color='#0080FF'>".$downloaded."</font></div>");
           }
           else
           {
               print ("<div style='margin-top:10px; margin-bottom:5px' align='center'><b>".T_("LIVE_STATS")."</b>: </div>");
               print ("<div style='font:italic 14px Times' align='center'><font color='#FF2000'>".T_("TRACKERS_OFFLINE")."!</font></div>");
           }
           print ("<div style='margin-top:10px; margin-bottom:10px' align='center'>
               <a href='torrents-details.php?id=".$id."'><input type='submit' name='submit' value=".T_("SUBMIT")."></a>
           </div>");
           print ("</td>");
       }
       else
       {
           print ("<td class='table_col1' width='150' border='0' valign='middle' align='center'>
               <div style='margin-top:5px; margin-bottom:10px; font:bold 16px Times' align='center'><font color='#FF2000'>".T_("EXTERNAL_TORRENT")."</font></div>
               <div style='font:normal 12px Times' align='center'>".T_("UPDATE_STATS")."</div></div>
                   <form action='torrents-details.php?id=$id&amp;scrape=1' method='post'>
                       <div style='margin-top:5px; margin-bottom:10px' align='center'><input type='submit' name='submit' value=".T_("UPDATE")." /></div>
                   </form>
               </td>");
       }
       print ("</tr></table></td>");
   }
   //===| End Scrape External Torrents


its updating all my backup trackers only thing is if there are no backup trackers and only the one annonce in torrents  it wont scrape need to add an if else then query the torrent announce not the announce url or somthing

[ATTACH]5114[/ATTACH]
ok ive been tinkering changed the sql query to anounnce url but im still not getting the backup trackers to update :/ not sure the announce urls are getting updated im getting numbers back but there not going into the DB


 if ($scrape =='1')
       {
           $seeders = $leechers = $downloaded = null;
           print("<td class='table_col1' border'0' width='150' valign='middle'>
           <div style='margin-top:5px; border='0' margin-bottom:10px; font:bold 16px Times' align='center'><font color='#FF2000'>".T_("EXTERNAL_TORRENT")."</font></div>");

           //===| UDP Scraper

$resu = SQL_Query_exec("SELECT url FROM announce WHERE torrent = $id");
while ($rowu = mysqli_fetch_array($resu)){
$ann = $rowu["url"];
$tracker = explode("/", $ann);
$path = array_pop($tracker);
$oldpath = $path;
$path = str_replace("announce", "scrape", $path);
$tracker = implode("/", $tracker)."/".$path;
if ($oldpath == $path){
continue;
}
if ($openbittorrent_done){
continue;
}
if (preg_match("/thepiratebay.org/i", $tracker) || preg_match("/tracker.tfile/", $tracker)){
$tracker = "udp://tracker.openbittorrent.com:80/scrape";
$openbittorrent_done = 1;
}
if(preg_match('/udp:\/\//', $tracker)){
$udp=true;
try
{
$timeout = 5;
$udp= new udptscraper($timeout);
$stats=$udp->scrape($tracker,$row["info_hash"]);
//print_r($stats); exit();
foreach ($stats as $idu=>$scrape)
{
$seeders += $scrape['seeders'];
$leechers += $scrape['leechers'];
$downloaded += $scrape['completed'];
}
}
catch(ScraperException $e)
{
$e->isConnectionError();
}
}
else
{
$stats = torrent_scrape_url($tracker, $row["info_hash"]);
}

if ($stats['seeds'] != -1)
{
$seeders += $stats['seeds'];
$leechers += $stats['peers'];
$downloaded += $stats['downloaded'];
$seeders1 = $stats['seeds'];
$leechers1 = $stats['peers'];
$downloaded1 = $stats['downloaded'];
/*echo '<pre>';
echo print_r($seeders1);
echo'</pre>';*/
 SQL_Query_exec("UPDATE `announce` SET `online` = 'yes', `seeders` = '" .$seeders1."', `leechers` = '" .$leechers1."', `times_completed` = '".$downloaded1."' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");
       } else {
         SQL_Query_exec("UPDATE `announce` SET `online` = 'no' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");

       }
     }

if ($seeders !== null)
{
SQL_Query_exec("UPDATE torrents SET leechers = '".$leechers."', seeders = '".$seeders."', times_completed = '".$downloaded."', last_action = '".get_date_time()."', visible = 'yes' WHERE id = '".$row['id']."'");
}
else
{
SQL_Query_exec("UPDATE torrents SET last_action = '".get_date_time()."' WHERE id ='".$row['id']."'");
}

//===| End UDP Scraper


maybe im missing somthing ive just finished work so could be tired brain and eyes I'll tinker more later
Yeah it's the old http scraper not UDP this one added all the backup tracker stats to the announce dB I'm sure it did I'm looking through old codes to see if I've missed something
the old scraper looked like this in torrent-details.php


   if ($row["external"]=='yes'){

       if ($scrape =='1'){
           print("<td valign='top' align='right'><b>Tracked: </b>EXTERNAL<br /><br />");
           $seeders1 = $leechers1 = $downloaded1 = null;

           $tres = SQL_Query_exec("SELECT url FROM announce WHERE torrent=$id");
           while ($trow = mysql_fetch_array($tres)) {
               $ann = $trow["url"];
               $tracker = explode("/", $ann);
               $path = array_pop($tracker);
               $oldpath = $path;
               $path = preg_replace("/^announce/", "scrape", $path);
               $tracker = implode("/", $tracker)."/".$path;

               if ($oldpath == $path) {
                   continue; // Scrape not supported, ignored
               }

               // TPB's tracker is dead. Use openbittorrent instead
               if (preg_match("/thepiratebay.org/i", $tracker) || preg_match("/prq.to/", $tracker)) {
                   $tracker = "http://tracker.openbittorrent.com/scrape";
               }

               $stats = torrent_scrape_url($tracker, $row["info_hash"]);
               if ($stats['seeds'] != -1) {
                   $seeders1 += $stats['seeds'];
                   $leechers1 += $stats['peers'];
                   $downloaded1 += $stats['downloaded'];
                   SQL_Query_exec("UPDATE `announce` SET `online` = 'yes', `seeders` = $stats[seeds], `leechers` = $stats[peers], `times_completed` = $stats[downloaded] WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");
               } else {
                   SQL_Query_exec("UPDATE `announce` SET `online` = 'no' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $id");

               }
           }
                                           
           if ($seeders1 !== null){ //only update stats if data is received
               print ("<b>".T_("LIVE_STATS").": </b><br />");
               print ("Seeders: ".number_format($seeders1)."<br />");
               print ("Leechers: ".number_format($leechers1)."<br />");
               print (T_("COMPLETED").": ".number_format($downloaded1)."<br />");

               SQL_Query_exec("UPDATE torrents SET leechers='".$leechers1."', seeders='".$seeders1."', times_completed='".$downloaded1."',last_action= '".get_date_time()."',visible='yes' WHERE id='".$row['id']."'");
           }else{
               print ("<b>".T_("LIVE_STATS").": </b><br />");
               print ("<font color='#ff0000'>Tracker Timeout<br />Please retry later</font><br />");
           }

           print ("<form action='torrents-details.php?id=$id&amp;scrape=1' method='post'><input type=\"submit\" name=\"submit\" value=\"Update Stats\" /></form></td>");
       }else{
           print ("<td valign='top' align='right'><b>Tracked:</b> EXTERNAL<br /><br /><form action='torrents-details.php?id=$id&amp;scrape=1' method='post'><input type=\"submit\" name=\"submit\" value=\"Update Stats\" /></form></td>");
       }
   }

   echo "</tr></table>";
}
echo "</div></td></tr></table></center><br /><br />";  
I'll take a look at the old way it was done I'm sure the stats we're split as the backup announce trackers got $stats[seeds] and the torrent was updated with $seeders1 or something
Yeah before I added this mod it did exactly that
You care to post you're findings incase it helps other people out ?
[USER=20311]@shadows[/USER] i put that in the description and i get this (btw i like the pun lol )

[ATTACH]5111[/ATTACH]

still no error just posts it
I've just installed a fresh tt v3.0 and cannot seem to replacate your issue  I left an unclosed bold tag in torrent description and it's telling me I did not enter anything not turning anything invisible
if you have
$dispname = "<b>".$smallname."</b>";


remove it sorry my functions is heavy modded (First post updated)


whole code should look like

case 'name':
               $char1 = 32; //cut name length
               $smallname = htmlspecialchars(CutName($row["name"], $char1));
               if ($CURUSER['edit_torrents'] == 'yes' || $row['owner'] == $CURUSER['id']) {
               $edit = '<a href="torrents-edit.php?id=' . $row['id'] . '"><img src="images/edit.png" hieght ="15" width ="15" border="0" alt="edit torrent" /></a>';          
               $del = '<a href="torrents-edit.php?action=deleteit&id=' . $row['id'] . '"></a>';
               } else {          
                  $edit = '';        
               }        
                       
                $dispname = "<b>".$smallname."</b> $edit";
                $dispname .= ($CURUSER['control_panel'] == 'yes') ? '<a href="' . $_SERVER['REQUEST_URI']  . '?delete=' . $row['id'] . '"><img src="images/delete.png" border="0" alt="delete torrent" /></a>' : '';
               $last_access = $CURUSER["last_browse"];
               $time_now = gmtime();
               if ($last_access > $time_now || !is_numeric($last_access))
                   $last_access = $time_now;
               if (sql_timestamp_to_unix_timestamp($row["added"]) >= $last_access)
                   $dispname .= "<img src='images/new.gif' border='0' alt='new torrent' />";          
               if (!empty($_GET['delete']) && is_valid_id($_GET['delete']) && $CURUSER['control_panel'] == 'yes') {
                    deletetorrent($_GET['delete']);
               }
             
Main torrent table next to the name
ok this little hack will let you edit and delete torrents on the fly without having to go to torrents-details and clicking edit torrent (credits to MVP)
open backend functions.php find


$dispname = "<b>".$smallname."</b>";


Replace with  



if ($CURUSER['edit_torrents'] == 'yes' || $row['owner'] == $CURUSER['id']) {
$edit = '<a href="torrents-edit.php?id=' . $row['id'] . '"><img src="images/edit.png" hieght ="15" width ="15" border="0" alt="edit torrent" /></a>';
$del = '<a href="torrents-edit.php?action=deleteit&id=' . $row['id'] . '"></a>';
} else {
$edit = '';
}
$dispname = "<b>".$smallname."</b> $edit";
$dispname .= ($CURUSER['control_panel'] == 'yes') ? '<a href="' . $_SERVER['REQUEST_URI']  . '?delete=' . $row['id'] . '"><img src="images/delete.png" border="0" alt="delete torrent" /></a>' : '';


now find


if (sql_timestamp_to_unix_timestamp($row["added"]) >= $last_access)
$dispname .= "<img src='images/new.gif' border='0' alt='new torrent' />";


under add


  if (!empty($_GET['delete']) && is_valid_id($_GET['delete']) && $CURUSER['control_panel'] == 'yes') {
  deletetorrent($_GET['delete']);
  if ($_SERVER['HTTP_REFERER'] != $_SERVER['PHP_SELF'])
                {
                echo "<meta http-equiv='refresh' content='0;URL=". $_SERVER['PHP_SELF']."'>";
                }
               }


you probably already have the images but if not pop them into your images folder
awsome well done [USER=20311]@shadows[/USER] (y)
this will automate all your cronjobs without having to login to terminal or your cpanel plesk etc every time you want to add remove a cronjob
it is very simple to use and all you have to do is set one cronjob to manage thousands either from you're cpanel or terminal
ok lets get started

open up admincp.php and add a link
 <td align="center"><a href="admincp?action=cron&do=run"><img src="images/admin/autocron.png" border="0" width="32" height="32" alt="" /><br /><?php echo T_("AUTO_CRON"); ?></a><br /></td>


still in admincp.php before the last ?> add

////RUN CRON FROM ADMINCP////
 if ($action=="cron" && $do=="run") {
 stdhead("Auto Cron");
 navmenu();
 echo '<div style="height:800px;overflow:hidden;">';
 echo '<iframe src="/cron" width="100%" height="100%" scrolling="no" style="overflow:hidden; margin-top:-4px; margin-left:-4px; border:none;"></iframe>';
 echo '</div>';
 }
//////END/////////////////////////



pop image in to images/admin
upload cron folder into main web folder (the whole folder)

Change the rights to cronjobs.dat.php and cronjobs.log chmod to 766
Give the directory logs read and write access = chmod 777

first off navigate to you're admincp click on autocron and go to settings fill out required fileds
then go to your terminal via ssh as root or sudoer type crontab -e and add this line to it

*/1 * * * *  /usr/bin/php -q -f "path to main website dir  ie" /var/www/public_html/cron/cronjob.php password="the password you set in the Autocron settings"
Can anyone confirm this is working as should ? If it is I'll clean up and post in mods complete
im working on trying to intergrate an easycrontab in to the admin panel but its coded in smarty and its being a pain in the butt asking for missing tpls gahhh and i dont want to rip the whole code into admincp its over 4000 lines as it is  ill have to do a dirty iframe hack lol ill post it up later
i was thinking of just adding it to a cron and giving users invites depending on last_accsess i havent worked with cleanup before i thourght it was similair to cron which in a way it is as it executes code on a timed basis but this code adds invites every x seconds my cleanup interval is set to 3600 so im not sure whats going on here ? been a few years since i played with TT
Users online

No users online

Search



Statistics

    Torrents

  • Tracking: 3
  • Todays torrents: 0
  • Seeders: 0
  • Leechers: 0
  • Peers: 0
  • Downloaded: 89.96 GB
  • Uploaded: 9.86 GB

  • Members

  • We have: 838
  • New today: 0
  • Guest today: 9

  • Online

  • Total online: 1
  • Members: 0
  • Guests online: 1
  • Comments: 3
  • Messages: 1,728