<?php
header("Content-type:text/html;charset=utf-8");
$url = "http://looktvepg.aha.bcs.ottcn.com:8080/ysten-lvoms-epg/epg/getNewPrograms.shtml?catgId=371&actionType=OpenNew&deviceGroupId=4744&districtCode=341200&templateId=0551&random=0.00161108304746449";
$data=file_get_contents($url);
$json=json_decode($data,true);
preg_match_all('|channelName":"(.*?)"|i', $data, $name);
preg_match_all('|programUrl":"(.*?)"|i', $data, $m3u8);
$a = sizeof($name[1]);
for ($i = 0; $i <= $a-1; $i++) {
echo $name[1][$i];
echo ",";
echo $m3u8[1][$i]."<br>";
plog($name[1][$i].",".$m3u8[1][$i]);
}
echo "采集完成";
function plog($message){
$file="易视腾.txt";
if($f = file_put_contents($file, $message."\r\n",FILE_APPEND)){
}
}
?>