Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* Test TS Script */
- if(isset($_GET['d'])) {
- header("Content-Type: text/plain");
- $file = "/tschecker.php";
- header("Content-Description: File Transfer");
- header("Content-Disposition: attachment; filename=tschecker.php");
- header("Content-Transfer-Encoding: binary");
- readfile($file);
- exit();
- }
- // set default timezone
- date_default_timezone_set('Europe/Berlin');
- $titolo = "TS m3u Playlist Checker";
- include(CSTR."header".STR);
- echo "\n<div style=\"width:99.99%;text-align:center\">
- <div style=\"text-align:left;padding:0;font-size:15px\">";
- $time_zone = "Europe/Rome";
- $pagetime = new DateTime('NOW', new DateTimeZone('GMT'));
- $pagetime->setTimezone(new DateTimeZone($time_zone));
- $disptime = $pagetime->format('r');
- $curl = curl_init();
- function getBetween($content,$start,$end){
- $r = explode($start, $content);
- if (isset($r[1])){
- $r = explode($end, $r[1]);
- return $r[0];
- }
- return '';
- }
- echo '
- <form style="margin-top:7px;font-size:18px" action="?lng=it&pg=tschecker" method="post" rel="external" data-ajax="false">
- <strong>Test Link ts </strong>:
- <br><input rel="external" style="width:78%;padding:5px 7px" type="text" placeholder="introduce el enlace .ts" size="20" name="url"> <input class="pulsante" type="submit" value=" Check ">
- </form> <div style="padding:5px;">';
- if(isset($_POST["url"])) {
- $_POST["url"] = str_replace("http://","",$_POST["url"]);
- $exp = explode("/",$_POST["url"]);
- $server = $exp[0];
- $type = $exp[1];
- $user = $exp[2];
- $pass = $exp[3];
- if(!$pass) $pass = $user;
- $ctx = stream_context_create(array('http'=>
- array(
- 'timeout' => 13, //1200 Seconds is 20 Minutes
- )
- ));
- $linkpanel = "http://$server/panel_api.php?username=$user&password=$pass";
- $panel = file_get_contents($linkpanel, false, $ctx);
- $start = '"status":"';
- $end = '","';
- $status = getBetween($panel,$start,$end);
- $start = '"active_cons":"';
- $end = '","';
- $active_cons = getBetween($panel,$start,$end);
- $start = '"max_connections":"';
- $end = '","';
- $max_users = getBetween($panel,$start,$end);
- $start = '"category_name":"';
- $end = '","';
- $category_name = getBetween($panel,$start,$end);
- $start = '"created_at":"';
- $end = '","';
- $created_at = getBetween($panel,$start,$end);
- $start = '"allowed_output_formats":';
- $end = '},"';
- $allowed_output_formats = getBetween($panel,$start,$end);
- $start = '"exp_date":"';
- $end = '","is_trial"';
- $exp_date = getBetween($panel,$start,$end);
- if(empty($_POST['url'])){
- echo "Il server non è disponibile!!!";
- echo "<br>";
- echo "Inserire link .ts Esempio: http://zzz.yyyyyyy.com:80/live/username/password/345.ts";
- }
- else {
- if($active_cons=="") $active_cons= " - unknown";
- if($max_users=="") $max_users= " - unknown";
- if($allowed_output_formats=="") $allowed_output_formats= " - unknown";
- if($exp_date=="") $exp_date= " - unknown";
- else $exp_date = date('d M Y H:i:s',$exp_date);
- if($created_at=="") $exp_date= " - unknown";
- else $created_at = date('d M Y H:i:s',$created_at);
- if($status=="") $status = " - unknown";
- echo "<h2 style='font-size:18px'>Resultado para: :<br><span style='font-size:15px'>".$_POST["url"]."</span></h2>";
- echo " --> Status : ".$status;
- echo "<br>";
- echo " --> Creado: ".$created_at;
- echo "<br>";
- echo " --> Expira: ".$exp_date;
- echo "<br>";
- echo " --> Usuarios conectados : $active_cons";
- echo "<br>";
- echo " --> Maximo de usuarios : $max_users";
- echo "<br>";
- echo " --> Formatos : $allowed_output_formats";
- echo "<br>";
- echo " --> Categorias. 8 primeras: $category_name - $category_name - $category_name - $category_name - $category_name - $category_name - $category_name - $category_name";
- echo "<br>";
- echo "<br> --> link de descarga: <br>";
- if($allowed_output_formats!=" - unknown"){
- if(strpos($allowed_output_formats,'"ts"')) echo "• <a class='lext' href='http://$server/get.php?username=$user&password=$pass&type=m3u&output=mpegts' download>m3u list type mpegts (.ts)</a> ";
- if(strpos($allowed_output_formats,'"m3u8"')) echo "• <a class='lext' href='http://$server/get.php?username=$user&password=$pass&type=m3u&output=hls' download>m3u list type hls (.m3u8)</a>";
- } else echo "• <a class='lext' href='http://$server/get.php?username=$user&password=$pass&type=m3u&output=mpegts' download>m3u list type mpegts (.ts)</a> ";
- echo "• <a class='lext' href='http://$server/get.php?username=$user&password=$pass&type=m3u_plus&output=mpegts' download>Download <strong>m3u Plus list</strong> type mpegts (.ts)</a> ";
- echo "<br><br><div style='width:500px'>• <a class='lext' href=\"".$linkpanel."\" target=_blank>Link panel api</a></div>";
- }
- }
- echo "\n</div>
- <p style='font-size:16px'>Este script te permite conocer el estado y algunas características (fecha de creación, fecha de caducidad, etc.) relacionadas con listas específicas de IPTV..</p>
- <hr>";
- echo "<p align=center>
- </p>";
- include(CSTR."footer".STR);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement