Guest User

Untitled

a guest
Oct 13th, 2019
1,054
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. /* Test TS Script */
  3.  
  4. if(isset($_GET['d'])) {
  5. header("Content-Type: text/plain");
  6. $file = "/tschecker.php";
  7.  
  8. header("Content-Description: File Transfer");
  9. header("Content-Disposition: attachment; filename=tschecker.php");
  10. header("Content-Transfer-Encoding: binary");
  11. readfile($file);
  12.  
  13.  
  14. exit();
  15. }
  16.  
  17. // set default timezone
  18. date_default_timezone_set('Europe/Berlin');
  19.  
  20. $titolo = "TS m3u Playlist Checker";
  21. include(CSTR."header".STR);
  22. echo "\n<div style=\"width:99.99%;text-align:center\">
  23. <div style=\"text-align:left;padding:0;font-size:15px\">";
  24.  
  25. $time_zone = "Europe/Rome";
  26. $pagetime = new DateTime('NOW', new DateTimeZone('GMT'));
  27. $pagetime->setTimezone(new DateTimeZone($time_zone));
  28. $disptime = $pagetime->format('r');
  29. $curl = curl_init();
  30.  
  31.  
  32. function getBetween($content,$start,$end){
  33.     $r = explode($start, $content);
  34.     if (isset($r[1])){
  35.         $r = explode($end, $r[1]);
  36.         return $r[0];
  37.     }
  38.     return '';
  39. }
  40.  
  41. echo '
  42. <form style="margin-top:7px;font-size:18px" action="?lng=it&amp;pg=tschecker" method="post" rel="external" data-ajax="false">
  43. &nbsp;<strong>Test Link ts </strong>:
  44. <br><input rel="external" style="width:78%;padding:5px 7px" type="text" placeholder="introduce el enlace .ts" size="20" name="url"> &nbsp;<input class="pulsante" type="submit" value=" Check ">
  45. </form> <div style="padding:5px;">';
  46.  
  47.  
  48. if(isset($_POST["url"])) {
  49.  
  50. $_POST["url"] = str_replace("http://","",$_POST["url"]);
  51.  
  52. $exp = explode("/",$_POST["url"]);
  53. $server = $exp[0];
  54. $type = $exp[1];
  55. $user = $exp[2];
  56. $pass = $exp[3];
  57.  
  58.  
  59. if(!$pass) $pass = $user;
  60.  
  61. $ctx = stream_context_create(array('http'=>
  62.     array(
  63.         'timeout' => 13,  //1200 Seconds is 20 Minutes
  64.     )
  65. ));
  66.  
  67. $linkpanel = "http://$server/panel_api.php?username=$user&password=$pass";
  68. $panel = file_get_contents($linkpanel, false, $ctx);
  69.  
  70.  
  71. $start = '"status":"';
  72. $end = '","';
  73. $status = getBetween($panel,$start,$end);
  74.  
  75. $start = '"active_cons":"';
  76. $end = '","';
  77. $active_cons = getBetween($panel,$start,$end);
  78.  
  79. $start = '"max_connections":"';
  80. $end = '","';
  81. $max_users = getBetween($panel,$start,$end);
  82.  
  83. $start = '"category_name":"';
  84. $end = '","';
  85. $category_name = getBetween($panel,$start,$end);
  86.  
  87.  
  88. $start = '"created_at":"';
  89. $end = '","';
  90. $created_at = getBetween($panel,$start,$end);
  91.  
  92. $start = '"allowed_output_formats":';
  93. $end = '},"';
  94. $allowed_output_formats = getBetween($panel,$start,$end);
  95.  
  96. $start = '"exp_date":"';
  97. $end = '","is_trial"';
  98. $exp_date = getBetween($panel,$start,$end);
  99.  
  100.  
  101.  
  102.  
  103.     if(empty($_POST['url'])){
  104.       echo "Il server non &egrave; disponibile!!!";
  105.       echo "<br>";
  106.       echo "Inserire link .ts Esempio: http://zzz.yyyyyyy.com:80/live/username/password/345.ts";
  107.     }      
  108.     else {
  109.     if($active_cons=="") $active_cons= " - unknown";
  110.     if($max_users=="") $max_users= " - unknown";
  111.     if($allowed_output_formats=="") $allowed_output_formats= " - unknown";
  112.    
  113.     if($exp_date=="") $exp_date= " - unknown";
  114.     else $exp_date = date('d M Y H:i:s',$exp_date);
  115.    
  116.     if($created_at=="") $exp_date= " - unknown";
  117.     else $created_at = date('d M Y H:i:s',$created_at);
  118.    
  119.     if($status=="") $status =  " - unknown";
  120.      
  121.     echo "<h2 style='font-size:18px'>Resultado para: :<br><span style='font-size:15px'>".$_POST["url"]."</span></h2>";
  122.    
  123.     echo "&nbsp; --> Status : ".$status;
  124.     echo "<br>";  
  125.     echo "&nbsp; --> Creado: ".$created_at;
  126.     echo "<br>";
  127.     echo "&nbsp; --> Expira: ".$exp_date;
  128.     echo "<br>";
  129.     echo "&nbsp; --> Usuarios conectados : $active_cons";
  130.     echo "<br>";
  131.     echo "&nbsp; --> Maximo de usuarios : $max_users";
  132.     echo "<br>";
  133.     echo "&nbsp; --> Formatos : $allowed_output_formats";
  134.     echo "<br>";
  135.     echo "&nbsp; --> Categorias. 8 primeras: $category_name -  $category_name - $category_name - $category_name - $category_name -  $category_name - $category_name - $category_name";
  136.     echo "<br>";
  137.     echo "<br>&nbsp; --> link de descarga: <br>";
  138.     if($allowed_output_formats!=" - unknown"){
  139.     if(strpos($allowed_output_formats,'"ts"')) echo "&bull;&nbsp;<a class='lext' href='http://$server/get.php?username=$user&password=$pass&type=m3u&output=mpegts' download>m3u list type mpegts (.ts)</a> ";
  140.     if(strpos($allowed_output_formats,'"m3u8"')) echo "&bull;&nbsp;<a class='lext' href='http://$server/get.php?username=$user&password=$pass&type=m3u&output=hls' download>m3u list type hls (.m3u8)</a>";
  141.     } else echo "&bull;&nbsp;<a class='lext' href='http://$server/get.php?username=$user&password=$pass&type=m3u&output=mpegts' download>m3u list type mpegts (.ts)</a> ";
  142.     echo "&bull;&nbsp;<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> ";
  143.     echo "<br><br><div style='width:500px'>&bull;&nbsp;<a class='lext' href=\"".$linkpanel."\" target=_blank>Link panel api</a></div>";
  144.    
  145. }
  146. }
  147. echo "\n</div>
  148. <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>
  149. <hr>";
  150.  
  151. echo "<p align=center>
  152. </p>";
  153. include(CSTR."footer".STR);
  154. ?>
RAW Paste Data