<?php
//header("Content-Type: application/vnd.apple.mpegurl");
$list = json_decode(file_get_contents("channels.json",true),true);
$host = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http")."://".$_SERVER['HTTP_HOST'];

echo '#EXTM3U url-tvg=""'.  "\n\n";
 for($i=0;$i<count($list);$i++)
    
      echo '#EXTINF:1 tvg-id="'.$list[$i]['cmds']['0']['ch_id'].'" group-title="aircel-stalker" tvg-name="'.$list[$i]['name'].'" tvg-logo=""https://ltsk-cdn.s3.eu-west-1.amazonaws.com/jumpstart/Temp_Live/cdn/HLS/Channel/",'.$list[$i]['name']."\n"
    .$host.'/skyplay/play.php?tv='.$list[$i]['cmds']['0']['id']."\n\n";
   
      
?>