Bravo List
Register
Go Back   > Bravo List > Source Code > Active Trackers > Torrent Trader > Mods & Themes
Reply
  #1  
Old 24th February 2012, 22:31
katz1980 katz1980 is offline
Member
 
Join Date: Feb 2012
P2P
Posts: 1
Smile Mega Scrape
Hello all...

PHP Code:
<?php

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

set_time_limit(0);

$interval 800// Rescrape torrents every x seconds. (Default: 2 days)

$ts gmtime() - $interval;
$res mysql_query("SELECT id, info_hash FROM torrents WHERE external = 'yes' AND last_action <= FROM_UNIXTIME($ts) ORDER BY last_action DESC LIMIT 1");
echo 
"SELECT id, 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)) {
        
$tres mysql_query("SELECT `url` FROM `announce` WHERE `torrent` = $row[id]");
        
$annlist = array();
        while (
$trow mysql_fetch_array($tres)) {
                
$annlist[] = $trow["url"];
        }
        
$seeders $leechers $downloaded null;
        echo 
"Info_Hash: $row[info_hash]<BR>";
        foreach (
$annlist as $ann) {
                
$tracker explode("/"$ann);
                
$path array_pop($tracker);
                
$oldpath $path;
                
$path preg_replace("/^announce/""scrape"$path);
                
$tracker implode("/"$tracker)."/".$path;
                if (
$oldpath == $path) {
                        echo 
"<BR><B>$ann</B>: Scrape not supported.<BR>";
                        continue;
                }

                
$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 
"Seeders: $stats[seeds]<BR>";
                        echo 
"Leechers: $stats[peers]<BR>";
                        echo 
"Downloaded: $stats[downloaded]<BR>";
                        
mysql_query("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>: Tracker timeout.<BR>";
                        
mysql_query("UPDATE `announce` SET `online` = 'no' WHERE `url` = ".sqlesc($ann)." AND `torrent` = $row[id]");
                }
        }

        if (
$seeders !== null){
                echo 
"<BR><B>Totals:</B><BR>";
                echo 
"Seeders: $seeders<BR>";
                echo
"Leechers: $leechers<BR>";
                echo 
"Completed: $downloaded<BR><BR>";

                
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 
"All trackers timed out.<BR>";
                
mysql_query("UPDATE torrents SET last_action= '".get_date_time()."' WHERE id='".$row['id']."'");
        }
}
?>





<script language="JavaScript">

//Refresh page script- By Brett Taylor (glutnix@yahoo.com.au)
//Modified by Dynamic Drive for NS4, NS6+
//Visit http://www.dynamicdrive.com for this script

//configure refresh interval (in seconds)
<? if ($count)
echo 
"var countDownInterval=6;";
else
echo 
"var countDownInterval=900;"// No torrents to scrape, refresh in 15mins
?>
//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="java script:window.location.reload()">refresh</a> in <b id="countDownText">'+countDownTime+' </b> seconds')
countDown()
}

if (document.all||document.getElementById)
startit()
else
window.onload=startit

</script>
Reply With Quote
The Following User Says Thank You to katz1980 For This Useful Post:
Legend2000 (20th May 2012)
  #2  
Old 24th February 2012, 22:46
LeeHowarth LeeHowarth is offline
TT
 
Join Date: Nov 2008
Posts: 100
Default
And your credits to Torrentialstorm are where?
Reply With Quote
  #3  
Old 10th March 2013, 22:43
Extremlym's Avatar
Extremlym Extremlym is offline
Senior Member
 
Join Date: Oct 2012
P2P
Posts: 102
Default
how can i install it ?>>>>>>>>
Reply With Quote
  #4  
Old 10th March 2013, 23:34
daffy's Avatar
daffy daffy is offline
Senior Member
 
Join Date: Mar 2009
United Kingdom
Posts: 550
Default
Quote:
Originally Posted by Extremlym View Post
how can i install it ?>>>>>>>>
Add both files to root. point site or make link for admin view only

to mega-start.php this will start mega_scrape.php

p.s coming from my modded site of V2.03/2.04 from 2009
Attached Files
File Type: php mega_scrape.php (3.6 KB, 184 views)
File Type: php mega-start.php (574 Bytes, 145 views)
__________________
"FFS PPL READ GOD DAMMIT, WHAT AM I GOOGLE?"
"I Kill You!" simples


http://i.imgur.com/DtcRfH5.gif

I also Setup And Modify Trackers PM For Details
Reply With Quote
  #5  
Old 11th March 2013, 00:12
Extremlym's Avatar
Extremlym Extremlym is offline
Senior Member
 
Join Date: Oct 2012
P2P
Posts: 102
Default
Quote:
Originally Posted by daffy View Post
Add both files to root. point site or make link for admin view only

to mega-start.php this will start mega_scrape.php

p.s coming from my modded site of V2.03/2.04 from 2009
V2.7

Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in public_html/mega_scrape.php on line 28
Next refresh in 3 seconds

ON LINE28:

