)/', "\$1$myserver\$2", $xml); header('Content-Type: text/xml'); echo $xml2; } else if (array_key_exists('mp3',$_GET)) { // MP3 $mp3=$_GET['mp3']; if (!preg_match("/^[-a-zA-Z0-9_]+\.mp3$/", $mp3)) die("URL MP3 INCORRECTA"); $maxRedir=5; $redirHistory=""; $url="http://www.ivoox.com/" . $mp3; // For each known url connect and retrieve the redirect url while ( $maxRedir-- > 0 && ( preg_match("/http:\/\/www\.ivoox\.com\/[-a-zA-Z0-9_]+\.mp3\$/",$url) || preg_match("/http:\/\/files\.ivoox\.com\/download\/[0-9]+\$/",$url) ) ) { $redirHistory .= $url . "
\n"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_NOBODY, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, false); curl_setopt($ch, CURLOPT_TIMEOUT, 5); // Execute $output = curl_exec($ch); if ( get_redirect_url($output) ) { $url=get_redirect_url($output); } else { // there was no redirect, should not happen $res=curl_getinfo($ch); $url=$res['url']; } curl_close($ch); } header('Location: ' . $url); echo "Redirect history: $redirHistory"; } else { // Ayuda echo ""; echo "Instrucciones:
"; echo "1. Ir a Ivoox y obtener la direccion RSS del podcast
"; echo "2. Reemplazar la parte izquierda por: http://www.latinsud.com/pub/ivoox/ivoox.php?feed= (Ver ejemplo abajo)
"; echo "3. Agregar la URL modificada a tu agregador habitual
"; echo "
"; echo "
"; echo "Ejemplo:
"; echo "
"; echo "Fuente RSS Original:
http://www.ivoox.com/feed_fg_f1189_filtro_1.xml
"; echo "
"; echo "URL Para utilizar:
http://www.latinsud.com/pub/ivoox/ivoox.php?feed=feed_fg_f1189_filtro_1.xml
"; echo "
"; echo "
"; die(); }