elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Los 10 CVE más críticos (peligrosos) de 2020


  Mostrar Temas
Páginas: [1]
1  Programación / PHP / descargar de hosts con php en: 20 Febrero 2014, 22:18 pm
ola a todo soy nuevo de este foro,

quieria saber si alguien me puede ayudar, soy principiante con php y estaba intentado hacer uno script con php para descargar de un host en este caso DDLStorage.com,pero puede ser otro putlocker,easybytez lo que sea, yo logro hacer todo hasta llegar al enlace para descargar como premium,pero cuando intento descargarlo me devuelve una pagina que me dice Error: Wrong IP .

yo paso el enlace a esta pagina php :

Código
  1. <?php
  2.  
  3. function get_size($url) {
  4.    $my_ch = curl_init();
  5.    curl_setopt($my_ch, CURLOPT_URL,$url);
  6.    curl_setopt($my_ch, CURLOPT_HEADER, true);
  7.    curl_setopt($my_ch, CURLOPT_NOBODY, true);
  8.    curl_setopt($my_ch, CURLOPT_RETURNTRANSFER, true);
  9.    curl_setopt($my_ch, CURLOPT_TIMEOUT, 10);
  10.    $r = curl_exec($my_ch);
  11.    foreach(explode("\n", $r) as $header) {
  12.        if(strpos($header, 'Content-Length:') === 0) {
  13.            return trim(substr($header,16));
  14.        }
  15.    }
  16.    return '';
  17. }
  18. // Set  params
  19. $url=(filter_var ($_GET ['url']));
  20. $name = ($_GET['title']);
  21.  
  22. //get and download
  23. if ($url)
  24. {
  25. $size=get_size($url);
  26. // Generate the server headers
  27. if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE)
  28. {
  29. header('Content-Type: application/octet-string');
  30. header('Content-Disposition: attachment; filename="' . $name . '"');
  31. header('Expires: 0');
  32. header('Content-Length: '.$size);
  33. header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  34. header("Content-Transfer-Encoding: binary");
  35. header('Pragma: public');
  36. }
  37. else
  38. {
  39. header('Content-Type: application/octet-string');
  40. header('Content-Disposition: attachment; filename="' . $name . '"');
  41. header("Content-Transfer-Encoding: binary");
  42. header('Expires: 0');
  43. header('Content-Length: '.$size);
  44. header('Pragma: no-cache');
  45. }
  46.  
  47. return($url);
  48. }
  49.  
  50. // Not found
  51. exit('File not found');
  52.  
  53. ?>

 pero el archivo no se descarga, y ententando abrir en enlace me devuelve la pagina de error: wrong Ip

Espero que alguien me pueda ayudar.
Muchas gracias
Páginas: [1]
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines