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
Scrape UDP trackers
Controls ·  Search New posts · Mark unread

You are in: Forum / Forum / Torrent Trader / v3 Mods in Progress

Unknown User
2019-08-08 09:50:42
"serph, post: 67060, member: 1398":

yes [USER=20311]@shadows[/USER] its updating from last tracker also if any trackers are down i dont think its setting them as offline either ?

1.  Add += on all 6 places  ($seeders+= $scrape[ 'seeders' ];)
2. Try changing if ($seeders != -1) to if ($seeders != null)
Unknown User
2019-08-08 12:01:21
tried the edits and still no joy ? theres going to be a simple soulotion but atm its avaiding me :unsure:
[USER=20311]@shadows[/USER] if you have it working as should post up you're code
Unknown User
2019-08-09 13:53:29
I just changed the function to scrape only 1 tracker and the first one. It's pointless and very slow when scraping all of the backup trackers.

Now we need to change torrents-upload.php to scrape a torrent WITHOUT backend/parse.php because it is so slow.

Here's how to add announces into the backup tracker

Find [ICODE]if (strtolower(substr($val, 0, 4)) != "udp:") { [/ICODE] and replace with if (strtolower(substr($val, 0, 4)) != "https:") {

It will not include HTTP and UDP trackers.

Now the problem:

I fixed external scraping like this BUT it's scraping torrent via this [ICODE]$TorrentInfo = ParseTorrent("$site_config[torrent_dir]/$rowu[id].torrent");[/ICODE] which is very slow and can take over 40 seconds when uploading.

    //EXTERNAL SCRAPE
   if ($external=='yes' && $site_config['UPLOADSCRAPE']){
          $resu = SQL_Query_exec("SELECT id, info_hash FROM torrents WHERE external = 'yes' AND id = $id");
           while ($rowu = mysqli_fetch_array($resu))
           {
               $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 = str_replace("announce", "scrape", $path);
                   $tracker = implode("/", $tracker)."/".$path;

                   if ($oldpath == $path)
                   {
                       continue;
                   }
               
                   if(preg_match('/udp:\/\//', $tracker))
                   {
                       $udp=true;
                       try
                       {
                           $timeout = 5;
                           $udp= new udptscraper($timeout);
                           $stats=$udp->scrape($tracker,$rowu["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, $rowu["info_hash"]);
                   }

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

                       SQL_Query_exec("UPDATE `announce` SET `online` = 'yes', `seeders` = '".$seeders."', `leechers` = '".$leechers."', `times_completed` = '".$downloaded."' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $rowu[id]");
                   } else {
                       SQL_Query_exec("UPDATE `announce` SET `online` = 'no' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $rowu[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 = '".$rowu['id']."'");
               }
               else
               {
                   SQL_Query_exec("UPDATE torrents SET last_action = '".get_date_time()."' WHERE id='".$rowu['id']."'");
               }
           }
   }
         
   //END SCRAPE
2019-09-05 15:32:46
Someone have "fixed package" of scrapers and torrents-details.php in zip file to test it?
It's little confused with all "fixes" here :)


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
Unknown User
2019-09-05 23:19:49
Still trying to get http scrape integrated into udp to be honest totally forgot about this got side tracked ill take another look this weekend
2019-09-06 07:35:40
I've had a working tracker on the old server, but now that I move it, nothing works and I'm so disappointed and angry with myself ....:poop:


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
Unknown User
2019-09-07 00:46:27
try this should do both
add both files to backend

add at top of torrents-details.php


require_once("backend/scraper.php");
require_once("backend/udpscraper.php");


replace scrape code in torrents-details with


//===| 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, announce FROM torrents WHERE external = 'yes' AND id = $id");
}
while ($rowu = mysqli_fetch_array($resu)){
if (mysqli_num_rows($tress) > 1){
$ann = $rowu["url"];
}else{
$ann = $rowu["announce"];  
}
$annlist = array($ann);
$seeders = $leechers = $downloaded = NULL;
foreach ($annlist as $ann)                  
{
$tracker = explode("/", $ann);
$path = array_pop($tracker);
$oldpath = $path;
$tracker = implode("/", $tracker)."/".$path;
if ($oldpath == $path){
continue;
}
}

if ( substr( $tracker, 0, 3 ) == 'udp' ){
   $udp=true;
   try
{
$info = $row['info_hash'];  
$udp = new udptscraper( 5 );
$stats = $udp->scrape($tracker,$info);
foreach ($stats as $idu=>$scrape)
{
$seeders1 += $scrape['seeders'];
$leechers1 += $scrape['leechers'];
$downloaded1 += $scrape['completed'];
}
}
catch(ScraperException $e)
{
$e->isConnectionError();
}
}
elseif ( substr( $tracker, 0, 4 ) == 'http' ){  
try
{

$info = $row['info_hash'];  
$http = new scrapeer\scraper( 5);
$stats = $http->scrape($info,$tracker);

foreach ($stats as $idu=>$scrape)
{
$seeders2 += $scrape['seeders'];
$leechers2 += $scrape['leechers'];
$downloaded2 += $scrape['completed'];
echo'<pre>';
print_r($scrapeA['seeders']);
echo '</pre>';
}
}
catch(ScraperException $e)
{
$e->isConnectionError();
}
}
elseif ( substr( $tracker, 7, 4 ) == 'ipv6' ){

   echo ( 'ipv6 not supported...' );

}
 $seeders = $seeders1 += $seeders2;
 $leechers = $leechers1 += $leechers2;
 $downloaded = $downloaded1 += $downloaded2;
if ($scrape['seeders'] != -1)
{
             
 SQL_Query_exec("UPDATE `announce` SET `online` = 'yes', `seeders` = '" .max(0, $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 != -1)
{
SQL_Query_exec("UPDATE torrents SET leechers = '". max(0, $leechers) ."', seeders = '". max( 0, $seeders ) ."', times_completed = '". max(0, $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 !=-1)
           {
               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'>". max( 0, number_format($seeders )) ."</font></div>");
               print ("<div style='margin-left:20px'>".T_("LEECHERS").": <font color='#FF2000'>". max( 0, number_format($leechers )) ."</font></div>");
               print ("<div style='margin-left:20px'>".T_("COMPLETED").": <font color='#0080FF'>". max( 0, number_format($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
scraper.zip
Download
2019-09-07 12:31:43
Sorry @[USER=1398]serph[/USER] but not work for me ....
If you can share your working torrent-details.php with us ....

Regards


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
Unknown User
2019-09-07 12:39:34
defualt v3 torrent-details
torrents-details.zip
Download
2019-09-07 14:32:09
I did a quick test and it seems to work fine for me. I am limited in my ability to really test it, so I used an old game of thrones udp torrent and a ubuntu torrent.
TTv3 Micro Edition
Ubuntu 20.04.6 LTS Server
Mysql Version: 10.3.39-MariaDB-0ubuntu0.20.04.2
PHP Version: 7.4.3-4ubuntu2.20
Apache Version: Apache/2.4.59 (Ubuntu)
Unknown User
2019-09-07 14:51:03
its not perfect by any means is why its still in here hoping a couple more people can put some input in to get it fully completed
2019-09-07 15:23:53
it seems that my server is very limited, neither the old as the new TT works, it makes me crazy now


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
2019-09-07 15:25:13
that's true [USER=1398]serph[/USER] , not many people are involved in this project, unfortunately


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
Unknown User
2019-09-07 15:34:43
if you need any help [USER=19833]@Botanicar[/USER] send me a pm ive upgraded my old v2.08 to php7.2 and mysqli
2019-09-07 15:59:34
Thanks[USER=1398] [/USER][USER=1398]serph,[/USER] I have one worked script, but that worked on my old server ....  now on this "new" server, seems not working at all ...
I'm AFK, it's my punishment next 4 months


www.exyusubs.com
TorrentTrader V3.8.3 (SE)
OS: AlmaLinux 9.9 (BC)
Apache version: 2.4.71
PHP version: 8.5.13 (PHP-FPM)
MySQL version: 10.11.18-MariaDB
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