')); $html=substr($html, strpos($html, 'FEC
')+strlen('FEC')); $html=explode('"clear: both;"', $html); unset($html[0]); $re = '/
(\s?\d+\.)<\/div>
([0-9.]+)<\/div> ([0-9.]*)<\/a><\/div>
(H|V)<\/div>
([0-9.]+)<\/div>
(\d+\/\d+)<\/div>
(DVB-S\d?)<\/div>
([0-9A-Za-z]+)<\/div>
([0-9.]*)<\/div>
<\/div>
(\d+)<\/div>
(.*)<\/div>/im'; foreach($html as $transponder) { $transponderM=preg_first($re, $transponder); unset($transponderM[0]); $transponder=array( "transponder" => intval($transponderM[2]), "tsid" => intval($transponderM[10]), "freq" => intval($transponderM[3]), "pol" => $transponderM[4], "rate" => intval($transponderM[5]), "fec" => $transponderM[6], "type" => $transponderM[7], "modulation" => $transponderM[8], ); $db[intval($transponder["freq"])] = $transponder; } return $db; } function processChannel($channelLink) { $pageLink = "https://www.satindex.de".$channelLink; $pageCache = "cache/".urlencode(base64_encode($pageLink)); if (!file_exists($pageCache)) { file_put_contents($pageCache, file_get_contents($pageLink)); } $html = file_get_contents($pageCache); $pmtID = preg_first('/class="cell_l"\s+>PMT Pid:<\/div>(\d+)<\/div>/m', $html)[1]; return array($pmtID); } function processTransponder($transponder) { global $channels; $pageLink = "https://www.satindex.de/frequenz/".$transponder["freq"]; $pageCache = "cache/".urlencode(base64_encode($pageLink)); if (!file_exists($pageCache)) { file_put_contents($pageCache, file_get_contents($pageLink)); } $html = file_get_contents($pageCache); $html = trim(preg_replace('/\s\s+/', ' ', $html)); $html = substr($html, strpos($html, '
$channelM[1], "name" => $channelM[2], "hdtv" => !(strpos($channelM[3], "1") === false), "encrypted" => !(strpos($channelM[4], "1") === false), "land" => $channelM[5], "kategorie" => $channelM[6], "transponder" => $transponder, "pids" => $pids, ); print_r($channel); array_push($channels, $channel); } } } $transponder = getTransponders($transponderDB); foreach($transponder as $t) { processTransponder($t); } file_put_contents("channels.json", json_encode($channels)); ?>