i make this scrips to my xc ui panal befor is working good but now is not working i ned help how i can fix this agen
<?php
//http://127.0.0.1/karwan.php?id=kurdsat-news-tv
$id=$_GET['id'];
$d='
$post= post($d);
$post2=search($post,'src="/live/','"');
$url='https://karwan.tv/live/'.$post2;
$m3u=post($url);
$m3u8=search($m3u,"hls: '","'");
$m3u8=str_replace('playlist','chunks',$m3u8);
header('Location:'.$m3u8);
function post($po)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $po);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, TRUE);
//curl_setopt($ch, CURLOPT_POSTFIELDS,$po);
//curl_setopt($ch, CURLOPT_COOKIEJAR, dirname(__FILE__).'/CW1');
//curl_setopt($ch, CURLOPT_COOKIEFILE, dirname(__FILE__).'/CW1');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch,CURLOPT_ENCODING, 'gz');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3',
'Accept-Encoding: gzip, deflate, br',
'Accept-Language: es-ES,es;q=0.9,fr;q=0.8',
'Cache-Control: max-age=0',
'Connection: keep-alive',
'Host: karwan.tv',
'Referer:
',
'Sec-Fetch-Mode: navigate',
'Sec-Fetch-Site: same-origin',
'Sec-Fetch-User: ?1',
'Upgrade-Insecure-Requests: 1',
'User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36'
));
$response = curl_exec($ch);
curl_close($ch);
return $response ;
}
function post2($po)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $po);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch,CURLOPT_ENCODING, 'gz');
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3',
'Accept-Encoding: gzip, deflate, br',
'Accept-Language: es-ES,es;q=0.9,fr;q=0.8',
'Cache-Control: max-age=0',
'Connection: keep-alive',
'Host: karwan.tv',
'Referer:
',
'Sec-Fetch-Mode: navigate',
'Sec-Fetch-Site: same-origin',
'Sec-Fetch-User: ?1',
'Upgrade-Insecure-Requests: 1',
'User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/78.0.3904.108 Safari/537.36'
));
$response = curl_exec($ch);
curl_close($ch);
return $response ;
}
function search($target, $start, $end){
$start_at = strpos($target, $start) + strlen($start);
$target = substr($target,$start_at);
$end_at = strpos($target, $end);
return substr($target, 0, $end_at);
}
?>