Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   Torrent Trader (http://www.bvlist.com/forumdisplay.php?f=29)
-   -   TT 2.7 DHT error (http://www.bvlist.com/showthread.php?t=10468)

Extremlym 2nd September 2015 18:05

TT 2.7 DHT error
 
TT 2.7 DHT error udp:// wont scrape ....
is any sollution?? i don't wont to change my source ... or upgrade to 2,8 because i have over 40,000 users . over 50.000 torrents and aloth of work on design etc... need an actual sollution
:wild::sos::sos::sos::sos::sos::sos:

DND 2nd September 2015 18:32

the scrape function is broken in TT.. TT doesn't support udp scrape, you need to install a small modification, but that modification won't always work
Abanddon external torrents. They aren't any good to anyone.
Pace tie!

RGSHARON 4th September 2015 22:53

udp scrape
 
you can scrape udp trackers on tt script u need udptscraper.php,tscraper.php&mega-scraper.php

You can find it here https://github.com/johannes85/PHP-Torrent-Scraper

Place the udptscraper in backend folder and place tscraper in your root directory

Code for Mega-scrape.php
PHP Code:

<?php
#============================#
#  TorrentTrader v2.08       #
#  http://torrenttrader.org  #
#----------------------------#
#  Modified by BigMax        #
#============================#

require_once("backend/functions.php");
require_once(
"backend/BDecode.php");
require_once(
"backend/parse.php");
require_once(
"backend/udptscraper.php");
dbconn(false);


    
set_time_limit(0);
    
$interval 60// Rescrape torrents every 2 days
    
$ts gmtime() - $interval;
    
$res mysql_query("SELECT id, name, info_hash FROM torrents WHERE external = 'yes' AND last_action <= FROM_UNIXTIME($ts) ORDER BY last_action DESC LIMIT 1");
    
$count get_row_count("torrents""WHERE external = 'yes' AND last_action <= FROM_UNIXTIME($ts)");

    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 
"<font color=blue><b>Torrent ID: $row[id]</b></font> - <b>$row[name]</b><font color=blue><b>Info Hash: $row[info_hash]</b></font>";
        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 
"<b>$ann</b>: Scrape not supported.";
                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 "udp://tracker.publicbt.com:80/scrape";
                
$openbittorrent_done 1;
            }

            if(
preg_match('%udp://([^:/]*)(?::([0-9]*))?(?:/)?%si'$tracker))
            {
                
$udp=true;
                try
                {
                    
$timeout 10;
                    
$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('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 
"<table class='table table-bordered'><thead><tr>
                
        <th>TRACKER NAME</th>
                
                <th>Seeders:</th> 
                <th>Leechers:</th> 
            <th>Downloaded:</th>
            
      </tr></thead><tbody><tr>
                <td><b>
$ann</b></td>
                <td>"
.($udp?$scrape['seeders']:$stats["seeds"])."</td><td>".($udp?$scrape['leechers']:$stats["peers"])."</td><td> ".($udp?$scrape['completed']:$stats["downloaded"])."</td></tr></tbody></table>";
                
                
                
mysql_query("UPDATE announce  SET  online='yes', 
seeders="
.($udp?$scrape['seeders']:$stats["seeds"]).",
 leechers="
.($udp?$scrape['leechers']:$stats["peers"]).", times_completed= ".($udp?$scrape['completed']:$stats["downloaded"]).
WHERE url='
$ann'  AND torrent='$row[id]' "); 
            }
            else
            {
                echo 
"<b>$ann</b>: <font color=red>Tracker timed out.</font>";
                
mysql_query("UPDATE announce  SET online='no'  WHERE url='$ann'  AND  torrent='$row[id]' ");
            }
        }

        if (
$seeders !== null)
        {
            echo 
"<b>Totals:</b>";
            echo 
"Seeders: $seeders";
            echo
"Leechers: $leechers";
            echo 
"Completed: $downloaded";
            
mysql_query("UPDATE torrents SET leechers = '".$leechers."', seeders = '".$seeders."', times_completed = '".$downloaded."', last_action = '".get_date_time()."', visible = 'yes' WHERE id = '".$row['id']."'");
        }
        else
        {
            echo 
"<b><font color=red>All trackers are timed out.</font></b>";
            
mysql_query("UPDATE torrents SET last_action = '".get_date_time()."' WHERE id = '".$row['id']."'");
        }
    }
    

?>

<script language="JavaScript">
    //configure refresh interval (in seconds)
    <?php if ($count)
    echo 
"var countDownInterval = 10;";
    else
    echo 
"var countDownInterval = 25;"// No torrents to scrape, refresh in 15 minutes
    
?>
    //configure width of displayed text, in px (applicable only in NS4)
    var c_reloadwidth=200
</script>

    <ilayer id="c_reload" width=&{c_reloadwidth}; ><layer id="c_reload2" width=&{c_reloadwidth}; left=0 top=0></layer></ilayer>

<script>
    var countDownTime=countDownInterval+1;
    function countDown(){
    countDownTime--;
    if (countDownTime <=0){
    countDownTime=countDownInterval;
    clearTimeout(counter)
    window.location.reload()
    return
    }
    if (document.all) //if IE 4+
    document.all.countDownText.innerText = countDownTime+" ";
    else if (document.getElementById) //else if NS6+
    document.getElementById("countDownText").innerHTML=countDownTime+" "
    else if (document.layers){ //CHANGE TEXT BELOW TO YOUR OWN
    document.c_reload.document.c_reload2.document.write('Next <a href="java script:window.location.reload()">refresh</a> in <b id="countDownText">'+countDownTime+' </b> seconds')
    document.c_reload.document.c_reload2.document.close()
    }
    counter=setTimeout("countDown()", 1000);
    }

    function startit(){
    if (document.all||document.getElementById) //CHANGE TEXT BELOW TO YOUR OWN
    document.write('Next <a href="javascript:window.location.reload()">refresh</a> in <b id="countDownText">'+countDownTime+' </b> seconds')
    countDown()
    }

    if (document.all||document.getElementById)
    startit()
    else
    window.onload=startit
</script>


DND 4th September 2015 22:59

5 years ago.. really ?:lol:

RGSHARON 4th September 2015 23:16

Quote:

Originally Posted by DND;4745his 2
5 years ago.. really ?:lol:

That php classes are 5 year old but its still working good u can test it

firefly007 5th September 2015 10:50

Quote:

Originally Posted by Extremlym (Post 47446)
TT 2.7 DHT error udp:// wont scrape ....
is any sollution?? i don't wont to change my source ... or upgrade to 2,8 because i have over 40,000 users . over 50.000 torrents and aloth of work on design etc... need an actual sollution
:wild::sos::sos::sos::sos::sos::sos:

Its possible if you are using a VPS or dedi to write a script that will scrape a few of the bigger site to get seeders leechers and peers using preg_match or even Simple Html Dom class and then use crontab to execute the script and update the torrent table in staggered intervals


All times are GMT +2. The time now is 09:40.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.