Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > xBTiT
Reply
  #1  
Old 25th October 2020, 21:45
JohnHasher's Avatar
JohnHasher JohnHasher is offline
Member
 
Join Date: Apr 2020
Posts: 11
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, 13 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's Avatar
rootKID rootKID is offline
Senior Member
 
Join Date: Jan 2012
P2P
Posts: 90
Default
Looks good - will test latr - outside right now...
Reply With Quote
  #3  
Old 28th October 2020, 19:56
JohnHasher's Avatar
JohnHasher JohnHasher is offline
Member
 
Join Date: Apr 2020
Posts: 11
Default yh
Reply With Quote
  #4  
Old 29th October 2020, 20:28
papad's Avatar
papad papad is offline
VIP
 
Join Date: Feb 2013
P2P
Posts: 94
Default
Thanks for this...
Reply With Quote
  #5  
Old 1st November 2020, 19:24
JohnHasher's Avatar
JohnHasher JohnHasher is offline
Member
 
Join Date: Apr 2020
Posts: 11
Default
if you found any bug / have any suggesion , please report here , so i can update it.
Reply With Quote
  #6  
Old 2nd November 2020, 02:12
rootKID's Avatar
rootKID rootKID is offline
Senior Member
 
Join Date: Jan 2012
P2P
Posts: 90
Default
i havent tested yet but if i find bugs ill write here :)
Reply With Quote
  #7  
Old 8th November 2020, 20:28
JohnHasher's Avatar
JohnHasher JohnHasher is offline
Member
 
Join Date: Apr 2020
Posts: 11
Default
i want multiple reports to make sure it works fine.
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 05:03. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2020, vBulletin Solutions Inc.