PHP Code:
while ($row=mysql_fetch_assoc($res)) {//do the scrape

            
$tracker=str_replace("/announce","/scrape",$row['announce']);    

            
$stats             torrent_scrape_url($tracker$row["info_hash"]);

            
$seeders1         strip_tags($stats['seeds']);

            
$leechers1         strip_tags($stats['peers']);

            
$downloaded1    strip_tags($stats['downloaded']);

                        
$name1    = ($row["name"]); 
Reply With Quote
  #6  
Old 11th March 2013, 00:40
daffy's Avatar
daffy daffy is offline
Senior Member
 
Join Date: Mar 2009
United Kingdom
Posts: 550
Default
try this

change

PHP Code:
$res=mysql_query("SELECT id, name, info_hash,announce FROM torrents WHERE updated = '0' ORDER BY id DESC LIMIT 5");

    while (
$row=mysql_fetch_assoc($res)) {//do the scrape 
to

PHP Code:
$query_string "SELECT id, name, info_hash, announce FROM torrents WHERE updated = '0' ORDER BY id DESC LIMIT 5";
$query mysql_query($query_string) or die(mysql_error());

    while (
$row mysql_fetch_assoc($query)) {//do the scrape 
__________________
"FFS PPL READ GOD DAMMIT, WHAT AM I GOOGLE?"
"I Kill You!" simples


http://i.imgur.com/DtcRfH5.gif

I also Setup And Modify Trackers PM For Details
Reply With Quote
  #7  
Old 11th March 2013, 00:48
Extremlym's Avatar
Extremlym Extremlym is offline
Senior Member
 
Join Date: Oct 2012
P2P
Posts: 102
Default
Click the image to open in full size.


need a

Unknown column 'updated' in 'where clause'
Reply With Quote
  #8  
Old 11th March 2013, 00:50
daffy's Avatar
daffy daffy is offline
Senior Member
 
Join Date: Mar 2009
United Kingdom
Posts: 550
Default
open your phpmyadmin and add sql

Code:
ALTER TABLE torrents ADD updated enum('0','1') NOT NULL default '0';
__________________
"FFS PPL READ GOD DAMMIT, WHAT AM I GOOGLE?"
"I Kill You!" simples


http://i.imgur.com/DtcRfH5.gif

I also Setup And Modify Trackers PM For Details
Reply With Quote
  #9  
Old 11th March 2013, 00:52
Extremlym's Avatar
Extremlym Extremlym is offline
Senior Member
 
Join Date: Oct 2012
P2P
Posts: 102
Default
Quote:
Originally Posted by daffy View Post
open your phpmyadmin and add sql

Code:
ALTER TABLE 'torrents' ADD 'updated` enum('0','1') NOT NULL default '0';

in sql
Code:
#1064 - You have an error in your SQL syntax; check the manual that  corresponds to your MySQL server version for the right syntax to use  near ''torrents' ADD 'updated` enum('0','1') NOT NULL default '0'' at  line 1
if help you: torrents column
PHP Code:
INSERT INTO `torrents`(`id`, `info_hash`, `name`, `filename`, `save_as`, `search_text`, `descr`, `ori_descr`, `category`, `size`, `added`, `type`, `numfiles`, `comments`, `views`, `hits`, `times_completed`, `leechers`, `seeders`, `last_action`, `visible`, `banned`, `owner`, `numratings`, `ratingsum`, `nfo`, `free`, `smalld`, `recommended`, `poster`, `bgsubs`, `bgaudio`, `genre`, `genre1`, `genre2`, `sticky`, `pretime`, `afterpre`, `url`, `double_upload`, `seen`, `subs`, `external`, `x2`, `description`, `anon`, `announce`, `freeleech`, `image1`, `image2`, `torrentlang`, `torrent`, `path`, `filesize`, `tube`) VALUES ([value-1],[value-2],[value-3],[value-4],[value-5],[value-6],[value-7],[value-8],[value-9],[value-10],[value-11],[value-12],[value-13],[value-14],[value-15],[value-16],[value-17],[value-18],[value-19],[value-20],[value-21],[value-22],[value-23],[value-24],[value-25],[value-26],[value-27],[value-28],[value-29],[value-30],[value-31],[value-32],[value-33],[value-34],[value-35],[value-36],[value-37],[value-38],[value-39],[value-40],[value-41],[value-42],[value-43],[value-44],[value-45],[value-46],[value-47],[value-48],[value-49],[value-50],[value-51],[value-52],[value-53],[value-54],[value-55]) 
Reply With Quote
  #10  
Old 11th March 2013, 00:55
daffy's Avatar
daffy daffy is offline
Senior Member
 
Join Date: Mar 2009
United Kingdom
Posts: 550
Default
lol use your brain mate sorry it was my fault but you should of noticed.

updated last post
__________________
"FFS PPL READ GOD DAMMIT, WHAT AM I GOOGLE?"
"I Kill You!" simples


http://i.imgur.com/DtcRfH5.gif

I also Setup And Modify Trackers PM For Details
Reply With Quote
Reply

Tags
mega , megascrapephp , scrape

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 16:31. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.