Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   xBTiT (http://www.bvlist.com/forumdisplay.php?f=30)
-   -   New Scrape System for XbtitFM (http://www.bvlist.com/showthread.php?t=12302)

JohnHasher 25th October 2020 21:45

New Scrape System for XbtitFM
 
1 Attachment(s)
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

rootKID 28th October 2020 00:01

Looks good - will test latr - outside right now...

JohnHasher 28th October 2020 19:56

yh
 
:cool:

JohnHasher 1st November 2020 19:24

if you found any bug / have any suggesion , please report here , so i can update it.

rootKID 2nd November 2020 02:12

i havent tested yet but if i find bugs ill write here :)

JohnHasher 8th November 2020 20:28

i want multiple reports to make sure it works fine.

crowni 19th May 2023 07:32

Can you do it in an archive hack for a clean system installation hack?

JohnHasher 23rd May 2023 08:16

i didn't understand, please explain

crowni 30th May 2023 06:49

Make it a hack and not install it manually

xblade 30th May 2023 15:31

Quote:

Originally Posted by crowni (Post 56833)
Make it a hack and not install it manually

And the above is a coder Lol my ass:suicide:can not make a hack Lol just shows you thay know fuck all


All times are GMT +2. The time now is 14:05.

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