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
[IMPORTANT] We need to rework UDP scrape
Controls ·  Search New posts · Mark unread

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

Unknown User
2019-07-28 10:18:45
[color=rgb(84, 172, 210)]--------------------------------------------------------------------------------------------------------------
READ THIS THREAD CAREFULLY, ONCE THIS IS FIXED, TORRENTTRADER WILL HAVE MOST ACCURATE AND THE FASTEST SCRAPER THERE IS.

ALSO YOU WILL BE ABLE TO INSTANTLY SCRAPE 100+ TORRENTS WITHOUT ANY TIMEOUT.

HELP IF YOU CAN.
--------------------------------------------------------------------------------------------------------------[/color]


Okay. Current udp scraper which we have here is [color=rgb(247, 218, 100)]not using the udptscraper.php to scrape hash[/color], it is using backend/parse.php which is very slow, bad and scrapes torrent file instead.

udptscraper.php is scraping info_hash and is instant, right now we scrape .torrent files which is slow and inaccurate.

[color=rgb(243, 121, 52)]Example:[/color]
Create new PHP file and add
<?php
include "backend/udptscraper.php";
try{
   $timeout = 2;

   $scraper = new udptscraper($timeout);
   $ret = $scraper->scrape('udp://tracker.leechers-paradise.org:6969',array('B3D90865B2C831802CEC740933043EF50A2B6313'));

   print_r($ret);
}catch(ScraperException $e){
   echo('Error: ' . $e->getMessage() . "<br />\n");
   echo('Connection error: ' . ($e->isConnectionError() ? 'yes' : 'no') . "<br />\n");
}


[color=rgb(243, 121, 52)]Result: (Less than 1 second scraping)[/color]
Array ( [B3D90865B2C831802CEC740933043EF50A2B6313] => Array ( [seeders] => 59 [completed] => 435 [leechers] => 3 [infohash] => B3D90865B2C831802CEC740933043EF50A2B6313 ) ) 


------------------
We do have this option in scrape code, but the script prioritize this wrong part
 $TorrentInfo = ParseTorrent("$site_config[torrent_dir]/$rowu[id].torrent");
               $ann         = $TorrentInfo[0];
               $annlist     = array();


[USER=20288]@m-jay[/USER] [USER=311]@MicroMonkey[/USER] [USER=3]@Munk[/USER] [USER=1398]@serph[/USER] [USER=1]@DarkMaster[/USER]
Unknown User
2019-07-28 10:39:50
This part is checking if stats are taken from backend/parese.php

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


It should be like this to take stats from backend/udptscraper.php
if (scrape['seeders'] != -1) {
$seeders += $scrape['seeders'];
$leechers += $scrape['leechers'];
$downloaded += $scrape['completed'];


1# Part which updates SQL with new stats is incorrect it takes data from backend/parese.php
[color=rgb(247, 218, 100)]SQL_Query_exec("UPDATE `announce` SET `online` = 'yes', `seeders` = '".$seeders."', `leechers` = '".$leechers."', `times_completed` = '".$downloaded."' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $rowu[id]");[/color]

2# Find
[color=rgb(250, 197, 28)]$resu = SQL_Query_exec("SELECT id, info_hash FROM torrents WHERE external = 'yes' AND id = $id");[/color]
2.2# Change it to:
[color=rgb(250, 197, 28)]$resu = SQL_Query_exec("SELECT id, info_hash, announce FROM torrents WHERE external = 'yes' AND id = $id");[/color]

1.1# Now it should look like this:
[color=rgb(247, 218, 100)]SQL_Query_exec("UPDATE `announce` SET `online` = 'yes', `seeders` = '".$seeders."', `leechers` = '".$leechers."', `times_completed` = '".$downloaded."' WHERE `url` = ".resu[announce]." AND `torrent` = $resu[id]");[/color]
Unknown User
2019-07-28 11:09:54
If we fix this starting part, we will have very advance scraping tool with speed of 2 seconds per scraping :D
 
$TorrentInfo = ParseTorrent("$site_config[torrent_dir]/$rowu[id].torrent"); // Takes results from /backend/parse.php - BAD
$ann         = $TorrentInfo[0]; // Takes announces from /backend/parse.php - BAD
$annlist     = array(); // Takes announce array from /backend/parse.php - BAD

if ($TorrentInfo[6]) { // Takes results from /backend/parse.php - BAD
foreach ($TorrentInfo[6] as $ann) {
$annlist[] = $ann[0]; // Takes announces from /backend/parse.php - BAD }
} 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;
Unknown User
2019-07-29 16:41:27
You should not be using backend/Parse.php that is only used to decode the .torrent file. To obtain the infohash of a torrent just use the database and if im honest with you the megascrape is pretty slow, you should convert it to a cli app that can make use of multithreading.
Unknown User
2019-07-30 07:54:59
"mostvotedplaya, post: 67024, member: 20335":

You should not be using backend/Parse.php that is only used to decode the .torrent file. To obtain the infohash of a torrent just use the database and if im honest with you the megascrape is pretty slow, you should convert it to a cli app that can make use of multithreading.

This should also do the job php -f /var/www/megascrape.php > /var/www/results.html
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: 9
  • Members: 0
  • Guests online: 9
  • Comments: 3
  • Messages: 1,728