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

You are in: Forum / Forum / v2.08 / v2.08 Mods Completed

2021-08-08 20:10:19
Hello!
i have updated some scrape.php for torrent id
create scrapefile.php


<?php
//
//  ExtremlymTorrents v3.4

require_once("backend/functions.php");
require_once("backend/BDecode.php");
require_once("backend/parse.php"); //replace with parse later
require_once("backend/udptscraper.php");
dbconn();

$torrent_dir = $site_config["torrent_dir"];


//************ DO SOME "GET" STUFF BEFORE PAGE LAYOUT ***************
$id = (int) $_GET["id"];
$scrape = (int) $_GET["scrape"];
if (!is_valid_id($id))
   show_error_msg("ERROR", T_("THATS_NOT_A_VALID_ID"), 1);

//GET ALL MYSQL VALUES FOR THIS TORRENT
$res = SQL_Query_exec("SELECT id , name, info_hash FROM torrents WHERE torrents.id = $id") or die(mysql_error());
while ($row = mysql_fetch_array($res))
{
$TorrentInfo = ParseTorrent("$site_config[torrent_dir]/$row[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;
//echo "<br><font color=blue><b>LIVE STATUS</b></font><br>";
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)
{
//echo "<br><b>$ann</b>: Scrape not supported.<br>";
continue;
}

// TPB's tracker is dead. Use openbittorrent instead
if ($openbittorrent_done)
continue;

if (preg_match("/thepiratebay.org/i", $tracker) || preg_match("/prq.to/", $tracker))
{
$tracker = "http://tracker.openbittorrent.com/scrape";
$openbittorrent_done = 1;
}

if(preg_match('%udp://([^:/]*)(?::([0-9]*))?(?:/)?%si', $tracker))
{
$udp=true;
try
{
$timeout = 5;
$udp= new udptscraper($timeout);
$stats=$udp->scrape($tracker,$row["info_hash"]);
foreach ($stats as $id=>$scrape)
{
$seeders += $scrape['seeders'];
$leechers += $scrape['leechers'];
$downloaded += $scrape['completed'];
}
}
catch(ScraperException $e)
{
// echo('<br>Error: ' . $e->getMessage() . "\n");
// echo('Connection error: ' . ($e->isConnectionError() ? 'yes' : 'no') . "\n");
}
}
else
{
$stats = torrent_scrape_url($tracker, $row["info_hash"]);
}

if ($stats['seeds'] != -1)
{
$seeders += $stats['seeds'];
$leechers += $stats['peers'];
$downloaded += $stats['downloaded'];
// echo "<br><b>$ann</b><br>";
echo "".($udp?$scrape['seeders']:$stats["seeds"])."<br>";
echo "".($udp?$scrape['leechers']:$stats["peers"])."<br>";
echo "".($udp?$scrape['completed']:$stats["downloaded"])."<br>";
SQL_Query_exec("UPDATE `announce` SET `online` = 'yes', `seeders` = $stats[seeds], `leechers` = $stats[peers], `times_completed` = $stats[downloaded] WHERE `url` = ".sqlesc($ann)." AND `torrent` = $row[id]");
}
else
{
// echo "<br><b>$ann</b>: <font color=red>Tracker timed out.</font><br>";
SQL_Query_exec("UPDATE `announce` SET `online` = 'no' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $row[id]");
}
}

if ($seeders !== null)
{
// echo "<br><b><font color=red>Totals:</font></b><br>";
// echo "<b>Seeders: $seeders</b><br>";
// echo"<b>Leechers: $leechers</b><br>";
// echo "<b>Completed: $downloaded</b><br><br>";
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
{
echo "<br><b><font color=red>All trackers are timed out.</font></b><br>";
SQL_Query_exec("UPDATE torrents SET last_action = '".get_date_time()."' WHERE id = '".$row['id']."'");
}
}

   ?>



Edit Torrents-details.php
Search for
//download box

add
echo "<iframe src='/scrapefile.php?id=$id' style='display: none;'></iframe>";


Any idea how to make it faster>?
Last edited by Extremlym66 on 2021-08-08 20:22:22
2021-08-18 21:43:37
manque ce fichier ...require_once("backend/udptscraper.php"); ????
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: 2
  • Members: 0
  • Guests online: 2
  • Comments: 3
  • Messages: 1,728