/i', $response, $matches); $url=$matches[1]; $response = curl_get($url, $headers); $server = get_server_url(); $pattern = '/file:"([^"]+)"}/i'; preg_match($pattern, $response, $matches); if (isset($matches[1])) { $curl = curl_init($matches[1]); curl_setopt($curl, CURLOPT_URL, $matches[1]); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_TIMEOUT, 30); curl_setopt($curl, CURLOPT_ENCODING, ''); curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); // Solo para depuración, ten cuidado curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); // Solo para depuración, ten cuidado $response = curl_exec($curl); $play_url = str_replace("index.m3u8", "", curl_getinfo($curl)["url"]); curl_close($curl); $lineas_ts = explode("\n", $response); for ($i = 0; $i < count($lineas_ts) - 1; $i++) { if (strpos($lineas_ts[$i], '#') !== false) { echo $lineas_ts[$i].PHP_EOL; } else { echo $server.'?url='.$play_url.trim($matches[2]).$lineas_ts[$i].PHP_EOL; } } } else { echo "No se encontró la URL en el contenido."; } }else{ $headers = ["User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0"]; $response = curl_get("http://hochu.tv/", headers); $pattern = '/