Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > xBTiT
Reply
  #1  
Old 25th October 2020, 21:45
JohnHasher JohnHasher is offline
Coder
 
Join Date: Apr 2020
P2P
Posts: 62
Post New Scrape System for XbtitFM
Hey guys , i actually made this for my modified XbtitFM but i think i need to publish it to get feedbacks.

the scrape system in XbtitFM is not that great. it will try to fetch only one tracker at a time and if that particular tracker is offline / under heavy load , the script will either show error or return zero peers.
The auto external update system or torrent peer auto update system in xbtitFM will not update peers if nobody visit the site or slow down the user who visit the site (To Update Peers Live)

Now i will explain my script.

Uses Scrapeer PHP library to fetch peers , know more at https://github.com/medariox/scrapeer

No need to visit the site to perform auto updates , the cronjobs will do it.
To make Auto scrape work will require root access.


How to use it?

1. Copy the fp_mscrape.php , fp_ascrape.php , afscrape.php , scraper.php files to include folder in xbtitFM.

2. Edit details.php and make the following changes (find and replace the code.) :

Code:
if (isset($_GET["act"]) && $_GET["act"]=="update")
   {

        require_once(__DIR__ .'/include/fp_mscrape.php');
       	$torrent = get_result("SELECT `announces` FROM `{$TABLE_PREFIX}files` WHERE `info_hash`='".mysqli_real_escape_string($GLOBALS['conn'],$id)."'", true, $btit_settings["cache_duration"]);
		    $urls=@unserialize($torrent[0]["announces"])?unserialize($torrent[0]["announces"]):array();
		    $keys=array_keys($urls);
		    scrape($keys, $id);

       redirect($btit_settings["url"]."/".(($btit_settings["fmhack_SEO_panel"]=="enabled" && $res_seo["activated"]=="true")?strtr($_GET["name"], $res_seo["str"], $res_seo["strto"])."-".$torrent_id.".html":"index.php?page=torrent-details&id=".$id));       //
       exit();
   }

3. Replace the function updatedata codes in functions.php (in include folder) to :

Code:
//FP - Auto Update Info Hash
function updatedata()
{
global $CURRENTPATH, $TABLE_PREFIX, $btit_settings;

    require_once $CURRENTPATH.'/fp_ascrape.php';

    global $update_interval;

    if($update_interval == 0) {
      return;
    }

    $now = time();

    $res = get_result("SELECT last_time as lt FROM {$TABLE_PREFIX}tasks WHERE task='update'", true, $btit_settings['cache_duration']);
    $row = $res[0];
    if(!$row)
    {
        do_sqlquery("INSERT INTO {$TABLE_PREFIX}tasks (task, last_time) VALUES ('update',$now)");
        return;
    }

    $ts = $row['lt'];

    if($ts + $update_interval > $now) {
      return;
    }

    do_sqlquery("UPDATE {$TABLE_PREFIX}tasks SET last_time=$now WHERE task='update' AND last_time = $ts");
    if(!mysqli_affected_rows($GLOBALS['conn'])){
      return;
    }

//Your trackers to include on auto update

$std_uscr = array( 'udp://tracker.coppersurfer.tk:6969/announce', 'udp://tracker.opentrackr.org:1337/announce', 'udp://tracker.leechers-paradise.org:6969/announce', 'udp://tracker.torrent.eu.org:451/announce', 'udp://tracker.fileparadise.in:1337/announce', 'udp://9.rarbg.com:2710/announce', 'udp://9.rarbg.to:2710/announce', 'udp://tracker.cyberia.is:6969/announce', 'udp://ipv4.tracker.harry.lu:80/announce', 'udp://exodus.desync.com:6969/announce', 'udp://opentracker.i2p.rocks:6969/announce' );
// uses 8 torrent at a time (try to getting multiscrape).
    $resurl = get_result("SELECT info_hash FROM {$TABLE_PREFIX}files ORDER BY lastupdate ASC LIMIT 8", true, $btit_settings['cache_duration']);

    if(!$resurl || count($resurl) == 0) {
        return $combinedinfohash = array();
    }

    foreach($resurl as $id => $rhash) {
        $combinedinfohash[] = $rhash['info_hash'];
  }
    //scrape($row["announce_url"],$row["info_hash"]);
    aupdscrape($std_uscr, $combinedinfohash);
}
4. to setup auto update open crontab and add job (below is an example command , make changes to make it work)

Code:
*/6 * * * * /usr/bin/php7.2 /home/public_html/include/afscrape.php

Example command explained :
*/6 * * * * means every 6 minute the auto scrape script will run (you can change it to any interval you want to auto update)
/usr/bin/php7.2 is the location of php7.2
/home/public_html/include/afscrape.php - location of the auto scrape trigger file (you can also rename this script file name to anything to avoid execution from browsers)

5. Check the site logs in admin panel to check the system

Like : Guest SUCCESS auto update of torrent infohash: 0000000000000000000000 with s:0 and l:0

reply here if you face any problem.

Bump: post your comments here about the bug / any problem you are facing to use this new system
Attached Files
File Type: zip new_scrape_system_for_xbtitfm_by_johnhasher.zip (8.5 KB, 32 views)

Last edited by JohnHasher; 25th October 2020 at 22:12. Reason: reminding things
Reply With Quote
  #2  
Old 28th October 2020, 00:01
rootKID rootKID is offline
VIP
 
Join Date: Jan 2012
P2P
Posts: 99
Default
Looks good - will test latr - outside right now...
Reply With Quote
  #3  
Old 28th October 2020, 19:56
JohnHasher JohnHasher is offline
Coder
 
Join Date: Apr 2020
P2P
Posts: 62
Default yh
Reply With Quote
  #4  
Old 1st November 2020, 19:24
JohnHasher JohnHasher is offline
Coder
 
Join Date: Apr 2020
P2P
Posts: 62
Default
if you found any bug / have any suggesion , please report here , so i can update it.
Reply With Quote
  #5  
Old 2nd November 2020, 02:12
rootKID rootKID is offline
VIP
 
Join Date: Jan 2012
P2P
Posts: 99
Default
i havent tested yet but if i find bugs ill write here :)
Reply With Quote
  #6  
Old 8th November 2020, 20:28
JohnHasher JohnHasher is offline
Coder
 
Join Date: Apr 2020
P2P
Posts: 62
Default
i want multiple reports to make sure it works fine.
Reply With Quote
  #7  
Old 19th May 2023, 07:32
crowni's Avatar
crowni crowni is offline
Senior Member
 
Join Date: Apr 2009
Bulgaria
Posts: 129
Default
Can you do it in an archive hack for a clean system installation hack?
Reply With Quote
  #8  
Old 23rd May 2023, 08:16
JohnHasher JohnHasher is offline
Coder
 
Join Date: Apr 2020
P2P
Posts: 62
Default
i didn't understand, please explain
__________________
i do custom mods in xbtitfm and torrenttrader for $$, PM me for details.
Reply With Quote
  #9  
Old 30th May 2023, 06:49
crowni's Avatar
crowni crowni is offline
Senior Member
 
Join Date: Apr 2009
Bulgaria
Posts: 129
Default
Make it a hack and not install it manually
Reply With Quote
  #10  
Old 30th May 2023, 15:31
xblade's Avatar
xblade xblade is offline
Cod3r
 
Join Date: Nov 2020
P2P
Posts: 239
Default
Quote:
Originally Posted by crowni View Post
Make it a hack and not install it manually
And the above is a coder Lol my asscan not make a hack Lol just shows you thay know fuck all
__________________

i do custom mods in torrenttrader for £
Reply With Quote
Reply

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 20:26. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.