until the end someone made the scrape working beacause what i found on site nothink works. Thanks in advance
<?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);
on 2022-01-12 05:36:36
//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;
}
No users online
Torrents
Members
Online