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

You are in: Forum / Forum / Torrent Trader / v3 Support

2022-01-10 00:24:35
until the end someone made the scrape working beacause what i found on site nothink works. Thanks in advance
2022-01-10 17:53:33
try this create page test.php and place scraper file in backend then visit yoursite/test.php what do you host on some php.ini settings might need looking at like sockets

change torrent id for a external one on your site - $tor = ParseTorrent("uploads/1.torrent");

<?php
// uncomment if error

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(0);

require_once("backend/functions.php");
require_once("backend/parse.php");
require_once("backend/Scraper.php");
dbconn();

      $tor = ParseTorrent("uploads/1.torrent");
      $infohash = $tor[1];
      $annlist = $tor[6];

      // uncomment to see torrent parse array
     //var_dump($tor);

      $scraper = new Scraper();
      $ret = $scraper->scrape($infohash, $annlist, 20, 4, true );
      var_dump($ret);


Scraper.zip
File missing
Last edited by M-jay warn on 2022-01-12 05:36:36
2022-01-10 20:43:14
i get this error:

Warning: Config is set to use PEAR Mail but it is not installed (or include_path is wrong). in /home/admin/domains/rotorrent.ro/public_html/backend/mail.php on line 46

Fatal error: Uncaught Error: Call to undefined function ParseTorrent() in /home/admin/domains/rotorrent.ro/public_html/test.php:9 Stack trace: #0 {main} thrown in /home/admin/domains/rotorrent.ro/public_html/test.php on line 9
2022-01-11 15:23:09
Updated code above
2022-01-11 19:31:46
Here use this one and call mscrape(torrent infohash, trackers in array) it will return peer info in array (code key value is 1 means successfully updated & 0 means failed, check the log for error)

another thing is you can encode output array to json and fetch using javascript and update it on page without refresh.

place it in functions.php

//scrape fxn
function mscrape($infohash , $tracker){
require_once (__DIR__ ."/class.scraper.php");
if(isset($infohash) && isset($tracker)){
    $scraper = new Scrapeer\Scraper();
    $rat = $scraper->scrape( $infohash, $tracker);
    if(isset($rat)){
              if(empty($rat[$infohash]["seeders"]) && empty($rat[$infohash]["leechers"])){
                  $seed  = "0";
                  $leech = "0";
              }
              elseif(empty($rat[$infohash]["leechers"]))
              {
                  $seed  = $rat[$infohash]["seeders"];
                  $leech = "0";
              }
              elseif(empty($rat[$infohash]["seeders"])){
                  $seed  = "0";
                  $leech = $ret[$infohash]["leechers"];
              }
              else {
              $seed  = $rat[$infohash]["seeders"];
              $leech = $rat[$infohash]["leechers"];
              }
     
    SQL_Query_exec("UPDATE `torrents`  SET `last_action` = '".get_date_time()."', `seeders` = '".$seed."', `leechers` = '".$leech."' WHERE `info_hash` = '".$infohash."'");
    $lmessage = "Updated Torrent: ".$infohash." with s: ".$seed." and l: ".$leech."";
      $rcode = 1;
    }else{
        if ($scraper->has_errors()){
          $lmessage = $scraper->get_errors()." _on ".$infohash;
        }
      $rcode = 0;
    }
write_log($lmessage);
}else{
$rcode = 0;
}

  if($rcode == 1){
  $ret[] = array('code' => utf8_encode($rcode),'sd' => utf8_encode($seed), 'lh' => utf8_encode($leech));
  }else{
   $ret[] = array('code' => utf8_encode($rcode));  
  }
  return $ret;
}      

follow the thread for updates
checkout my project: https://bvlist.com/showthread.php?t=12349
Last edited by JohnHasher on 2022-01-11 19:55:32
2022-01-11 21:22:51
M-Jay i get this error now
array(0) { }


@JohnHasher
ill try it thx
2022-01-11 21:26:38
That means it may be server side did you try remove surrounding /* & */

/*
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
*/
2022-01-11 21:52:17
ok ... where do i find this?
/*
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
*/

not in your code not in functions , ... i have to enter on my VPS on ini file?
2022-01-12 11:40:13
Edited my code above, working fine for me if someone else can test

if you get socket error find this line on php.ini and remove ; from front
;extension=sockets
Last edited by M-jay warn on 2022-01-12 13:12:20
2022-02-06 04:15:13
Still no fix for this?
Just surprised, its been a few years since looking at this - I dont need to as stats are updated live every 10sec. Someone give me a test file I dont need to piece together myself, and I'll see what the heck is going on. I have the holy grails sandbox for array/key testing - I've performed incredible mods due to this in very short time. I can fix this.

Let me know.

Edit: You dont need Sockets. You need your http GET response and the index keys within. Don't slow down the PHP interpreter unless you absolutely have to. Save your carbon footprint.
Last edited by STorrents2020 on 2022-02-06 04:19:05
2022-02-06 04:19:00
nope , i mean its working partialy when i upload torrent it shows 0 seeder 0 uploader but when i  push update stas it givres me one uploader, so ... something is working something not
2022-02-06 04:20:59
Don't trust zero-index. That sounds like a fallback to avoid an integer exception. Its too messy of a thread here to pinpoint what exactly is the cause of no correct keys returning back to the browser/database.
2022-02-06 04:26:55
right its just that the code partial is working , i mean only udp is not working properly so there is the bug , at least for me the http/https are working just UDP are somekind of bug .
If you manage to do it plls share it . Thx in advance
2022-02-06 05:16:31
go to yoursiteurl/check.php allow_url_fopen is turned on
check port 80 is allowed (udp port) - ask host

if its working on https it must be a server setting, my udp wont work on this site because host keeps switching settings of. If these two are on then it will be a server firewall, Botanicar had same issue but it is server side not code
2022-02-06 05:30:04
Maybe hosting is the issue. My dedicated 1U is in my closet on 2 sturdy Uhaul boxes lol
I have never had a limit in anything I ever wanted to do. I highly recommended just pulling $550US and grabbing a PowerEdge with low specs. Your now left with the commitment of your local LAN.

Hosting is restrictive due to the potential actions by the customer - they eliminate c99 shells, embedded PNGs with <? potential (I actually check images for these on my site, it was very hard to do and took 2 days for my code), root access elevations & buffer overflows - Which is why they disallow certain modules. It could kill their business and all those effected. Look at it as a good thing, however takes a little care to make your endeavors compatible.

Your using PHP, its easy trust me. Python would have you running circles lol
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: 3
  • Members: 0
  • Guests online: 3
  • Comments: 3
  • Messages: 1,728