<?php

//header("Content-Type: application/vnd.apple.mpegurl");
$list = json_decode(file_get_contents('Dhoom.json'));
$host = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http")."://".$_SERVER['HTTP_HOST'];
$JSON = $list->js->data;


echo '#EXTM3U url-tvg=""'.  "\n\n";
foreach($JSON as $channel){
      echo '#EXTINF:1 tvg-id="'.$channel->id.'" group-title="Dhoom" tvg-name="'.$channel->name.'" tvg-logo="'.$host.'/'.$channel->logo.'",'.$channel->name."\n"
    .$host.'/Dhoom/play.php?tv='.$channel->cmds[0]->ch_id."\n\n";
	 }
      
?>